diff --git a/linter_exclusions.yml b/linter_exclusions.yml index 17f4037ad10..60857eb0a17 100644 --- a/linter_exclusions.yml +++ b/linter_exclusions.yml @@ -1867,6 +1867,17 @@ network firewall policy rule-collection-group collection add-filter-collection: rule_collection_group_name: rule_exclusions: - option_length_too_long +network firewall policy rule-collection-group draft collection add-filter-collection: + parameters: + destination_addresses: + rule_exclusions: + - option_length_too_long + destination_ip_groups: + rule_exclusions: + - option_length_too_long + rule_collection_group_name: + rule_exclusions: + - option_length_too_long network firewall policy rule-collection-group collection add-nat-collection: parameters: destination_addresses: @@ -1875,16 +1886,34 @@ network firewall policy rule-collection-group collection add-nat-collection: rule_collection_group_name: rule_exclusions: - option_length_too_long +network firewall policy rule-collection-group draft collection add-nat-collection: + parameters: + destination_addresses: + rule_exclusions: + - option_length_too_long + rule_collection_group_name: + rule_exclusions: + - option_length_too_long network firewall policy rule-collection-group collection list: parameters: rule_collection_group_name: rule_exclusions: - option_length_too_long +network firewall policy rule-collection-group draft collection list: + parameters: + rule_collection_group_name: + rule_exclusions: + - option_length_too_long network firewall policy rule-collection-group collection remove: parameters: rule_collection_group_name: rule_exclusions: - option_length_too_long +network firewall policy rule-collection-group draft collection remove: + parameters: + rule_collection_group_name: + rule_exclusions: + - option_length_too_long network firewall policy rule-collection-group collection rule add: parameters: destination_addresses: @@ -1896,16 +1925,37 @@ network firewall policy rule-collection-group collection rule add: rule_collection_group_name: rule_exclusions: - option_length_too_long +network firewall policy rule-collection-group draft collection rule add: + parameters: + destination_addresses: + rule_exclusions: + - option_length_too_long + destination_ip_groups: + rule_exclusions: + - option_length_too_long + rule_collection_group_name: + rule_exclusions: + - option_length_too_long network firewall policy rule-collection-group collection rule remove: parameters: rule_collection_group_name: rule_exclusions: - option_length_too_long +network firewall policy rule-collection-group draft collection rule remove: + parameters: + rule_collection_group_name: + rule_exclusions: + - option_length_too_long network firewall policy update: parameters: require_dns_proxy_for_network_rules: rule_exclusions: - option_length_too_long +network firewall policy draft update: + parameters: + require_dns_proxy_for_network_rules: + rule_exclusions: + - option_length_too_long network firewall update: parameters: require_dns_proxy_for_network_rules: diff --git a/src/azure-firewall/HISTORY.rst b/src/azure-firewall/HISTORY.rst index e93eff242ac..4c418621f2e 100644 --- a/src/azure-firewall/HISTORY.rst +++ b/src/azure-firewall/HISTORY.rst @@ -3,6 +3,11 @@ Release History =============== +1.1.0 +++++++ +* `az network firewall policy draft create/update/show`: support policy draft commands +* `az network firewall policy rule collection group draft create/update/show`: support rule collection group draft commands + 1.0.1 ++++++ * `az network firewall policy create/update`: Add parameter `--explicit-proxy` diff --git a/src/azure-firewall/azext_firewall/_help.py b/src/azure-firewall/azext_firewall/_help.py index 54f866969b7..df6a3eb638a 100644 --- a/src/azure-firewall/azext_firewall/_help.py +++ b/src/azure-firewall/azext_firewall/_help.py @@ -281,3 +281,16 @@ Filter collection supports having a list of network rules or application rules. NatRule collection supports including a list of nat rules. """ + +helps['network firewall policy draft intrusion-detection'] = """ + type: group + short-summary: Manage intrusion signature rules and bypass rules +""" + +helps['network firewall policy rule-collection-group draft collection rule'] = """ + type: group + short-summary: Manage and configure the rule of a filter collection in the rule collection group of Azure firewall policy. + long-summary: | + Filter collection supports having a list of network rules or application rules. + NatRule collection supports including a list of nat rules. +""" diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/__init__.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/__init__.py index db73033039b..287088ebe61 100644 --- a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/__init__.py +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/__init__.py @@ -15,3 +15,4 @@ from ._show import * from ._update import * from ._wait import * +from ._deploy import * diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/_deploy.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/_deploy.py new file mode 100644 index 00000000000..16ec0a94784 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/_deploy.py @@ -0,0 +1,439 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy deploy", + is_preview=True, +) + +class Deploy(AAZCommand): + """Deploy an Azure firewall policy. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + # self._execute_operations() + # return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.FirewallPoliciesPost(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class FirewallPoliciesPost(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/deploy", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType() + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.base_policy = AAZObjectType( + serialized_name="basePolicy", + ) + _DeployHelper._build_schema_sub_resource_read(properties.base_policy) + properties.child_policies = AAZListType( + serialized_name="childPolicies", + flags={"read_only": True}, + ) + properties.dns_settings = AAZObjectType( + serialized_name="dnsSettings", + ) + properties.explicit_proxy = AAZObjectType( + serialized_name="explicitProxy", + ) + properties.firewalls = AAZListType( + flags={"read_only": True}, + ) + properties.insights = AAZObjectType() + properties.intrusion_detection = AAZObjectType( + serialized_name="intrusionDetection", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snat = AAZObjectType() + properties.sql = AAZObjectType() + properties.threat_intel_mode = AAZStrType( + serialized_name="threatIntelMode", + ) + properties.threat_intel_whitelist = AAZObjectType( + serialized_name="threatIntelWhitelist", + ) + child_policies = cls._schema_on_200.properties.child_policies + child_policies.Element = AAZObjectType() + _DeployHelper._build_schema_sub_resource_read(child_policies.Element) + + dns_settings = cls._schema_on_200.properties.dns_settings + dns_settings.enable_proxy = AAZBoolType( + serialized_name="enableProxy", + ) + dns_settings.require_proxy_for_network_rules = AAZBoolType( + serialized_name="requireProxyForNetworkRules", + nullable=True, + ) + dns_settings.servers = AAZListType() + + servers = cls._schema_on_200.properties.dns_settings.servers + servers.Element = AAZStrType() + + explicit_proxy = cls._schema_on_200.properties.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolType( + serialized_name="enableExplicitProxy", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolType( + serialized_name="enablePacFile", + nullable=True, + ) + explicit_proxy.http_port = AAZIntType( + serialized_name="httpPort", + ) + explicit_proxy.https_port = AAZIntType( + serialized_name="httpsPort", + ) + explicit_proxy.pac_file = AAZStrType( + serialized_name="pacFile", + ) + explicit_proxy.pac_file_port = AAZIntType( + serialized_name="pacFilePort", + ) + + firewalls = cls._schema_on_200.properties.firewalls + firewalls.Element = AAZObjectType() + _DeployHelper._build_schema_sub_resource_read(firewalls.Element) + + insights = cls._schema_on_200.properties.insights + insights.is_enabled = AAZBoolType( + serialized_name="isEnabled", + ) + insights.log_analytics_resources = AAZObjectType( + serialized_name="logAnalyticsResources", + ) + insights.retention_days = AAZIntType( + serialized_name="retentionDays", + ) + + log_analytics_resources = cls._schema_on_200.properties.insights.log_analytics_resources + log_analytics_resources.default_workspace_id = AAZObjectType( + serialized_name="defaultWorkspaceId", + ) + _DeployHelper._build_schema_sub_resource_read(log_analytics_resources.default_workspace_id) + log_analytics_resources.workspaces = AAZListType() + + workspaces = cls._schema_on_200.properties.insights.log_analytics_resources.workspaces + workspaces.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.insights.log_analytics_resources.workspaces.Element + _element.region = AAZStrType() + _element.workspace_id = AAZObjectType( + serialized_name="workspaceId", + ) + _DeployHelper._build_schema_sub_resource_read(_element.workspace_id) + + intrusion_detection = cls._schema_on_200.properties.intrusion_detection + intrusion_detection.configuration = AAZObjectType() + intrusion_detection.mode = AAZStrType() + + configuration = cls._schema_on_200.properties.intrusion_detection.configuration + configuration.bypass_traffic_settings = AAZListType( + serialized_name="bypassTrafficSettings", + ) + configuration.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + configuration.signature_overrides = AAZListType( + serialized_name="signatureOverrides", + ) + + bypass_traffic_settings = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element + _element.description = AAZStrType() + _element.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + _element.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + _element.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + _element.name = AAZStrType() + _element.protocol = AAZStrType() + _element.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + _element.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ip_groups = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrType() + + source_addresses = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrType() + + private_ranges = cls._schema_on_200.properties.intrusion_detection.configuration.private_ranges + private_ranges.Element = AAZStrType() + + signature_overrides = cls._schema_on_200.properties.intrusion_detection.configuration.signature_overrides + signature_overrides.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.intrusion_detection.configuration.signature_overrides.Element + _element.id = AAZStrType() + _element.mode = AAZStrType() + + snat = cls._schema_on_200.properties.snat + snat.auto_learn_private_ranges = AAZStrType( + serialized_name="autoLearnPrivateRanges", + ) + snat.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + + private_ranges = cls._schema_on_200.properties.snat.private_ranges + private_ranges.Element = AAZStrType() + + sql = cls._schema_on_200.properties.sql + sql.allow_sql_redirect = AAZBoolType( + serialized_name="allowSqlRedirect", + ) + + threat_intel_whitelist = cls._schema_on_200.properties.threat_intel_whitelist + threat_intel_whitelist.fqdns = AAZListType() + threat_intel_whitelist.ip_addresses = AAZListType( + serialized_name="ipAddresses", + ) + + fqdns = cls._schema_on_200.properties.threat_intel_whitelist.fqdns + fqdns.Element = AAZStrType() + + ip_addresses = cls._schema_on_200.properties.threat_intel_whitelist.ip_addresses + ip_addresses.Element = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _DeployHelper: + """Helper class for Deploy""" + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + _schema.id = cls._schema_sub_resource_read.id + + +__all__ = ["Deploy"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/__init__.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/__init__.py index 28d5f355813..c5fa287a2b7 100644 --- a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/__init__.py +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/__init__.py @@ -9,4 +9,5 @@ # flake8: noqa from .__cmd_group import * -from ._show import * +from ._policy_show import * +from ._policy_draft_show import * diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_policy_draft_show.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_policy_draft_show.py new file mode 100644 index 00000000000..12fc250c431 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_policy_draft_show.py @@ -0,0 +1,430 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + +class DraftShow(AAZCommand): + """List all intrusion detection configuration + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/firewallpolicyDrafts/default", "2023-09-01", "properties.intrusionDetection.configuration"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["--name"], + help="The name of the Firewall Policy.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPoliciesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.intrusionDetection.configuration + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.intrusionDetection.configuration = value + return + + class FirewallPoliciesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _ShowHelper._build_schema_firewall_policy_read(cls._schema_on_200) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_firewall_policy_read = None + + @classmethod + def _build_schema_firewall_policy_read(cls, _schema): + if cls._schema_firewall_policy_read is not None: + _schema.etag = cls._schema_firewall_policy_read.etag + _schema.id = cls._schema_firewall_policy_read.id + _schema.identity = cls._schema_firewall_policy_read.identity + _schema.location = cls._schema_firewall_policy_read.location + _schema.name = cls._schema_firewall_policy_read.name + _schema.properties = cls._schema_firewall_policy_read.properties + _schema.tags = cls._schema_firewall_policy_read.tags + _schema.type = cls._schema_firewall_policy_read.type + return + + cls._schema_firewall_policy_read = _schema_firewall_policy_read = AAZObjectType() + + firewall_policy_read = _schema_firewall_policy_read + firewall_policy_read.etag = AAZStrType( + flags={"read_only": True}, + ) + firewall_policy_read.id = AAZStrType() + firewall_policy_read.identity = AAZObjectType() + firewall_policy_read.location = AAZStrType() + firewall_policy_read.name = AAZStrType( + flags={"read_only": True}, + ) + firewall_policy_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + firewall_policy_read.tags = AAZDictType() + firewall_policy_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_firewall_policy_read.properties + properties.base_policy = AAZObjectType( + serialized_name="basePolicy", + ) + + properties.dns_settings = AAZObjectType( + serialized_name="dnsSettings", + ) + properties.explicit_proxy = AAZObjectType( + serialized_name="explicitProxy", + ) + properties.firewalls = AAZListType( + flags={"read_only": True}, + ) + properties.insights = AAZObjectType() + properties.intrusion_detection = AAZObjectType( + serialized_name="intrusionDetection", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rule_collection_groups = AAZListType( + serialized_name="ruleCollectionGroups", + flags={"read_only": True}, + ) + properties.sku = AAZObjectType() + properties.snat = AAZObjectType() + properties.sql = AAZObjectType() + properties.threat_intel_mode = AAZStrType( + serialized_name="threatIntelMode", + ) + properties.threat_intel_whitelist = AAZObjectType( + serialized_name="threatIntelWhitelist", + ) + + dns_settings = _schema_firewall_policy_read.properties.dns_settings + dns_settings.enable_proxy = AAZBoolType( + serialized_name="enableProxy", + ) + dns_settings.require_proxy_for_network_rules = AAZBoolType( + serialized_name="requireProxyForNetworkRules", + nullable=True, + ) + dns_settings.servers = AAZListType() + + servers = _schema_firewall_policy_read.properties.dns_settings.servers + servers.Element = AAZStrType() + + explicit_proxy = _schema_firewall_policy_read.properties.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolType( + serialized_name="enableExplicitProxy", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolType( + serialized_name="enablePacFile", + nullable=True, + ) + explicit_proxy.http_port = AAZIntType( + serialized_name="httpPort", + ) + explicit_proxy.https_port = AAZIntType( + serialized_name="httpsPort", + ) + explicit_proxy.pac_file = AAZStrType( + serialized_name="pacFile", + ) + explicit_proxy.pac_file_port = AAZIntType( + serialized_name="pacFilePort", + ) + + firewalls = _schema_firewall_policy_read.properties.firewalls + firewalls.Element = AAZObjectType() + cls._build_schema_sub_resource_read(firewalls.Element) + + insights = _schema_firewall_policy_read.properties.insights + insights.is_enabled = AAZBoolType( + serialized_name="isEnabled", + ) + insights.log_analytics_resources = AAZObjectType( + serialized_name="logAnalyticsResources", + ) + insights.retention_days = AAZIntType( + serialized_name="retentionDays", + ) + + log_analytics_resources = _schema_firewall_policy_read.properties.insights.log_analytics_resources + log_analytics_resources.default_workspace_id = AAZObjectType( + serialized_name="defaultWorkspaceId", + ) + cls._build_schema_sub_resource_read(log_analytics_resources.default_workspace_id) + log_analytics_resources.workspaces = AAZListType() + + workspaces = _schema_firewall_policy_read.properties.insights.log_analytics_resources.workspaces + workspaces.Element = AAZObjectType() + + _element = _schema_firewall_policy_read.properties.insights.log_analytics_resources.workspaces.Element + _element.region = AAZStrType() + _element.workspace_id = AAZObjectType( + serialized_name="workspaceId", + ) + cls._build_schema_sub_resource_read(_element.workspace_id) + + intrusion_detection = _schema_firewall_policy_read.properties.intrusion_detection + intrusion_detection.configuration = AAZObjectType() + intrusion_detection.mode = AAZStrType() + + configuration = _schema_firewall_policy_read.properties.intrusion_detection.configuration + configuration.bypass_traffic_settings = AAZListType( + serialized_name="bypassTrafficSettings", + ) + configuration.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + configuration.signature_overrides = AAZListType( + serialized_name="signatureOverrides", + ) + + bypass_traffic_settings = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectType() + + _element = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element + _element.description = AAZStrType() + _element.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + _element.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + _element.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + _element.name = AAZStrType() + _element.protocol = AAZStrType() + _element.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + _element.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrType() + + private_ranges = _schema_firewall_policy_read.properties.intrusion_detection.configuration.private_ranges + private_ranges.Element = AAZStrType() + + signature_overrides = _schema_firewall_policy_read.properties.intrusion_detection.configuration.signature_overrides + signature_overrides.Element = AAZObjectType() + + _element = _schema_firewall_policy_read.properties.intrusion_detection.configuration.signature_overrides.Element + _element.id = AAZStrType() + _element.mode = AAZStrType() + + rule_collection_groups = _schema_firewall_policy_read.properties.rule_collection_groups + rule_collection_groups.Element = AAZObjectType() + cls._build_schema_sub_resource_read(rule_collection_groups.Element) + + sku = _schema_firewall_policy_read.properties.sku + sku.tier = AAZStrType() + + snat = _schema_firewall_policy_read.properties.snat + snat.auto_learn_private_ranges = AAZStrType( + serialized_name="autoLearnPrivateRanges", + ) + snat.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + + private_ranges = _schema_firewall_policy_read.properties.snat.private_ranges + private_ranges.Element = AAZStrType() + + sql = _schema_firewall_policy_read.properties.sql + sql.allow_sql_redirect = AAZBoolType( + serialized_name="allowSqlRedirect", + ) + + threat_intel_whitelist = _schema_firewall_policy_read.properties.threat_intel_whitelist + threat_intel_whitelist.fqdns = AAZListType() + threat_intel_whitelist.ip_addresses = AAZListType( + serialized_name="ipAddresses", + ) + + fqdns = _schema_firewall_policy_read.properties.threat_intel_whitelist.fqdns + fqdns.Element = AAZStrType() + + ip_addresses = _schema_firewall_policy_read.properties.threat_intel_whitelist.ip_addresses + ip_addresses.Element = AAZStrType() + + tags = _schema_firewall_policy_read.tags + tags.Element = AAZStrType() + + _schema.etag = cls._schema_firewall_policy_read.etag + _schema.id = cls._schema_firewall_policy_read.id + _schema.identity = cls._schema_firewall_policy_read.identity + _schema.location = cls._schema_firewall_policy_read.location + _schema.name = cls._schema_firewall_policy_read.name + _schema.properties = cls._schema_firewall_policy_read.properties + _schema.tags = cls._schema_firewall_policy_read.tags + _schema.type = cls._schema_firewall_policy_read.type + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_sub_resource_read.id + + +__all__ = ["DraftShow"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_show.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_policy_show.py similarity index 99% rename from src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_show.py rename to src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_policy_show.py index 3b06d774666..6b49c3d60ba 100644 --- a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_show.py +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/intrusion_detection/_policy_show.py @@ -11,7 +11,7 @@ from azure.cli.core.aaz import * -class Show(AAZCommand): +class PolicyShow(AAZCommand): """List all intrusion detection configuration """ @@ -477,4 +477,4 @@ def _build_schema_sub_resource_read(cls, _schema): _schema.id = cls._schema_sub_resource_read.id -__all__ = ["Show"] +__all__ = ["PolicyShow"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/__cmd_group.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/__cmd_group.py new file mode 100644 index 00000000000..97867ebdcb9 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "network firewall policy draft", +) +class __CMDGroup(AAZCommandGroup): + """Manage and configure Azure firewall policy draft. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/__init__.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/__init__.py new file mode 100644 index 00000000000..3ce619cc658 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._show import * +from ._update import * +from ._wait import * \ No newline at end of file diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_create.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_create.py new file mode 100644 index 00000000000..3c84612a88a --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_create.py @@ -0,0 +1,636 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy draft create", + is_preview=True, +) + +class Create(AAZCommand): + """Create an Azure firewall policy draft. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/firewallPolicyDrafts/default", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.base_policy = AAZStrArg( + options=["--base-policy"], + help="The name or ID of parent firewall policy from which rules are inherited.", + ) + _args_schema.sql = AAZBoolArg( + options=["--sql"], + help="A flag to indicate if SQL Redirect traffic filtering is enabled.", + is_preview=True, + ) + _args_schema.threat_intel_mode = AAZStrArg( + options=["--threat-intel-mode"], + help="The operation mode for Threat Intelligence.", + enum={"Alert": "Alert", "Deny": "Deny", "Off": "Off"}, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "DNS" + _args_schema = cls._args_schema + _args_schema.enable_dns_proxy = AAZBoolArg( + options=["--enable-dns-proxy"], + arg_group="DNS", + help="Enable DNS Proxy.", + ) + _args_schema.dns_servers = AAZListArg( + options=["--dns-servers"], + arg_group="DNS", + help="Space-separated list of DNS server IP addresses.", + ) + dns_servers = cls._args_schema.dns_servers + dns_servers.Element = AAZStrArg() + + # define Arg Group "Explicit Proxy" + + _args_schema = cls._args_schema + _args_schema.explicit_proxy = AAZObjectArg( + options=["--explicit-proxy"], + arg_group="Explicit Proxy", + help="Explicit Proxy Settings definition.", + ) + + explicit_proxy = cls._args_schema.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolArg( + options=["enable-explicit-proxy"], + help="When set to true, explicit proxy mode is enabled.", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolArg( + options=["enable-pac-file"], + help="When set to true, pac file port and url needs to be provided.", + nullable=True, + ) + explicit_proxy.http_port = AAZIntArg( + options=["http-port"], + help="Port number for explicit proxy http protocol, cannot be greater than 64000.", + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + explicit_proxy.https_port = AAZIntArg( + options=["https-port"], + help="Port number for explicit proxy https protocol, cannot be greater than 64000.", + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + explicit_proxy.pac_file = AAZStrArg( + options=["pac-file"], + help="SAS URL for PAC file.", + ) + explicit_proxy.pac_file_port = AAZIntArg( + options=["pac-file-port"], + help="Port number for firewall to serve PAC file.", + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + + # define Arg Group "Intrustion Detection" + + _args_schema = cls._args_schema + _args_schema.idps_mode = AAZStrArg( + options=["--idps-mode"], + arg_group="Intrustion Detection", + help="IDPS mode.", + is_preview=True, + enum={"Alert": "Alert", "Deny": "Deny", "Off": "Off"}, + ) + + # define Arg Group "Snat" + + _args_schema = cls._args_schema + _args_schema.auto_learn_private_ranges = AAZStrArg( + options=["--learn-ranges", "--auto-learn-private-ranges"], + arg_group="Snat", + help="The operation mode for automatically learning private ranges to not be SNAT", + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + _args_schema.private_ranges = AAZListArg( + options=["--private-ranges"], + arg_group="Snat", + help="List of private IP addresses/IP address ranges to not be SNAT.", + ) + + private_ranges = cls._args_schema.private_ranges + private_ranges.Element = AAZStrArg() + + + # define Arg Group "Threat Intel Allowlist" + + _args_schema = cls._args_schema + _args_schema.fqdns = AAZListArg( + options=["--fqdns"], + arg_group="Threat Intel Allowlist", + help="Space-separated list of FQDNs.", + ) + _args_schema.ip_addresses = AAZListArg( + options=["--ip-addresses"], + arg_group="Threat Intel Allowlist", + help="Space-separated list of IPv4 addresses.", + ) + + fqdns = cls._args_schema.fqdns + fqdns.Element = AAZStrArg() + + ip_addresses = cls._args_schema.ip_addresses + ip_addresses.Element = AAZStrArg() + return cls._args_schema + + _args_sub_resource_create = None + + @classmethod + def _build_args_sub_resource_create(cls, _schema): + if cls._args_sub_resource_create is not None: + _schema.id = cls._args_sub_resource_create.id + return + + cls._args_sub_resource_create = AAZObjectArg() + + sub_resource_create = cls._args_sub_resource_create + sub_resource_create.id = AAZStrArg( + options=["id"], + help="Resource ID.", + ) + + _schema.id = cls._args_sub_resource_create.id + + def _execute_operations(self): + self.pre_operations() + yield self.FirewallPolicyDraftsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class FirewallPolicyDraftsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("basePolicy", AAZObjectType) + properties.set_prop("dnsSettings", AAZObjectType) + properties.set_prop("explicitProxy", AAZObjectType, ".explicit_proxy") + properties.set_prop("intrusionDetection", AAZObjectType) + properties.set_prop("snat", AAZObjectType) + properties.set_prop("sql", AAZObjectType) + properties.set_prop("threatIntelMode", AAZStrType, ".threat_intel_mode") + properties.set_prop("threatIntelWhitelist", AAZObjectType) + + base_policy = _builder.get(".properties.basePolicy") + if base_policy is not None: + base_policy.set_prop("id", AAZStrType, ".base_policy") + + dns_settings = _builder.get(".properties.dnsSettings") + if dns_settings is not None: + dns_settings.set_prop("enableProxy", AAZBoolType, ".enable_dns_proxy") + dns_settings.set_prop("servers", AAZListType, ".dns_servers") + + servers = _builder.get(".properties.dnsSettings.servers") + if servers is not None: + servers.set_elements(AAZStrType, ".") + + explicit_proxy = _builder.get(".properties.explicitProxy") + if explicit_proxy is not None: + explicit_proxy.set_prop("enableExplicitProxy", AAZBoolType, ".enable_explicit_proxy", typ_kwargs={"nullable": True}) + explicit_proxy.set_prop("enablePacFile", AAZBoolType, ".enable_pac_file", typ_kwargs={"nullable": True}) + explicit_proxy.set_prop("httpPort", AAZIntType, ".http_port") + explicit_proxy.set_prop("httpsPort", AAZIntType, ".https_port") + explicit_proxy.set_prop("pacFile", AAZStrType, ".pac_file") + explicit_proxy.set_prop("pacFilePort", AAZIntType, ".pac_file_port") + + intrusion_detection = _builder.get(".properties.intrusionDetection") + if intrusion_detection is not None: + intrusion_detection.set_prop("mode", AAZStrType, ".idps_mode") + + snat = _builder.get(".properties.snat") + if snat is not None: + snat.set_prop("autoLearnPrivateRanges", AAZStrType, ".auto_learn_private_ranges") + snat.set_prop("privateRanges", AAZListType, ".private_ranges") + + private_ranges = _builder.get(".properties.snat.privateRanges") + if private_ranges is not None: + private_ranges.set_elements(AAZStrType, ".") + + sql = _builder.get(".properties.sql") + if sql is not None: + sql.set_prop("allowSqlRedirect", AAZBoolType, ".sql") + + threat_intel_whitelist = _builder.get(".properties.threatIntelWhitelist") + if threat_intel_whitelist is not None: + threat_intel_whitelist.set_prop("fqdns", AAZListType, ".fqdns") + threat_intel_whitelist.set_prop("ipAddresses", AAZListType, ".ip_addresses") + + fqdns = _builder.get(".properties.threatIntelWhitelist.fqdns") + if fqdns is not None: + fqdns.set_elements(AAZStrType, ".") + + ip_addresses = _builder.get(".properties.threatIntelWhitelist.ipAddresses") + if ip_addresses is not None: + ip_addresses.set_elements(AAZStrType, ".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType() + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.base_policy = AAZObjectType( + serialized_name="basePolicy", + ) + _CreateHelper._build_schema_sub_resource_read(properties.base_policy) + properties.child_policies = AAZListType( + serialized_name="childPolicies", + flags={"read_only": True}, + ) + properties.dns_settings = AAZObjectType( + serialized_name="dnsSettings", + ) + properties.explicit_proxy = AAZObjectType( + serialized_name="explicitProxy", + ) + properties.insights = AAZObjectType() + properties.intrusion_detection = AAZObjectType( + serialized_name="intrusionDetection", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snat = AAZObjectType() + properties.sql = AAZObjectType() + properties.threat_intel_mode = AAZStrType( + serialized_name="threatIntelMode", + ) + properties.threat_intel_whitelist = AAZObjectType( + serialized_name="threatIntelWhitelist", + ) + + dns_settings = cls._schema_on_200_201.properties.dns_settings + dns_settings.enable_proxy = AAZBoolType( + serialized_name="enableProxy", + ) + dns_settings.require_proxy_for_network_rules = AAZBoolType( + serialized_name="requireProxyForNetworkRules", + nullable=True, + ) + dns_settings.servers = AAZListType() + + servers = cls._schema_on_200_201.properties.dns_settings.servers + servers.Element = AAZStrType() + + explicit_proxy = cls._schema_on_200_201.properties.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolType( + serialized_name="enableExplicitProxy", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolType( + serialized_name="enablePacFile", + nullable=True, + ) + explicit_proxy.http_port = AAZIntType( + serialized_name="httpPort", + ) + explicit_proxy.https_port = AAZIntType( + serialized_name="httpsPort", + ) + explicit_proxy.pac_file = AAZStrType( + serialized_name="pacFile", + ) + explicit_proxy.pac_file_port = AAZIntType( + serialized_name="pacFilePort", + ) + + insights = cls._schema_on_200_201.properties.insights + insights.is_enabled = AAZBoolType( + serialized_name="isEnabled", + ) + insights.log_analytics_resources = AAZObjectType( + serialized_name="logAnalyticsResources", + ) + insights.retention_days = AAZIntType( + serialized_name="retentionDays", + ) + + log_analytics_resources = cls._schema_on_200_201.properties.insights.log_analytics_resources + log_analytics_resources.default_workspace_id = AAZObjectType( + serialized_name="defaultWorkspaceId", + ) + _CreateHelper._build_schema_sub_resource_read(log_analytics_resources.default_workspace_id) + log_analytics_resources.workspaces = AAZListType() + + workspaces = cls._schema_on_200_201.properties.insights.log_analytics_resources.workspaces + workspaces.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.insights.log_analytics_resources.workspaces.Element + _element.region = AAZStrType() + _element.workspace_id = AAZObjectType( + serialized_name="workspaceId", + ) + _CreateHelper._build_schema_sub_resource_read(_element.workspace_id) + + intrusion_detection = cls._schema_on_200_201.properties.intrusion_detection + intrusion_detection.configuration = AAZObjectType() + intrusion_detection.mode = AAZStrType() + + configuration = cls._schema_on_200_201.properties.intrusion_detection.configuration + configuration.bypass_traffic_settings = AAZListType( + serialized_name="bypassTrafficSettings", + ) + configuration.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + configuration.signature_overrides = AAZListType( + serialized_name="signatureOverrides", + ) + + bypass_traffic_settings = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings.Element + _element.description = AAZStrType() + _element.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + _element.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + _element.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + _element.name = AAZStrType() + _element.protocol = AAZStrType() + _element.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + _element.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ip_groups = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrType() + + source_addresses = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = cls._schema_on_200_201.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrType() + + private_ranges = cls._schema_on_200_201.properties.intrusion_detection.configuration.private_ranges + private_ranges.Element = AAZStrType() + + signature_overrides = cls._schema_on_200_201.properties.intrusion_detection.configuration.signature_overrides + signature_overrides.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.intrusion_detection.configuration.signature_overrides.Element + _element.id = AAZStrType() + _element.mode = AAZStrType() + + snat = cls._schema_on_200_201.properties.snat + snat.auto_learn_private_ranges = AAZStrType( + serialized_name="autoLearnPrivateRanges", + ) + snat.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + + private_ranges = cls._schema_on_200_201.properties.snat.private_ranges + private_ranges.Element = AAZStrType() + + sql = cls._schema_on_200_201.properties.sql + sql.allow_sql_redirect = AAZBoolType( + serialized_name="allowSqlRedirect", + ) + + threat_intel_whitelist = cls._schema_on_200_201.properties.threat_intel_whitelist + threat_intel_whitelist.fqdns = AAZListType() + threat_intel_whitelist.ip_addresses = AAZListType( + serialized_name="ipAddresses", + ) + + fqdns = cls._schema_on_200_201.properties.threat_intel_whitelist.fqdns + fqdns.Element = AAZStrType() + + ip_addresses = cls._schema_on_200_201.properties.threat_intel_whitelist.ip_addresses + ip_addresses.Element = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_sub_resource_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + _schema.id = cls._schema_sub_resource_read.id + + +__all__ = ["Create"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_delete.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_delete.py new file mode 100644 index 00000000000..b5664a7f584 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_delete.py @@ -0,0 +1,162 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy draft delete", + confirmation="Are you sure you want to perform this operation?", + is_preview=True, +) + +class Delete(AAZCommand): + """Delete an Azure firewall policy draft. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/firewallPolicyDrafts/default", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.FirewallPolicyDraftsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class FirewallPolicyDraftsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_show.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_show.py new file mode 100644 index 00000000000..07574382343 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_show.py @@ -0,0 +1,427 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy draft show", + is_preview=True, +) + +class Show(AAZCommand): + """Show an Azure firewall policy draft. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/firewallPolicyDrafts/default", "2023-09-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.expand = AAZStrArg( + options=["--expand"], + help="Expands referenced resources. Default value is None.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPolicyDraftsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class FirewallPolicyDraftsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "$expand", self.ctx.args.expand, + ), + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType() + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.base_policy = AAZObjectType( + serialized_name="basePolicy", + ) + _ShowHelper._build_schema_sub_resource_read(properties.base_policy) + properties.child_policies = AAZListType( + serialized_name="childPolicies", + flags={"read_only": True}, + ) + properties.dns_settings = AAZObjectType( + serialized_name="dnsSettings", + ) + properties.explicit_proxy = AAZObjectType( + serialized_name="explicitProxy", + ) + properties.firewalls = AAZListType( + flags={"read_only": True}, + ) + properties.insights = AAZObjectType() + properties.intrusion_detection = AAZObjectType( + serialized_name="intrusionDetection", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snat = AAZObjectType() + properties.sql = AAZObjectType() + properties.threat_intel_mode = AAZStrType( + serialized_name="threatIntelMode", + ) + properties.threat_intel_whitelist = AAZObjectType( + serialized_name="threatIntelWhitelist", + ) + child_policies = cls._schema_on_200.properties.child_policies + child_policies.Element = AAZObjectType() + _ShowHelper._build_schema_sub_resource_read(child_policies.Element) + + dns_settings = cls._schema_on_200.properties.dns_settings + dns_settings.enable_proxy = AAZBoolType( + serialized_name="enableProxy", + ) + dns_settings.require_proxy_for_network_rules = AAZBoolType( + serialized_name="requireProxyForNetworkRules", + nullable=True, + ) + dns_settings.servers = AAZListType() + + servers = cls._schema_on_200.properties.dns_settings.servers + servers.Element = AAZStrType() + + explicit_proxy = cls._schema_on_200.properties.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolType( + serialized_name="enableExplicitProxy", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolType( + serialized_name="enablePacFile", + nullable=True, + ) + explicit_proxy.http_port = AAZIntType( + serialized_name="httpPort", + ) + explicit_proxy.https_port = AAZIntType( + serialized_name="httpsPort", + ) + explicit_proxy.pac_file = AAZStrType( + serialized_name="pacFile", + ) + explicit_proxy.pac_file_port = AAZIntType( + serialized_name="pacFilePort", + ) + + firewalls = cls._schema_on_200.properties.firewalls + firewalls.Element = AAZObjectType() + _ShowHelper._build_schema_sub_resource_read(firewalls.Element) + + insights = cls._schema_on_200.properties.insights + insights.is_enabled = AAZBoolType( + serialized_name="isEnabled", + ) + insights.log_analytics_resources = AAZObjectType( + serialized_name="logAnalyticsResources", + ) + insights.retention_days = AAZIntType( + serialized_name="retentionDays", + ) + + log_analytics_resources = cls._schema_on_200.properties.insights.log_analytics_resources + log_analytics_resources.default_workspace_id = AAZObjectType( + serialized_name="defaultWorkspaceId", + ) + _ShowHelper._build_schema_sub_resource_read(log_analytics_resources.default_workspace_id) + log_analytics_resources.workspaces = AAZListType() + + workspaces = cls._schema_on_200.properties.insights.log_analytics_resources.workspaces + workspaces.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.insights.log_analytics_resources.workspaces.Element + _element.region = AAZStrType() + _element.workspace_id = AAZObjectType( + serialized_name="workspaceId", + ) + _ShowHelper._build_schema_sub_resource_read(_element.workspace_id) + + intrusion_detection = cls._schema_on_200.properties.intrusion_detection + intrusion_detection.configuration = AAZObjectType() + intrusion_detection.mode = AAZStrType() + + configuration = cls._schema_on_200.properties.intrusion_detection.configuration + configuration.bypass_traffic_settings = AAZListType( + serialized_name="bypassTrafficSettings", + ) + configuration.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + configuration.signature_overrides = AAZListType( + serialized_name="signatureOverrides", + ) + + bypass_traffic_settings = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element + _element.description = AAZStrType() + _element.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + _element.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + _element.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + _element.name = AAZStrType() + _element.protocol = AAZStrType() + _element.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + _element.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ip_groups = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrType() + + source_addresses = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrType() + + private_ranges = cls._schema_on_200.properties.intrusion_detection.configuration.private_ranges + private_ranges.Element = AAZStrType() + + signature_overrides = cls._schema_on_200.properties.intrusion_detection.configuration.signature_overrides + signature_overrides.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.intrusion_detection.configuration.signature_overrides.Element + _element.id = AAZStrType() + _element.mode = AAZStrType() + + snat = cls._schema_on_200.properties.snat + snat.auto_learn_private_ranges = AAZStrType( + serialized_name="autoLearnPrivateRanges", + ) + snat.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + + private_ranges = cls._schema_on_200.properties.snat.private_ranges + private_ranges.Element = AAZStrType() + + sql = cls._schema_on_200.properties.sql + sql.allow_sql_redirect = AAZBoolType( + serialized_name="allowSqlRedirect", + ) + + threat_intel_whitelist = cls._schema_on_200.properties.threat_intel_whitelist + threat_intel_whitelist.fqdns = AAZListType() + threat_intel_whitelist.ip_addresses = AAZListType( + serialized_name="ipAddresses", + ) + + fqdns = cls._schema_on_200.properties.threat_intel_whitelist.fqdns + fqdns.Element = AAZStrType() + + ip_addresses = cls._schema_on_200.properties.threat_intel_whitelist.ip_addresses + ip_addresses.Element = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_sub_resource_read.id + + +__all__ = ["Show"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_update.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_update.py new file mode 100644 index 00000000000..e170fbafddd --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_update.py @@ -0,0 +1,988 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy draft update", + is_preview=True, +) + +class Update(AAZCommand): + """Update an Azure firewall policy draft. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/firewallPolicyDrafts/default", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sql = AAZBoolArg( + options=["--sql"], + help="A flag to indicate if SQL Redirect traffic filtering is enabled.", + is_preview=True, + nullable=True, + ) + _args_schema.threat_intel_mode = AAZStrArg( + options=["--threat-intel-mode"], + help="The operation mode for Threat Intelligence.", + nullable=True, + enum={"Alert": "Alert", "Deny": "Deny", "Off": "Off"}, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "DNS" + + _args_schema = cls._args_schema + _args_schema.enable_dns_proxy = AAZBoolArg( + options=["--enable-dns-proxy"], + arg_group="DNS", + help="Enable DNS Proxy.", + nullable=True, + ) + _args_schema.dns_servers = AAZListArg( + options=["--dns-servers"], + arg_group="DNS", + help="Space-separated list of DNS server IP addresses.", + nullable=True, + ) + + dns_servers = cls._args_schema.dns_servers + dns_servers.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Explicit Proxy" + + _args_schema = cls._args_schema + _args_schema.explicit_proxy = AAZObjectArg( + options=["--explicit-proxy"], + arg_group="Explicit Proxy", + help="Explicit Proxy Settings definition.", + nullable=True, + ) + + explicit_proxy = cls._args_schema.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolArg( + options=["enable-explicit-proxy"], + help="When set to true, explicit proxy mode is enabled.", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolArg( + options=["enable-pac-file"], + help="When set to true, pac file port and url needs to be provided.", + nullable=True, + ) + explicit_proxy.http_port = AAZIntArg( + options=["http-port"], + help="Port number for explicit proxy http protocol, cannot be greater than 64000.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + explicit_proxy.https_port = AAZIntArg( + options=["https-port"], + help="Port number for explicit proxy https protocol, cannot be greater than 64000.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + explicit_proxy.pac_file = AAZStrArg( + options=["pac-file"], + help="SAS URL for PAC file.", + nullable=True, + ) + explicit_proxy.pac_file_port = AAZIntArg( + options=["pac-file-port"], + help="Port number for firewall to serve PAC file.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + + # define Arg Group "IntrusionDetection" + + _args_schema = cls._args_schema + _args_schema.configuration = AAZObjectArg( + options=["--configuration"], + arg_group="IntrusionDetection", + help="Intrusion detection configuration properties.", + nullable=True, + ) + + configuration = cls._args_schema.configuration + configuration.bypass_traffic_settings = AAZListArg( + options=["bypass-traffic-settings"], + help="List of rules for traffic to bypass.", + nullable=True, + ) + configuration.private_ranges = AAZListArg( + options=["private-ranges"], + help="IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. To modify default ranges, specify your Private IP address ranges with this property", + nullable=True, + ) + configuration.signature_overrides = AAZListArg( + options=["signature-overrides"], + help="List of specific signatures states.", + nullable=True, + ) + + bypass_traffic_settings = cls._args_schema.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.configuration.bypass_traffic_settings.Element + _element.description = AAZStrArg( + options=["description"], + help="Description of the bypass traffic rule.", + nullable=True, + ) + _element.destination_addresses = AAZListArg( + options=["destination-addresses"], + help="List of destination IP addresses or ranges for this rule.", + nullable=True, + ) + _element.destination_ip_groups = AAZListArg( + options=["destination-ip-groups"], + help="List of destination IpGroups for this rule.", + nullable=True, + ) + _element.destination_ports = AAZListArg( + options=["destination-ports"], + help="List of destination ports or ranges.", + nullable=True, + ) + _element.name = AAZStrArg( + options=["name"], + help="Name of the bypass traffic rule.", + nullable=True, + ) + _element.protocol = AAZStrArg( + options=["protocol"], + help="The rule bypass protocol.", + nullable=True, + enum={"ANY": "ANY", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + _element.source_addresses = AAZListArg( + options=["source-addresses"], + help="List of source IP addresses or ranges for this rule.", + nullable=True, + ) + _element.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + help="List of source IpGroups for this rule.", + nullable=True, + ) + + destination_addresses = cls._args_schema.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + destination_ip_groups = cls._args_schema.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + destination_ports = cls._args_schema.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrArg( + nullable=True, + ) + + source_addresses = cls._args_schema.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + private_ranges = cls._args_schema.configuration.private_ranges + private_ranges.Element = AAZStrArg( + nullable=True, + ) + + signature_overrides = cls._args_schema.configuration.signature_overrides + signature_overrides.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.configuration.signature_overrides.Element + _element.id = AAZStrArg( + options=["id"], + help="Signature id.", + nullable=True, + ) + _element.mode = AAZStrArg( + options=["mode"], + help="The signature state.", + nullable=True, + enum={"Alert": "Alert", "Deny": "Deny", "Off": "Off"}, + ) + + # define Arg Group "Intrustion Detection" + + _args_schema = cls._args_schema + _args_schema.idps_mode = AAZStrArg( + options=["--idps-mode"], + arg_group="Intrustion Detection", + help="IDPS mode.", + is_preview=True, + nullable=True, + enum={"Alert": "Alert", "Deny": "Deny", "Off": "Off"}, + ) + + # define Arg Group "Snat" + + _args_schema = cls._args_schema + _args_schema.auto_learn_private_ranges = AAZStrArg( + options=["--learn-ranges", "--auto-learn-private-ranges"], + arg_group="Snat", + help="The operation mode for automatically learning private ranges to not be SNAT", + nullable=True, + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + _args_schema.private_ranges = AAZListArg( + options=["--private-ranges"], + arg_group="Snat", + help="List of private IP addresses/IP address ranges to not be SNAT.", + nullable=True, + ) + + private_ranges = cls._args_schema.private_ranges + private_ranges.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Threat Intel Allowlist" + + _args_schema = cls._args_schema + _args_schema.fqdns = AAZListArg( + options=["--fqdns"], + arg_group="Threat Intel Allowlist", + help="Space-separated list of FQDNs.", + nullable=True, + ) + _args_schema.ip_addresses = AAZListArg( + options=["--ip-addresses"], + arg_group="Threat Intel Allowlist", + help="Space-separated list of IPv4 addresses.", + nullable=True, + ) + + fqdns = cls._args_schema.fqdns + fqdns.Element = AAZStrArg( + nullable=True, + ) + + ip_addresses = cls._args_schema.ip_addresses + ip_addresses.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + _args_sub_resource_update = None + + @classmethod + def _build_args_sub_resource_update(cls, _schema): + if cls._args_sub_resource_update is not None: + _schema.id = cls._args_sub_resource_update.id + return + + cls._args_sub_resource_update = AAZObjectArg( + nullable=True, + ) + + sub_resource_update = cls._args_sub_resource_update + sub_resource_update.id = AAZStrArg( + options=["id"], + help="Resource ID.", + nullable=True, + ) + + _schema.id = cls._args_sub_resource_update.id + + def _execute_operations(self): + self.pre_operations() + self.FirewallPoliciesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.FirewallPolicyDraftsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class FirewallPoliciesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_firewall_policy_draft_read(cls._schema_on_200) + + return cls._schema_on_200 + + class FirewallPolicyDraftsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_firewall_policy_draft_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("identity", AAZObjectType) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".identity_type") + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("basePolicy", AAZObjectType) + properties.set_prop("dnsSettings", AAZObjectType) + properties.set_prop("explicitProxy", AAZObjectType, ".explicit_proxy") + properties.set_prop("intrusionDetection", AAZObjectType) + properties.set_prop("sku", AAZObjectType) + properties.set_prop("snat", AAZObjectType) + properties.set_prop("sql", AAZObjectType) + properties.set_prop("threatIntelMode", AAZStrType, ".threat_intel_mode") + properties.set_prop("threatIntelWhitelist", AAZObjectType) + properties.set_prop("transportSecurity", AAZObjectType) + + dns_settings = _builder.get(".properties.dnsSettings") + if dns_settings is not None: + dns_settings.set_prop("enableProxy", AAZBoolType, ".enable_dns_proxy") + dns_settings.set_prop("servers", AAZListType, ".dns_servers") + + servers = _builder.get(".properties.dnsSettings.servers") + if servers is not None: + servers.set_elements(AAZStrType, ".") + + explicit_proxy = _builder.get(".properties.explicitProxy") + if explicit_proxy is not None: + explicit_proxy.set_prop("enableExplicitProxy", AAZBoolType, ".enable_explicit_proxy", typ_kwargs={"nullable": True}) + explicit_proxy.set_prop("enablePacFile", AAZBoolType, ".enable_pac_file", typ_kwargs={"nullable": True}) + explicit_proxy.set_prop("httpPort", AAZIntType, ".http_port") + explicit_proxy.set_prop("httpsPort", AAZIntType, ".https_port") + explicit_proxy.set_prop("pacFile", AAZStrType, ".pac_file") + explicit_proxy.set_prop("pacFilePort", AAZIntType, ".pac_file_port") + + intrusion_detection = _builder.get(".properties.intrusionDetection") + if intrusion_detection is not None: + intrusion_detection.set_prop("configuration", AAZObjectType, ".configuration") + intrusion_detection.set_prop("mode", AAZStrType, ".idps_mode") + + configuration = _builder.get(".properties.intrusionDetection.configuration") + if configuration is not None: + configuration.set_prop("bypassTrafficSettings", AAZListType, ".bypass_traffic_settings") + configuration.set_prop("privateRanges", AAZListType, ".private_ranges") + configuration.set_prop("signatureOverrides", AAZListType, ".signature_overrides") + + bypass_traffic_settings = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings") + if bypass_traffic_settings is not None: + bypass_traffic_settings.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings[]") + if _elements is not None: + _elements.set_prop("description", AAZStrType, ".description") + _elements.set_prop("destinationAddresses", AAZListType, ".destination_addresses") + _elements.set_prop("destinationIpGroups", AAZListType, ".destination_ip_groups") + _elements.set_prop("destinationPorts", AAZListType, ".destination_ports") + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_prop("protocol", AAZStrType, ".protocol") + _elements.set_prop("sourceAddresses", AAZListType, ".source_addresses") + _elements.set_prop("sourceIpGroups", AAZListType, ".source_ip_groups") + + destination_addresses = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings[].destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_ip_groups = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings[].destinationIpGroups") + if destination_ip_groups is not None: + destination_ip_groups.set_elements(AAZStrType, ".") + + destination_ports = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings[].destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + source_addresses = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings[].sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.intrusionDetection.configuration.bypassTrafficSettings[].sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + private_ranges = _builder.get(".properties.intrusionDetection.configuration.privateRanges") + if private_ranges is not None: + private_ranges.set_elements(AAZStrType, ".") + + signature_overrides = _builder.get(".properties.intrusionDetection.configuration.signatureOverrides") + if signature_overrides is not None: + signature_overrides.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.intrusionDetection.configuration.signatureOverrides[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id") + _elements.set_prop("mode", AAZStrType, ".mode") + + snat = _builder.get(".properties.snat") + if snat is not None: + snat.set_prop("autoLearnPrivateRanges", AAZStrType, ".auto_learn_private_ranges") + snat.set_prop("privateRanges", AAZListType, ".private_ranges") + + private_ranges = _builder.get(".properties.snat.privateRanges") + if private_ranges is not None: + private_ranges.set_elements(AAZStrType, ".") + + sql = _builder.get(".properties.sql") + if sql is not None: + sql.set_prop("allowSqlRedirect", AAZBoolType, ".sql") + + threat_intel_whitelist = _builder.get(".properties.threatIntelWhitelist") + if threat_intel_whitelist is not None: + threat_intel_whitelist.set_prop("fqdns", AAZListType, ".fqdns") + threat_intel_whitelist.set_prop("ipAddresses", AAZListType, ".ip_addresses") + + fqdns = _builder.get(".properties.threatIntelWhitelist.fqdns") + if fqdns is not None: + fqdns.set_elements(AAZStrType, ".") + + ip_addresses = _builder.get(".properties.threatIntelWhitelist.ipAddresses") + if ip_addresses is not None: + ip_addresses.set_elements(AAZStrType, ".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_sub_resource_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + + _schema_firewall_policy_draft_read = None + + @classmethod + def _build_schema_firewall_policy_draft_read(cls, _schema): + if cls._schema_firewall_policy_draft_read is not None: + _schema.etag = cls._schema_firewall_policy_draft_read.etag + _schema.id = cls._schema_firewall_policy_draft_read.id + _schema.name = cls._schema_firewall_policy_draft_read.name + _schema.properties = cls._schema_firewall_policy_draft_read.properties + _schema.tags = cls._schema_firewall_policy_draft_read.tags + _schema.type = cls._schema_firewall_policy_draft_read.type + return + + cls._schema_firewall_policy_draft_read = _schema_firewall_policy_read = AAZObjectType() + + firewall_policy_read = _schema_firewall_policy_read + firewall_policy_read.etag = AAZStrType( + flags={"read_only": True}, + ) + firewall_policy_read.id = AAZStrType() + firewall_policy_read.name = AAZStrType( + flags={"read_only": True}, + ) + firewall_policy_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + firewall_policy_read.tags = AAZDictType() + firewall_policy_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_firewall_policy_read.properties + properties.base_policy = AAZObjectType( + serialized_name="basePolicy", + ) + cls._build_schema_sub_resource_read(properties.base_policy) + properties.dns_settings = AAZObjectType( + serialized_name="dnsSettings", + ) + properties.explicit_proxy = AAZObjectType( + serialized_name="explicitProxy", + ) + properties.firewalls = AAZListType( + flags={"read_only": True}, + ) + properties.insights = AAZObjectType() + properties.intrusion_detection = AAZObjectType( + serialized_name="intrusionDetection", + ) + properties.sku = AAZObjectType() + properties.snat = AAZObjectType() + properties.sql = AAZObjectType() + properties.threat_intel_mode = AAZStrType( + serialized_name="threatIntelMode", + ) + properties.threat_intel_whitelist = AAZObjectType( + serialized_name="threatIntelWhitelist", + ) + + dns_settings = _schema_firewall_policy_read.properties.dns_settings + dns_settings.enable_proxy = AAZBoolType( + serialized_name="enableProxy", + ) + dns_settings.require_proxy_for_network_rules = AAZBoolType( + serialized_name="requireProxyForNetworkRules", + nullable=True, + ) + dns_settings.servers = AAZListType() + + servers = _schema_firewall_policy_read.properties.dns_settings.servers + servers.Element = AAZStrType() + + explicit_proxy = _schema_firewall_policy_read.properties.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolType( + serialized_name="enableExplicitProxy", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolType( + serialized_name="enablePacFile", + nullable=True, + ) + explicit_proxy.http_port = AAZIntType( + serialized_name="httpPort", + ) + explicit_proxy.https_port = AAZIntType( + serialized_name="httpsPort", + ) + explicit_proxy.pac_file = AAZStrType( + serialized_name="pacFile", + ) + explicit_proxy.pac_file_port = AAZIntType( + serialized_name="pacFilePort", + ) + + insights = _schema_firewall_policy_read.properties.insights + insights.is_enabled = AAZBoolType( + serialized_name="isEnabled", + ) + insights.log_analytics_resources = AAZObjectType( + serialized_name="logAnalyticsResources", + ) + insights.retention_days = AAZIntType( + serialized_name="retentionDays", + ) + + log_analytics_resources = _schema_firewall_policy_read.properties.insights.log_analytics_resources + log_analytics_resources.default_workspace_id = AAZObjectType( + serialized_name="defaultWorkspaceId", + ) + cls._build_schema_sub_resource_read(log_analytics_resources.default_workspace_id) + log_analytics_resources.workspaces = AAZListType() + + workspaces = _schema_firewall_policy_read.properties.insights.log_analytics_resources.workspaces + workspaces.Element = AAZObjectType() + + _element = _schema_firewall_policy_read.properties.insights.log_analytics_resources.workspaces.Element + _element.region = AAZStrType() + _element.workspace_id = AAZObjectType( + serialized_name="workspaceId", + ) + cls._build_schema_sub_resource_read(_element.workspace_id) + + intrusion_detection = _schema_firewall_policy_read.properties.intrusion_detection + intrusion_detection.configuration = AAZObjectType() + intrusion_detection.mode = AAZStrType() + + configuration = _schema_firewall_policy_read.properties.intrusion_detection.configuration + configuration.bypass_traffic_settings = AAZListType( + serialized_name="bypassTrafficSettings", + ) + configuration.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + configuration.signature_overrides = AAZListType( + serialized_name="signatureOverrides", + ) + + bypass_traffic_settings = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectType() + + _element = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element + _element.description = AAZStrType() + _element.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + _element.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + _element.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + _element.name = AAZStrType() + _element.protocol = AAZStrType() + _element.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + _element.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_read.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrType() + + private_ranges = _schema_firewall_policy_read.properties.intrusion_detection.configuration.private_ranges + private_ranges.Element = AAZStrType() + + signature_overrides = _schema_firewall_policy_read.properties.intrusion_detection.configuration.signature_overrides + signature_overrides.Element = AAZObjectType() + + _element = _schema_firewall_policy_read.properties.intrusion_detection.configuration.signature_overrides.Element + _element.id = AAZStrType() + _element.mode = AAZStrType() + + snat = _schema_firewall_policy_read.properties.snat + snat.auto_learn_private_ranges = AAZStrType( + serialized_name="autoLearnPrivateRanges", + ) + snat.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + + private_ranges = _schema_firewall_policy_read.properties.snat.private_ranges + private_ranges.Element = AAZStrType() + + sql = _schema_firewall_policy_read.properties.sql + sql.allow_sql_redirect = AAZBoolType( + serialized_name="allowSqlRedirect", + ) + + threat_intel_whitelist = _schema_firewall_policy_read.properties.threat_intel_whitelist + threat_intel_whitelist.fqdns = AAZListType() + threat_intel_whitelist.ip_addresses = AAZListType( + serialized_name="ipAddresses", + ) + + fqdns = _schema_firewall_policy_read.properties.threat_intel_whitelist.fqdns + fqdns.Element = AAZStrType() + + ip_addresses = _schema_firewall_policy_read.properties.threat_intel_whitelist.ip_addresses + ip_addresses.Element = AAZStrType() + + tags = _schema_firewall_policy_read.tags + tags.Element = AAZStrType() + + _schema.etag = cls._schema_firewall_policy_draft_read.etag + _schema.id = cls._schema_firewall_policy_draft_read.id + _schema.name = cls._schema_firewall_policy_draft_read.name + _schema.properties = cls._schema_firewall_policy_draft_read.properties + _schema.tags = cls._schema_firewall_policy_draft_read.tags + _schema.type = cls._schema_firewall_policy_draft_read.type + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_sub_resource_read.id + + +__all__ = ["Update"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_wait.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_wait.py new file mode 100644 index 00000000000..6fa4905c73d --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/policy_draft/_wait.py @@ -0,0 +1,451 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy draft wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/firewallPolicyDrafts/default", "2023-09-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.expand = AAZStrArg( + options=["--expand"], + help="Expands referenced resources. Default value is None.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPoliciesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class FirewallPoliciesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "$expand", self.ctx.args.expand, + ), + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType() + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.base_policy = AAZObjectType( + serialized_name="basePolicy", + ) + _WaitHelper._build_schema_sub_resource_read(properties.base_policy) + properties.child_policies = AAZListType( + serialized_name="childPolicies", + flags={"read_only": True}, + ) + properties.dns_settings = AAZObjectType( + serialized_name="dnsSettings", + ) + properties.explicit_proxy = AAZObjectType( + serialized_name="explicitProxy", + ) + properties.firewalls = AAZListType( + flags={"read_only": True}, + ) + properties.insights = AAZObjectType() + properties.intrusion_detection = AAZObjectType( + serialized_name="intrusionDetection", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rule_collection_groups = AAZListType( + serialized_name="ruleCollectionGroups", + flags={"read_only": True}, + ) + properties.sku = AAZObjectType() + properties.snat = AAZObjectType() + properties.sql = AAZObjectType() + properties.threat_intel_mode = AAZStrType( + serialized_name="threatIntelMode", + ) + properties.threat_intel_whitelist = AAZObjectType( + serialized_name="threatIntelWhitelist", + ) + properties.transport_security = AAZObjectType( + serialized_name="transportSecurity", + ) + + child_policies = cls._schema_on_200.properties.child_policies + child_policies.Element = AAZObjectType() + _WaitHelper._build_schema_sub_resource_read(child_policies.Element) + + dns_settings = cls._schema_on_200.properties.dns_settings + dns_settings.enable_proxy = AAZBoolType( + serialized_name="enableProxy", + ) + dns_settings.require_proxy_for_network_rules = AAZBoolType( + serialized_name="requireProxyForNetworkRules", + nullable=True, + ) + dns_settings.servers = AAZListType() + + servers = cls._schema_on_200.properties.dns_settings.servers + servers.Element = AAZStrType() + + explicit_proxy = cls._schema_on_200.properties.explicit_proxy + explicit_proxy.enable_explicit_proxy = AAZBoolType( + serialized_name="enableExplicitProxy", + nullable=True, + ) + explicit_proxy.enable_pac_file = AAZBoolType( + serialized_name="enablePacFile", + nullable=True, + ) + explicit_proxy.http_port = AAZIntType( + serialized_name="httpPort", + ) + explicit_proxy.https_port = AAZIntType( + serialized_name="httpsPort", + ) + explicit_proxy.pac_file = AAZStrType( + serialized_name="pacFile", + ) + explicit_proxy.pac_file_port = AAZIntType( + serialized_name="pacFilePort", + ) + + firewalls = cls._schema_on_200.properties.firewalls + firewalls.Element = AAZObjectType() + _WaitHelper._build_schema_sub_resource_read(firewalls.Element) + + insights = cls._schema_on_200.properties.insights + insights.is_enabled = AAZBoolType( + serialized_name="isEnabled", + ) + insights.log_analytics_resources = AAZObjectType( + serialized_name="logAnalyticsResources", + ) + insights.retention_days = AAZIntType( + serialized_name="retentionDays", + ) + + log_analytics_resources = cls._schema_on_200.properties.insights.log_analytics_resources + log_analytics_resources.default_workspace_id = AAZObjectType( + serialized_name="defaultWorkspaceId", + ) + _WaitHelper._build_schema_sub_resource_read(log_analytics_resources.default_workspace_id) + log_analytics_resources.workspaces = AAZListType() + + workspaces = cls._schema_on_200.properties.insights.log_analytics_resources.workspaces + workspaces.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.insights.log_analytics_resources.workspaces.Element + _element.region = AAZStrType() + _element.workspace_id = AAZObjectType( + serialized_name="workspaceId", + ) + _WaitHelper._build_schema_sub_resource_read(_element.workspace_id) + + intrusion_detection = cls._schema_on_200.properties.intrusion_detection + intrusion_detection.configuration = AAZObjectType() + intrusion_detection.mode = AAZStrType() + + configuration = cls._schema_on_200.properties.intrusion_detection.configuration + configuration.bypass_traffic_settings = AAZListType( + serialized_name="bypassTrafficSettings", + ) + configuration.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + configuration.signature_overrides = AAZListType( + serialized_name="signatureOverrides", + ) + + bypass_traffic_settings = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings + bypass_traffic_settings.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element + _element.description = AAZStrType() + _element.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + _element.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + _element.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + _element.name = AAZStrType() + _element.protocol = AAZStrType() + _element.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + _element.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ip_groups = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.destination_ports + destination_ports.Element = AAZStrType() + + source_addresses = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = cls._schema_on_200.properties.intrusion_detection.configuration.bypass_traffic_settings.Element.source_ip_groups + source_ip_groups.Element = AAZStrType() + + private_ranges = cls._schema_on_200.properties.intrusion_detection.configuration.private_ranges + private_ranges.Element = AAZStrType() + + signature_overrides = cls._schema_on_200.properties.intrusion_detection.configuration.signature_overrides + signature_overrides.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.intrusion_detection.configuration.signature_overrides.Element + _element.id = AAZStrType() + _element.mode = AAZStrType() + + rule_collection_groups = cls._schema_on_200.properties.rule_collection_groups + rule_collection_groups.Element = AAZObjectType() + _WaitHelper._build_schema_sub_resource_read(rule_collection_groups.Element) + + sku = cls._schema_on_200.properties.sku + sku.tier = AAZStrType() + + snat = cls._schema_on_200.properties.snat + snat.auto_learn_private_ranges = AAZStrType( + serialized_name="autoLearnPrivateRanges", + ) + snat.private_ranges = AAZListType( + serialized_name="privateRanges", + ) + + private_ranges = cls._schema_on_200.properties.snat.private_ranges + private_ranges.Element = AAZStrType() + + sql = cls._schema_on_200.properties.sql + sql.allow_sql_redirect = AAZBoolType( + serialized_name="allowSqlRedirect", + ) + + threat_intel_whitelist = cls._schema_on_200.properties.threat_intel_whitelist + threat_intel_whitelist.fqdns = AAZListType() + threat_intel_whitelist.ip_addresses = AAZListType( + serialized_name="ipAddresses", + ) + + fqdns = cls._schema_on_200.properties.threat_intel_whitelist.fqdns + fqdns.Element = AAZStrType() + + ip_addresses = cls._schema_on_200.properties.threat_intel_whitelist.ip_addresses + ip_addresses.Element = AAZStrType() + + transport_security = cls._schema_on_200.properties.transport_security + transport_security.certificate_authority = AAZObjectType( + serialized_name="certificateAuthority", + ) + + certificate_authority = cls._schema_on_200.properties.transport_security.certificate_authority + certificate_authority.key_vault_secret_id = AAZStrType( + serialized_name="keyVaultSecretId", + ) + certificate_authority.name = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_sub_resource_read.id + + +__all__ = ["Wait"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/__cmd_group.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/__cmd_group.py new file mode 100644 index 00000000000..5dab8dd2d07 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "network firewall policy rule-collection-group draft", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage and configure Azure firewall policy rule collection group draft. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/__init__.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/__init__.py new file mode 100644 index 00000000000..3ce619cc658 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._show import * +from ._update import * +from ._wait import * \ No newline at end of file diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_create.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_create.py new file mode 100644 index 00000000000..1777fdc19bf --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_create.py @@ -0,0 +1,950 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy rule-collection-group draft create", + is_preview=True, +) +class Create(AAZCommand): + """Create an Azure firewall policy rule collection group draft. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/rulecollectiongroups/{}/ruleCollectionGroupDrafts/default", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.policy_name = AAZStrArg( + options=["--policy-name"], + help="The name of the Firewall Policy.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + ) + + # define Arg Group "Parameters" + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.priority = AAZIntArg( + options=["--priority"], + arg_group="Properties", + help="Priority of the Firewall Policy Rule Collection Group", + fmt=AAZIntArgFormat( + maximum=65000, + minimum=100, + ), + ) + _args_schema.rule_collections = AAZListArg( + options=["--rule-collections"], + arg_group="Properties", + help="Group of Firewall Policy rule collections.", + ) + + rule_collections = cls._args_schema.rule_collections + rule_collections.Element = AAZObjectArg() + + _element = cls._args_schema.rule_collections.Element + _element.firewall_policy_filter_rule_collection = AAZObjectArg( + options=["firewall-policy-filter-rule-collection"], + ) + _element.firewall_policy_nat_rule_collection = AAZObjectArg( + options=["firewall-policy-nat-rule-collection"], + ) + _element.name = AAZStrArg( + options=["name"], + help="The name of the rule collection.", + ) + _element.priority = AAZIntArg( + options=["priority"], + help="Priority of the Firewall Policy Rule Collection resource.", + fmt=AAZIntArgFormat( + maximum=65000, + minimum=100, + ), + ) + + firewall_policy_filter_rule_collection = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection + firewall_policy_filter_rule_collection.action = AAZObjectArg( + options=["action"], + help="The action type of a Filter rule collection.", + ) + firewall_policy_filter_rule_collection.rules = AAZListArg( + options=["rules"], + help="List of rules included in a rule collection.", + ) + + action = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.action + action.type = AAZStrArg( + options=["type"], + help="The type of action.", + enum={"Allow": "Allow", "Deny": "Deny"}, + ) + + rules = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules + rules.Element = AAZObjectArg() + cls._build_args_firewall_policy_rule_create(rules.Element) + + firewall_policy_nat_rule_collection = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection + firewall_policy_nat_rule_collection.action = AAZObjectArg( + options=["action"], + help="The action type of a Nat rule collection.", + ) + firewall_policy_nat_rule_collection.rules = AAZListArg( + options=["rules"], + help="List of rules included in a rule collection.", + ) + + action = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.action + action.type = AAZStrArg( + options=["type"], + help="The type of action.", + enum={"DNAT": "DNAT"}, + ) + + rules = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules + rules.Element = AAZObjectArg() + cls._build_args_firewall_policy_rule_create(rules.Element) + return cls._args_schema + + _args_firewall_policy_rule_collection_group_draft_create = None + + @classmethod + def _build_args_firewall_policy_rule_create(cls, _schema): + if cls._args_firewall_policy_rule_collection_group_draft_create is not None: + _schema.application_rule = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule + _schema.description = cls._args_firewall_policy_rule_collection_group_draft_create.description + _schema.name = cls._args_firewall_policy_rule_collection_group_draft_create.name + _schema.nat_rule = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule + _schema.network_rule = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule + return + + cls._args_firewall_policy_rule_collection_group_draft_create = AAZObjectArg() + + firewall_policy_rule_create = cls._args_firewall_policy_rule_collection_group_draft_create + firewall_policy_rule_create.application_rule = AAZObjectArg( + options=["application-rule"], + ) + firewall_policy_rule_create.nat_rule = AAZObjectArg( + options=["nat-rule"], + ) + firewall_policy_rule_create.network_rule = AAZObjectArg( + options=["network-rule"], + ) + firewall_policy_rule_create.description = AAZStrArg( + options=["description"], + help="Description of the rule.", + ) + firewall_policy_rule_create.name = AAZStrArg( + options=["name"], + help="Name of the rule.", + ) + + application_rule = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule + application_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + help="List of destination IP addresses or Service Tags.", + ) + application_rule.fqdn_tags = AAZListArg( + options=["fqdn-tags"], + help="List of FQDN Tags for this rule.", + ) + application_rule.protocols = AAZListArg( + options=["protocols"], + help="Array of Application Protocols.", + ) + application_rule.source_addresses = AAZListArg( + options=["source-addresses"], + help="List of source IP addresses for this rule.", + ) + application_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + help="List of source IpGroups for this rule.", + ) + application_rule.target_fqdns = AAZListArg( + options=["target-fqdns"], + help="List of FQDNs for this rule.", + ) + application_rule.target_urls = AAZListArg( + options=["target-urls"], + help="List of Urls for this rule condition.", + ) + application_rule.terminate_tls = AAZBoolArg( + options=["terminate-tls"], + help="Terminate TLS connections for this rule.", + ) + application_rule.web_categories = AAZListArg( + options=["web-categories"], + help="List of destination azure web categories.", + ) + + destination_addresses = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.destination_addresses + destination_addresses.Element = AAZStrArg() + + fqdn_tags = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.fqdn_tags + fqdn_tags.Element = AAZStrArg() + + protocols = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.protocols + protocols.Element = AAZObjectArg() + + _element = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.protocols.Element + _element.port = AAZIntArg( + options=["port"], + help="Port number for the protocol, cannot be greater than 64000.", + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + _element.protocol_type = AAZStrArg( + options=["protocol-type"], + help="Protocol type.", + enum={"Http": "Http", "Https": "Https"}, + ) + + source_addresses = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.source_addresses + source_addresses.Element = AAZStrArg() + + source_ip_groups = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg() + + target_fqdns = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.target_fqdns + target_fqdns.Element = AAZStrArg() + + target_urls = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.target_urls + target_urls.Element = AAZStrArg() + + web_categories = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule.web_categories + web_categories.Element = AAZStrArg() + + nat_rule = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule + nat_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + help="List of destination IP addresses or Service Tags.", + ) + nat_rule.destination_ports = AAZListArg( + options=["destination-ports"], + help="List of destination ports.", + ) + nat_rule.ip_protocols = AAZListArg( + options=["ip-protocols"], + help="Array of FirewallPolicyRuleNetworkProtocols.", + ) + nat_rule.source_addresses = AAZListArg( + options=["source-addresses"], + help="List of source IP addresses for this rule.", + ) + nat_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + help="List of source IpGroups for this rule.", + ) + nat_rule.translated_address = AAZStrArg( + options=["translated-address"], + help="The translated address for this NAT rule.", + ) + nat_rule.translated_fqdn = AAZStrArg( + options=["translated-fqdn"], + help="The translated FQDN for this NAT rule.", + ) + nat_rule.translated_port = AAZStrArg( + options=["translated-port"], + help="The translated port for this NAT rule.", + ) + + destination_addresses = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule.destination_addresses + destination_addresses.Element = AAZStrArg() + + destination_ports = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule.destination_ports + destination_ports.Element = AAZStrArg() + + ip_protocols = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule.ip_protocols + ip_protocols.Element = AAZStrArg( + enum={"Any": "Any", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + + source_addresses = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule.source_addresses + source_addresses.Element = AAZStrArg() + + source_ip_groups = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg() + + network_rule = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule + network_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + help="List of destination IP addresses or Service Tags.", + ) + network_rule.destination_fqdns = AAZListArg( + options=["destination-fqdns"], + help="List of destination FQDNs.", + ) + network_rule.destination_ip_groups = AAZListArg( + options=["destination-ip-groups"], + help="List of destination IpGroups for this rule.", + ) + network_rule.destination_ports = AAZListArg( + options=["destination-ports"], + help="List of destination ports.", + ) + network_rule.ip_protocols = AAZListArg( + options=["ip-protocols"], + help="Array of FirewallPolicyRuleNetworkProtocols.", + ) + network_rule.source_addresses = AAZListArg( + options=["source-addresses"], + help="List of source IP addresses for this rule.", + ) + network_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + help="List of source IpGroups for this rule.", + ) + + destination_addresses = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.destination_addresses + destination_addresses.Element = AAZStrArg() + + destination_fqdns = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.destination_fqdns + destination_fqdns.Element = AAZStrArg() + + destination_ip_groups = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.destination_ip_groups + destination_ip_groups.Element = AAZStrArg() + + destination_ports = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.destination_ports + destination_ports.Element = AAZStrArg() + + ip_protocols = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.ip_protocols + ip_protocols.Element = AAZStrArg( + enum={"Any": "Any", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + + source_addresses = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.source_addresses + source_addresses.Element = AAZStrArg() + + source_ip_groups = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg() + + _schema.application_rule = cls._args_firewall_policy_rule_collection_group_draft_create.application_rule + _schema.description = cls._args_firewall_policy_rule_collection_group_draft_create.description + _schema.name = cls._args_firewall_policy_rule_collection_group_draft_create.name + _schema.nat_rule = cls._args_firewall_policy_rule_collection_group_draft_create.nat_rule + _schema.network_rule = cls._args_firewall_policy_rule_collection_group_draft_create.network_rule + + def _execute_operations(self): + self.pre_operations() + yield self.FirewallPolicyRuleCollectionGroupsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class FirewallPolicyRuleCollectionGroupsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("name", AAZStrType, ".name") + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("priority", AAZIntType, ".priority") + properties.set_prop("ruleCollections", AAZListType, ".rule_collections") + + rule_collections = _builder.get(".properties.ruleCollections") + if rule_collections is not None: + rule_collections.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.ruleCollections[]") + if _elements is not None: + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_prop("priority", AAZIntType, ".priority") + _elements.set_const("ruleCollectionType", "FirewallPolicyFilterRuleCollection", AAZStrType, ".firewall_policy_filter_rule_collection", typ_kwargs={"flags": {"required": True}}) + _elements.set_const("ruleCollectionType", "FirewallPolicyNatRuleCollection", AAZStrType, ".firewall_policy_nat_rule_collection", typ_kwargs={"flags": {"required": True}}) + _elements.discriminate_by("ruleCollectionType", "FirewallPolicyFilterRuleCollection") + _elements.discriminate_by("ruleCollectionType", "FirewallPolicyNatRuleCollection") + + disc_firewall_policy_filter_rule_collection = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}") + if disc_firewall_policy_filter_rule_collection is not None: + disc_firewall_policy_filter_rule_collection.set_prop("action", AAZObjectType, ".firewall_policy_filter_rule_collection.action") + disc_firewall_policy_filter_rule_collection.set_prop("rules", AAZListType, ".firewall_policy_filter_rule_collection.rules") + + action = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.action") + if action is not None: + action.set_prop("type", AAZStrType, ".type") + + rules = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules") + if rules is not None: + _CreateHelper._build_schema_firewall_policy_rule_create(rules.set_elements(AAZObjectType, ".")) + + disc_firewall_policy_nat_rule_collection = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}") + if disc_firewall_policy_nat_rule_collection is not None: + disc_firewall_policy_nat_rule_collection.set_prop("action", AAZObjectType, ".firewall_policy_nat_rule_collection.action") + disc_firewall_policy_nat_rule_collection.set_prop("rules", AAZListType, ".firewall_policy_nat_rule_collection.rules") + + action = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.action") + if action is not None: + action.set_prop("type", AAZStrType, ".type") + + rules = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules") + if rules is not None: + _CreateHelper._build_schema_firewall_policy_rule_create(rules.set_elements(AAZObjectType, ".")) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType() + _schema_on_200_201.name = AAZStrType() + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.priority = AAZIntType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rule_collections = AAZListType( + serialized_name="ruleCollections", + ) + + rule_collections = cls._schema_on_200_201.properties.rule_collections + rule_collections.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.rule_collections.Element + _element.name = AAZStrType() + _element.priority = AAZIntType() + _element.rule_collection_type = AAZStrType( + serialized_name="ruleCollectionType", + flags={"required": True}, + ) + + disc_firewall_policy_filter_rule_collection = cls._schema_on_200_201.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection") + disc_firewall_policy_filter_rule_collection.action = AAZObjectType() + disc_firewall_policy_filter_rule_collection.rules = AAZListType() + + action = cls._schema_on_200_201.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").action + action.type = AAZStrType() + + rules = cls._schema_on_200_201.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").rules + rules.Element = AAZObjectType() + _CreateHelper._build_schema_firewall_policy_rule_read(rules.Element) + + disc_firewall_policy_nat_rule_collection = cls._schema_on_200_201.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection") + disc_firewall_policy_nat_rule_collection.action = AAZObjectType() + disc_firewall_policy_nat_rule_collection.rules = AAZListType() + + action = cls._schema_on_200_201.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").action + action.type = AAZStrType() + + rules = cls._schema_on_200_201.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").rules + rules.Element = AAZObjectType() + _CreateHelper._build_schema_firewall_policy_rule_read(rules.Element) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_firewall_policy_rule_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("description", AAZStrType, ".description") + _builder.set_prop("name", AAZStrType, ".name") + _builder.set_const("ruleType", "ApplicationRule", AAZStrType, ".application_rule", typ_kwargs={"flags": {"required": True}}) + _builder.set_const("ruleType", "NatRule", AAZStrType, ".nat_rule", typ_kwargs={"flags": {"required": True}}) + _builder.set_const("ruleType", "NetworkRule", AAZStrType, ".network_rule", typ_kwargs={"flags": {"required": True}}) + _builder.discriminate_by("ruleType", "ApplicationRule") + _builder.discriminate_by("ruleType", "NatRule") + _builder.discriminate_by("ruleType", "NetworkRule") + + disc_application_rule = _builder.get("{ruleType:ApplicationRule}") + if disc_application_rule is not None: + disc_application_rule.set_prop("destinationAddresses", AAZListType, ".application_rule.destination_addresses") + disc_application_rule.set_prop("fqdnTags", AAZListType, ".application_rule.fqdn_tags") + disc_application_rule.set_prop("protocols", AAZListType, ".application_rule.protocols") + disc_application_rule.set_prop("sourceAddresses", AAZListType, ".application_rule.source_addresses") + disc_application_rule.set_prop("sourceIpGroups", AAZListType, ".application_rule.source_ip_groups") + disc_application_rule.set_prop("targetFqdns", AAZListType, ".application_rule.target_fqdns") + disc_application_rule.set_prop("targetUrls", AAZListType, ".application_rule.target_urls") + disc_application_rule.set_prop("terminateTLS", AAZBoolType, ".application_rule.terminate_tls") + disc_application_rule.set_prop("webCategories", AAZListType, ".application_rule.web_categories") + + destination_addresses = _builder.get("{ruleType:ApplicationRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + fqdn_tags = _builder.get("{ruleType:ApplicationRule}.fqdnTags") + if fqdn_tags is not None: + fqdn_tags.set_elements(AAZStrType, ".") + + protocols = _builder.get("{ruleType:ApplicationRule}.protocols") + if protocols is not None: + protocols.set_elements(AAZObjectType, ".") + + _elements = _builder.get("{ruleType:ApplicationRule}.protocols[]") + if _elements is not None: + _elements.set_prop("port", AAZIntType, ".port") + _elements.set_prop("protocolType", AAZStrType, ".protocol_type") + + source_addresses = _builder.get("{ruleType:ApplicationRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get("{ruleType:ApplicationRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + target_fqdns = _builder.get("{ruleType:ApplicationRule}.targetFqdns") + if target_fqdns is not None: + target_fqdns.set_elements(AAZStrType, ".") + + target_urls = _builder.get("{ruleType:ApplicationRule}.targetUrls") + if target_urls is not None: + target_urls.set_elements(AAZStrType, ".") + + web_categories = _builder.get("{ruleType:ApplicationRule}.webCategories") + if web_categories is not None: + web_categories.set_elements(AAZStrType, ".") + + disc_nat_rule = _builder.get("{ruleType:NatRule}") + if disc_nat_rule is not None: + disc_nat_rule.set_prop("destinationAddresses", AAZListType, ".nat_rule.destination_addresses") + disc_nat_rule.set_prop("destinationPorts", AAZListType, ".nat_rule.destination_ports") + disc_nat_rule.set_prop("ipProtocols", AAZListType, ".nat_rule.ip_protocols") + disc_nat_rule.set_prop("sourceAddresses", AAZListType, ".nat_rule.source_addresses") + disc_nat_rule.set_prop("sourceIpGroups", AAZListType, ".nat_rule.source_ip_groups") + disc_nat_rule.set_prop("translatedAddress", AAZStrType, ".nat_rule.translated_address") + disc_nat_rule.set_prop("translatedFqdn", AAZStrType, ".nat_rule.translated_fqdn") + disc_nat_rule.set_prop("translatedPort", AAZStrType, ".nat_rule.translated_port") + + destination_addresses = _builder.get("{ruleType:NatRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_ports = _builder.get("{ruleType:NatRule}.destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + ip_protocols = _builder.get("{ruleType:NatRule}.ipProtocols") + if ip_protocols is not None: + ip_protocols.set_elements(AAZStrType, ".") + + source_addresses = _builder.get("{ruleType:NatRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get("{ruleType:NatRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + disc_network_rule = _builder.get("{ruleType:NetworkRule}") + if disc_network_rule is not None: + disc_network_rule.set_prop("destinationAddresses", AAZListType, ".network_rule.destination_addresses") + disc_network_rule.set_prop("destinationFqdns", AAZListType, ".network_rule.destination_fqdns") + disc_network_rule.set_prop("destinationIpGroups", AAZListType, ".network_rule.destination_ip_groups") + disc_network_rule.set_prop("destinationPorts", AAZListType, ".network_rule.destination_ports") + disc_network_rule.set_prop("ipProtocols", AAZListType, ".network_rule.ip_protocols") + disc_network_rule.set_prop("sourceAddresses", AAZListType, ".network_rule.source_addresses") + disc_network_rule.set_prop("sourceIpGroups", AAZListType, ".network_rule.source_ip_groups") + + destination_addresses = _builder.get("{ruleType:NetworkRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_fqdns = _builder.get("{ruleType:NetworkRule}.destinationFqdns") + if destination_fqdns is not None: + destination_fqdns.set_elements(AAZStrType, ".") + + destination_ip_groups = _builder.get("{ruleType:NetworkRule}.destinationIpGroups") + if destination_ip_groups is not None: + destination_ip_groups.set_elements(AAZStrType, ".") + + destination_ports = _builder.get("{ruleType:NetworkRule}.destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + ip_protocols = _builder.get("{ruleType:NetworkRule}.ipProtocols") + if ip_protocols is not None: + ip_protocols.set_elements(AAZStrType, ".") + + source_addresses = _builder.get("{ruleType:NetworkRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get("{ruleType:NetworkRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + _schema_firewall_policy_rule_read = None + + @classmethod + def _build_schema_firewall_policy_rule_read(cls, _schema): + if cls._schema_firewall_policy_rule_read is not None: + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + return + + cls._schema_firewall_policy_rule_read = _schema_firewall_policy_rule_read = AAZObjectType() + + firewall_policy_rule_read = _schema_firewall_policy_rule_read + firewall_policy_rule_read.description = AAZStrType() + firewall_policy_rule_read.name = AAZStrType() + firewall_policy_rule_read.rule_type = AAZStrType( + serialized_name="ruleType", + flags={"required": True}, + ) + + disc_application_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule") + disc_application_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_application_rule.fqdn_tags = AAZListType( + serialized_name="fqdnTags", + ) + disc_application_rule.protocols = AAZListType() + disc_application_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_application_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_application_rule.target_fqdns = AAZListType( + serialized_name="targetFqdns", + ) + disc_application_rule.target_urls = AAZListType( + serialized_name="targetUrls", + ) + disc_application_rule.terminate_tls = AAZBoolType( + serialized_name="terminateTLS", + ) + disc_application_rule.web_categories = AAZListType( + serialized_name="webCategories", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").destination_addresses + destination_addresses.Element = AAZStrType() + + fqdn_tags = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").fqdn_tags + fqdn_tags.Element = AAZStrType() + + protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols + protocols.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols.Element + _element.port = AAZIntType() + _element.protocol_type = AAZStrType( + serialized_name="protocolType", + ) + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + target_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_fqdns + target_fqdns.Element = AAZStrType() + + target_urls = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_urls + target_urls.Element = AAZStrType() + + web_categories = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").web_categories + web_categories.Element = AAZStrType() + + disc_nat_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule") + disc_nat_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_nat_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_nat_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_nat_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_nat_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_nat_rule.translated_address = AAZStrType( + serialized_name="translatedAddress", + ) + disc_nat_rule.translated_fqdn = AAZStrType( + serialized_name="translatedFqdn", + ) + disc_nat_rule.translated_port = AAZStrType( + serialized_name="translatedPort", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + disc_network_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule") + disc_network_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_network_rule.destination_fqdns = AAZListType( + serialized_name="destinationFqdns", + ) + disc_network_rule.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + disc_network_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_network_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_network_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_network_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_fqdns + destination_fqdns.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + + +__all__ = ["Create"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_delete.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_delete.py new file mode 100644 index 00000000000..9e10a253c99 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_delete.py @@ -0,0 +1,172 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy rule-collection-group draft delete", + is_preview=True, + confirmation="Are you sure you want to perform this operation?", +) + +class Delete(AAZCommand): + """Delete an Azure Firewall policy rule collection draft group. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/rulecollectiongroups/{}/ruleCollectionGroupDrafts/default", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.policy_name = AAZStrArg( + options=["--policy-name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + id_part="child_name_1", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.FirewallPolicyRuleCollectionGroupsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class FirewallPolicyRuleCollectionGroupsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_show.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_show.py new file mode 100644 index 00000000000..8bdc3bb8740 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_show.py @@ -0,0 +1,436 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy rule-collection-group draft show", + is_preview=True, +) +class Show(AAZCommand): + """Show an Azure firewall policy rule collection group draft. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/rulecollectiongroups/{}/ruleCollectionGroupDrafts/default", "2023-09-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.policy_name = AAZStrArg( + options=["--policy-name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + id_part="child_name_1", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPolicyRuleCollectionGroupsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class FirewallPolicyRuleCollectionGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.priority = AAZIntType() + properties.rule_collections = AAZListType( + serialized_name="ruleCollections", + ) + + rule_collections = cls._schema_on_200.properties.rule_collections + rule_collections.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.rule_collections.Element + _element.name = AAZStrType() + _element.priority = AAZIntType() + _element.rule_collection_type = AAZStrType( + serialized_name="ruleCollectionType", + flags={"required": True}, + ) + + disc_firewall_policy_filter_rule_collection = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection") + disc_firewall_policy_filter_rule_collection.action = AAZObjectType() + disc_firewall_policy_filter_rule_collection.rules = AAZListType() + + action = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").action + action.type = AAZStrType() + + rules = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").rules + rules.Element = AAZObjectType() + _ShowHelper._build_schema_firewall_policy_rule_read(rules.Element) + + disc_firewall_policy_nat_rule_collection = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection") + disc_firewall_policy_nat_rule_collection.action = AAZObjectType() + disc_firewall_policy_nat_rule_collection.rules = AAZListType() + + action = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").action + action.type = AAZStrType() + + rules = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").rules + rules.Element = AAZObjectType() + _ShowHelper._build_schema_firewall_policy_rule_read(rules.Element) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_firewall_policy_rule_read = None + + @classmethod + def _build_schema_firewall_policy_rule_read(cls, _schema): + if cls._schema_firewall_policy_rule_read is not None: + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + return + + cls._schema_firewall_policy_rule_read = _schema_firewall_policy_rule_read = AAZObjectType() + + firewall_policy_rule_read = _schema_firewall_policy_rule_read + firewall_policy_rule_read.description = AAZStrType() + firewall_policy_rule_read.name = AAZStrType() + firewall_policy_rule_read.rule_type = AAZStrType( + serialized_name="ruleType", + flags={"required": True}, + ) + + disc_application_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule") + disc_application_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_application_rule.fqdn_tags = AAZListType( + serialized_name="fqdnTags", + ) + disc_application_rule.protocols = AAZListType() + disc_application_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_application_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_application_rule.target_fqdns = AAZListType( + serialized_name="targetFqdns", + ) + disc_application_rule.target_urls = AAZListType( + serialized_name="targetUrls", + ) + disc_application_rule.terminate_tls = AAZBoolType( + serialized_name="terminateTLS", + ) + disc_application_rule.web_categories = AAZListType( + serialized_name="webCategories", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").destination_addresses + destination_addresses.Element = AAZStrType() + + fqdn_tags = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").fqdn_tags + fqdn_tags.Element = AAZStrType() + + protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols + protocols.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols.Element + _element.port = AAZIntType() + _element.protocol_type = AAZStrType( + serialized_name="protocolType", + ) + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + target_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_fqdns + target_fqdns.Element = AAZStrType() + + target_urls = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_urls + target_urls.Element = AAZStrType() + + web_categories = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").web_categories + web_categories.Element = AAZStrType() + + disc_nat_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule") + disc_nat_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_nat_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_nat_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_nat_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_nat_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_nat_rule.translated_address = AAZStrType( + serialized_name="translatedAddress", + ) + disc_nat_rule.translated_fqdn = AAZStrType( + serialized_name="translatedFqdn", + ) + disc_nat_rule.translated_port = AAZStrType( + serialized_name="translatedPort", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + disc_network_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule") + disc_network_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_network_rule.destination_fqdns = AAZListType( + serialized_name="destinationFqdns", + ) + disc_network_rule.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + disc_network_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_network_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_network_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_network_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_fqdns + destination_fqdns.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + + +__all__ = ["Show"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_update.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_update.py new file mode 100644 index 00000000000..55f42f20539 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_update.py @@ -0,0 +1,1493 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy rule-collection-group update", + is_preview=True, +) +class Update(AAZCommand): + """Update an Azure firewall policy rule collection group. + """ + + _aaz_info = { + "version": "2023-09-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/rulecollectiongroups/{}/ruleCollectionGroupDrafts/default", "2023-09-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.policy_name = AAZStrArg( + options=["--policy-name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + id_part="child_name_1", + ) + + # define Arg Group "Parameters" + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.priority = AAZIntArg( + options=["--priority"], + arg_group="Properties", + help="Priority of the Firewall Policy Rule Collection Group", + nullable=True, + fmt=AAZIntArgFormat( + maximum=65000, + minimum=100, + ), + ) + _args_schema.rule_collections = AAZListArg( + options=["--rule-collections"], + arg_group="Properties", + help="Group of Firewall Policy rule collections.", + nullable=True, + ) + + rule_collections = cls._args_schema.rule_collections + rule_collections.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.rule_collections.Element + _element.firewall_policy_filter_rule_collection = AAZObjectArg( + options=["firewall-policy-filter-rule-collection"], + ) + _element.firewall_policy_nat_rule_collection = AAZObjectArg( + options=["firewall-policy-nat-rule-collection"], + ) + _element.collection_name = AAZStrArg( + options=["collection-name"], + help="The name of the rule collection.", + nullable=True, + ) + _element.priority = AAZIntArg( + options=["priority"], + help="Priority of the Firewall Policy Rule Collection resource.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=65000, + minimum=100, + ), + ) + + firewall_policy_filter_rule_collection = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection + firewall_policy_filter_rule_collection.action = AAZObjectArg( + options=["action"], + help="The action type of a Filter rule collection.", + nullable=True, + ) + firewall_policy_filter_rule_collection.rules = AAZListArg( + options=["rules"], + help="List of rules included in a rule collection.", + nullable=True, + ) + + action = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.action + action.type = AAZStrArg( + options=["type"], + help="The type of action.", + nullable=True, + enum={"Allow": "Allow", "Deny": "Deny"}, + ) + + rules = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules + rules.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element + _element.application_rule = AAZObjectArg( + options=["application-rule"], + ) + _element.nat_rule = AAZObjectArg( + options=["nat-rule"], + ) + _element.network_rule = AAZObjectArg( + options=["network-rule"], + ) + _element.description = AAZStrArg( + options=["description"], + nullable=True, + ) + _element.name = AAZStrArg( + options=["name"], + nullable=True, + ) + + application_rule = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule + application_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + nullable=True, + ) + application_rule.fqdn_tags = AAZListArg( + options=["fqdn-tags"], + nullable=True, + ) + application_rule.protocols = AAZListArg( + options=["protocols"], + nullable=True, + ) + application_rule.source_addresses = AAZListArg( + options=["source-addresses"], + nullable=True, + ) + application_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + nullable=True, + ) + application_rule.target_fqdns = AAZListArg( + options=["target-fqdns"], + nullable=True, + ) + application_rule.target_urls = AAZListArg( + options=["target-urls"], + nullable=True, + ) + application_rule.terminate_tls = AAZBoolArg( + options=["terminate-tls"], + nullable=True, + ) + application_rule.web_categories = AAZListArg( + options=["web-categories"], + nullable=True, + ) + + destination_addresses = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + fqdn_tags = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.fqdn_tags + fqdn_tags.Element = AAZStrArg( + nullable=True, + ) + + protocols = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.protocols + protocols.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.protocols.Element + _element.port = AAZIntArg( + options=["port"], + nullable=True, + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + _element.protocol_type = AAZStrArg( + options=["protocol-type"], + nullable=True, + enum={"Http": "Http", "Https": "Https"}, + ) + + source_addresses = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + target_fqdns = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.target_fqdns + target_fqdns.Element = AAZStrArg( + nullable=True, + ) + + target_urls = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.target_urls + target_urls.Element = AAZStrArg( + nullable=True, + ) + + web_categories = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.application_rule.web_categories + web_categories.Element = AAZStrArg( + nullable=True, + ) + + nat_rule = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.nat_rule + nat_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + nullable=True, + ) + nat_rule.destination_ports = AAZListArg( + options=["destination-ports"], + nullable=True, + ) + nat_rule.ip_protocols = AAZListArg( + options=["ip-protocols"], + nullable=True, + ) + nat_rule.source_addresses = AAZListArg( + options=["source-addresses"], + nullable=True, + ) + nat_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + nullable=True, + ) + nat_rule.translated_address = AAZStrArg( + options=["translated-address"], + nullable=True, + ) + nat_rule.translated_fqdn = AAZStrArg( + options=["translated-fqdn"], + nullable=True, + ) + nat_rule.translated_port = AAZStrArg( + options=["translated-port"], + nullable=True, + ) + + destination_addresses = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.nat_rule.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + destination_ports = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.nat_rule.destination_ports + destination_ports.Element = AAZStrArg( + nullable=True, + ) + + ip_protocols = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.nat_rule.ip_protocols + ip_protocols.Element = AAZStrArg( + nullable=True, + enum={"Any": "Any", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + + source_addresses = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.nat_rule.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.nat_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + network_rule = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule + network_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + nullable=True, + ) + network_rule.destination_fqdns = AAZListArg( + options=["destination-fqdns"], + nullable=True, + ) + network_rule.destination_ip_groups = AAZListArg( + options=["destination-ip-groups"], + nullable=True, + ) + network_rule.destination_ports = AAZListArg( + options=["destination-ports"], + nullable=True, + ) + network_rule.ip_protocols = AAZListArg( + options=["ip-protocols"], + nullable=True, + ) + network_rule.source_addresses = AAZListArg( + options=["source-addresses"], + nullable=True, + ) + network_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + nullable=True, + ) + + destination_addresses = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + destination_fqdns = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.destination_fqdns + destination_fqdns.Element = AAZStrArg( + nullable=True, + ) + + destination_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.destination_ip_groups + destination_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + destination_ports = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.destination_ports + destination_ports.Element = AAZStrArg( + nullable=True, + ) + + ip_protocols = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.ip_protocols + ip_protocols.Element = AAZStrArg( + nullable=True, + enum={"Any": "Any", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + + source_addresses = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_filter_rule_collection.rules.Element.network_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + firewall_policy_nat_rule_collection = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection + firewall_policy_nat_rule_collection.action = AAZObjectArg( + options=["action"], + help="The action type of a Nat rule collection.", + nullable=True, + ) + firewall_policy_nat_rule_collection.rules = AAZListArg( + options=["rules"], + help="List of rules included in a rule collection.", + nullable=True, + ) + + action = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.action + action.type = AAZStrArg( + options=["type"], + help="The type of action.", + nullable=True, + enum={"DNAT": "DNAT"}, + ) + + rules = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules + rules.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element + _element.application_rule = AAZObjectArg( + options=["application-rule"], + ) + _element.nat_rule = AAZObjectArg( + options=["nat-rule"], + ) + _element.network_rule = AAZObjectArg( + options=["network-rule"], + ) + _element.description = AAZStrArg( + options=["description"], + nullable=True, + ) + _element.name = AAZStrArg( + options=["name"], + nullable=True, + ) + + application_rule = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule + application_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + nullable=True, + ) + application_rule.fqdn_tags = AAZListArg( + options=["fqdn-tags"], + nullable=True, + ) + application_rule.protocols = AAZListArg( + options=["protocols"], + nullable=True, + ) + application_rule.source_addresses = AAZListArg( + options=["source-addresses"], + nullable=True, + ) + application_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + nullable=True, + ) + application_rule.target_fqdns = AAZListArg( + options=["target-fqdns"], + nullable=True, + ) + application_rule.target_urls = AAZListArg( + options=["target-urls"], + nullable=True, + ) + application_rule.terminate_tls = AAZBoolArg( + options=["terminate-tls"], + nullable=True, + ) + application_rule.web_categories = AAZListArg( + options=["web-categories"], + nullable=True, + ) + + destination_addresses = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + fqdn_tags = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.fqdn_tags + fqdn_tags.Element = AAZStrArg( + nullable=True, + ) + + protocols = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.protocols + protocols.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.protocols.Element + _element.port = AAZIntArg( + options=["port"], + nullable=True, + fmt=AAZIntArgFormat( + maximum=64000, + minimum=0, + ), + ) + _element.protocol_type = AAZStrArg( + options=["protocol-type"], + nullable=True, + enum={"Http": "Http", "Https": "Https"}, + ) + + source_addresses = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + target_fqdns = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.target_fqdns + target_fqdns.Element = AAZStrArg( + nullable=True, + ) + + target_urls = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.target_urls + target_urls.Element = AAZStrArg( + nullable=True, + ) + + web_categories = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.application_rule.web_categories + web_categories.Element = AAZStrArg( + nullable=True, + ) + + nat_rule = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.nat_rule + nat_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + nullable=True, + ) + nat_rule.destination_ports = AAZListArg( + options=["destination-ports"], + nullable=True, + ) + nat_rule.ip_protocols = AAZListArg( + options=["ip-protocols"], + nullable=True, + ) + nat_rule.source_addresses = AAZListArg( + options=["source-addresses"], + nullable=True, + ) + nat_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + nullable=True, + ) + nat_rule.translated_address = AAZStrArg( + options=["translated-address"], + nullable=True, + ) + nat_rule.translated_fqdn = AAZStrArg( + options=["translated-fqdn"], + nullable=True, + ) + nat_rule.translated_port = AAZStrArg( + options=["translated-port"], + nullable=True, + ) + + destination_addresses = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.nat_rule.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + destination_ports = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.nat_rule.destination_ports + destination_ports.Element = AAZStrArg( + nullable=True, + ) + + ip_protocols = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.nat_rule.ip_protocols + ip_protocols.Element = AAZStrArg( + nullable=True, + enum={"Any": "Any", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + + source_addresses = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.nat_rule.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.nat_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + network_rule = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule + network_rule.destination_addresses = AAZListArg( + options=["destination-addresses"], + nullable=True, + ) + network_rule.destination_fqdns = AAZListArg( + options=["destination-fqdns"], + nullable=True, + ) + network_rule.destination_ip_groups = AAZListArg( + options=["destination-ip-groups"], + nullable=True, + ) + network_rule.destination_ports = AAZListArg( + options=["destination-ports"], + nullable=True, + ) + network_rule.ip_protocols = AAZListArg( + options=["ip-protocols"], + nullable=True, + ) + network_rule.source_addresses = AAZListArg( + options=["source-addresses"], + nullable=True, + ) + network_rule.source_ip_groups = AAZListArg( + options=["source-ip-groups"], + nullable=True, + ) + + destination_addresses = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.destination_addresses + destination_addresses.Element = AAZStrArg( + nullable=True, + ) + + destination_fqdns = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.destination_fqdns + destination_fqdns.Element = AAZStrArg( + nullable=True, + ) + + destination_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.destination_ip_groups + destination_ip_groups.Element = AAZStrArg( + nullable=True, + ) + + destination_ports = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.destination_ports + destination_ports.Element = AAZStrArg( + nullable=True, + ) + + ip_protocols = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.ip_protocols + ip_protocols.Element = AAZStrArg( + nullable=True, + enum={"Any": "Any", "ICMP": "ICMP", "TCP": "TCP", "UDP": "UDP"}, + ) + + source_addresses = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.source_addresses + source_addresses.Element = AAZStrArg( + nullable=True, + ) + + source_ip_groups = cls._args_schema.rule_collections.Element.firewall_policy_nat_rule_collection.rules.Element.network_rule.source_ip_groups + source_ip_groups.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPolicyRuleCollectionGroupsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.FirewallPolicyRuleCollectionGroupsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class FirewallPolicyRuleCollectionGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_firewall_policy_rule_collection_group_read(cls._schema_on_200) + + return cls._schema_on_200 + + class FirewallPolicyRuleCollectionGroupsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_firewall_policy_rule_collection_group_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("name", AAZStrType, ".name") + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("priority", AAZIntType, ".priority") + properties.set_prop("ruleCollections", AAZListType, ".rule_collections") + + rule_collections = _builder.get(".properties.ruleCollections") + if rule_collections is not None: + rule_collections.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.ruleCollections[]") + if _elements is not None: + _elements.set_prop("name", AAZStrType, ".collection_name") + _elements.set_prop("priority", AAZIntType, ".priority") + _elements.set_const("ruleCollectionType", "FirewallPolicyFilterRuleCollection", AAZStrType, ".firewall_policy_filter_rule_collection", typ_kwargs={"flags": {"required": True}}) + _elements.set_const("ruleCollectionType", "FirewallPolicyNatRuleCollection", AAZStrType, ".firewall_policy_nat_rule_collection", typ_kwargs={"flags": {"required": True}}) + _elements.discriminate_by("ruleCollectionType", "FirewallPolicyFilterRuleCollection") + _elements.discriminate_by("ruleCollectionType", "FirewallPolicyNatRuleCollection") + + disc_firewall_policy_filter_rule_collection = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}") + if disc_firewall_policy_filter_rule_collection is not None: + disc_firewall_policy_filter_rule_collection.set_prop("action", AAZObjectType, ".firewall_policy_filter_rule_collection.action") + disc_firewall_policy_filter_rule_collection.set_prop("rules", AAZListType, ".firewall_policy_filter_rule_collection.rules") + + action = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.action") + if action is not None: + action.set_prop("type", AAZStrType, ".type") + + rules = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules") + if rules is not None: + rules.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]") + if _elements is not None: + _elements.set_prop("description", AAZStrType, ".description") + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_const("ruleType", "ApplicationRule", AAZStrType, ".application_rule", typ_kwargs={"flags": {"required": True}}) + _elements.set_const("ruleType", "NatRule", AAZStrType, ".nat_rule", typ_kwargs={"flags": {"required": True}}) + _elements.set_const("ruleType", "NetworkRule", AAZStrType, ".network_rule", typ_kwargs={"flags": {"required": True}}) + _elements.discriminate_by("ruleType", "ApplicationRule") + _elements.discriminate_by("ruleType", "NatRule") + _elements.discriminate_by("ruleType", "NetworkRule") + + disc_application_rule = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}") + if disc_application_rule is not None: + disc_application_rule.set_prop("destinationAddresses", AAZListType, ".application_rule.destination_addresses") + disc_application_rule.set_prop("fqdnTags", AAZListType, ".application_rule.fqdn_tags") + disc_application_rule.set_prop("protocols", AAZListType, ".application_rule.protocols") + disc_application_rule.set_prop("sourceAddresses", AAZListType, ".application_rule.source_addresses") + disc_application_rule.set_prop("sourceIpGroups", AAZListType, ".application_rule.source_ip_groups") + disc_application_rule.set_prop("targetFqdns", AAZListType, ".application_rule.target_fqdns") + disc_application_rule.set_prop("targetUrls", AAZListType, ".application_rule.target_urls") + disc_application_rule.set_prop("terminateTLS", AAZBoolType, ".application_rule.terminate_tls") + disc_application_rule.set_prop("webCategories", AAZListType, ".application_rule.web_categories") + + destination_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + fqdn_tags = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.fqdnTags") + if fqdn_tags is not None: + fqdn_tags.set_elements(AAZStrType, ".") + + protocols = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.protocols") + if protocols is not None: + protocols.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.protocols[]") + if _elements is not None: + _elements.set_prop("port", AAZIntType, ".port") + _elements.set_prop("protocolType", AAZStrType, ".protocol_type") + + source_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + target_fqdns = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.targetFqdns") + if target_fqdns is not None: + target_fqdns.set_elements(AAZStrType, ".") + + target_urls = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.targetUrls") + if target_urls is not None: + target_urls.set_elements(AAZStrType, ".") + + web_categories = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:ApplicationRule}.webCategories") + if web_categories is not None: + web_categories.set_elements(AAZStrType, ".") + + disc_nat_rule = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NatRule}") + if disc_nat_rule is not None: + disc_nat_rule.set_prop("destinationAddresses", AAZListType, ".nat_rule.destination_addresses") + disc_nat_rule.set_prop("destinationPorts", AAZListType, ".nat_rule.destination_ports") + disc_nat_rule.set_prop("ipProtocols", AAZListType, ".nat_rule.ip_protocols") + disc_nat_rule.set_prop("sourceAddresses", AAZListType, ".nat_rule.source_addresses") + disc_nat_rule.set_prop("sourceIpGroups", AAZListType, ".nat_rule.source_ip_groups") + disc_nat_rule.set_prop("translatedAddress", AAZStrType, ".nat_rule.translated_address") + disc_nat_rule.set_prop("translatedFqdn", AAZStrType, ".nat_rule.translated_fqdn") + disc_nat_rule.set_prop("translatedPort", AAZStrType, ".nat_rule.translated_port") + + destination_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NatRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_ports = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NatRule}.destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + ip_protocols = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NatRule}.ipProtocols") + if ip_protocols is not None: + ip_protocols.set_elements(AAZStrType, ".") + + source_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NatRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NatRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + disc_network_rule = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}") + if disc_network_rule is not None: + disc_network_rule.set_prop("destinationAddresses", AAZListType, ".network_rule.destination_addresses") + disc_network_rule.set_prop("destinationFqdns", AAZListType, ".network_rule.destination_fqdns") + disc_network_rule.set_prop("destinationIpGroups", AAZListType, ".network_rule.destination_ip_groups") + disc_network_rule.set_prop("destinationPorts", AAZListType, ".network_rule.destination_ports") + disc_network_rule.set_prop("ipProtocols", AAZListType, ".network_rule.ip_protocols") + disc_network_rule.set_prop("sourceAddresses", AAZListType, ".network_rule.source_addresses") + disc_network_rule.set_prop("sourceIpGroups", AAZListType, ".network_rule.source_ip_groups") + + destination_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_fqdns = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.destinationFqdns") + if destination_fqdns is not None: + destination_fqdns.set_elements(AAZStrType, ".") + + destination_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.destinationIpGroups") + if destination_ip_groups is not None: + destination_ip_groups.set_elements(AAZStrType, ".") + + destination_ports = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + ip_protocols = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.ipProtocols") + if ip_protocols is not None: + ip_protocols.set_elements(AAZStrType, ".") + + source_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyFilterRuleCollection}.rules[]{ruleType:NetworkRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + disc_firewall_policy_nat_rule_collection = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}") + if disc_firewall_policy_nat_rule_collection is not None: + disc_firewall_policy_nat_rule_collection.set_prop("action", AAZObjectType, ".firewall_policy_nat_rule_collection.action") + disc_firewall_policy_nat_rule_collection.set_prop("rules", AAZListType, ".firewall_policy_nat_rule_collection.rules") + + action = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.action") + if action is not None: + action.set_prop("type", AAZStrType, ".type") + + rules = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules") + if rules is not None: + rules.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]") + if _elements is not None: + _elements.set_prop("description", AAZStrType, ".description") + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_const("ruleType", "ApplicationRule", AAZStrType, ".application_rule", typ_kwargs={"flags": {"required": True}}) + _elements.set_const("ruleType", "NatRule", AAZStrType, ".nat_rule", typ_kwargs={"flags": {"required": True}}) + _elements.set_const("ruleType", "NetworkRule", AAZStrType, ".network_rule", typ_kwargs={"flags": {"required": True}}) + _elements.discriminate_by("ruleType", "ApplicationRule") + _elements.discriminate_by("ruleType", "NatRule") + _elements.discriminate_by("ruleType", "NetworkRule") + + disc_application_rule = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}") + if disc_application_rule is not None: + disc_application_rule.set_prop("destinationAddresses", AAZListType, ".application_rule.destination_addresses") + disc_application_rule.set_prop("fqdnTags", AAZListType, ".application_rule.fqdn_tags") + disc_application_rule.set_prop("protocols", AAZListType, ".application_rule.protocols") + disc_application_rule.set_prop("sourceAddresses", AAZListType, ".application_rule.source_addresses") + disc_application_rule.set_prop("sourceIpGroups", AAZListType, ".application_rule.source_ip_groups") + disc_application_rule.set_prop("targetFqdns", AAZListType, ".application_rule.target_fqdns") + disc_application_rule.set_prop("targetUrls", AAZListType, ".application_rule.target_urls") + disc_application_rule.set_prop("terminateTLS", AAZBoolType, ".application_rule.terminate_tls") + disc_application_rule.set_prop("webCategories", AAZListType, ".application_rule.web_categories") + + destination_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + fqdn_tags = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.fqdnTags") + if fqdn_tags is not None: + fqdn_tags.set_elements(AAZStrType, ".") + + protocols = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.protocols") + if protocols is not None: + protocols.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.protocols[]") + if _elements is not None: + _elements.set_prop("port", AAZIntType, ".port") + _elements.set_prop("protocolType", AAZStrType, ".protocol_type") + + source_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + target_fqdns = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.targetFqdns") + if target_fqdns is not None: + target_fqdns.set_elements(AAZStrType, ".") + + target_urls = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.targetUrls") + if target_urls is not None: + target_urls.set_elements(AAZStrType, ".") + + web_categories = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:ApplicationRule}.webCategories") + if web_categories is not None: + web_categories.set_elements(AAZStrType, ".") + + disc_nat_rule = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NatRule}") + if disc_nat_rule is not None: + disc_nat_rule.set_prop("destinationAddresses", AAZListType, ".nat_rule.destination_addresses") + disc_nat_rule.set_prop("destinationPorts", AAZListType, ".nat_rule.destination_ports") + disc_nat_rule.set_prop("ipProtocols", AAZListType, ".nat_rule.ip_protocols") + disc_nat_rule.set_prop("sourceAddresses", AAZListType, ".nat_rule.source_addresses") + disc_nat_rule.set_prop("sourceIpGroups", AAZListType, ".nat_rule.source_ip_groups") + disc_nat_rule.set_prop("translatedAddress", AAZStrType, ".nat_rule.translated_address") + disc_nat_rule.set_prop("translatedFqdn", AAZStrType, ".nat_rule.translated_fqdn") + disc_nat_rule.set_prop("translatedPort", AAZStrType, ".nat_rule.translated_port") + + destination_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NatRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_ports = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NatRule}.destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + ip_protocols = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NatRule}.ipProtocols") + if ip_protocols is not None: + ip_protocols.set_elements(AAZStrType, ".") + + source_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NatRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NatRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + disc_network_rule = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}") + if disc_network_rule is not None: + disc_network_rule.set_prop("destinationAddresses", AAZListType, ".network_rule.destination_addresses") + disc_network_rule.set_prop("destinationFqdns", AAZListType, ".network_rule.destination_fqdns") + disc_network_rule.set_prop("destinationIpGroups", AAZListType, ".network_rule.destination_ip_groups") + disc_network_rule.set_prop("destinationPorts", AAZListType, ".network_rule.destination_ports") + disc_network_rule.set_prop("ipProtocols", AAZListType, ".network_rule.ip_protocols") + disc_network_rule.set_prop("sourceAddresses", AAZListType, ".network_rule.source_addresses") + disc_network_rule.set_prop("sourceIpGroups", AAZListType, ".network_rule.source_ip_groups") + + destination_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.destinationAddresses") + if destination_addresses is not None: + destination_addresses.set_elements(AAZStrType, ".") + + destination_fqdns = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.destinationFqdns") + if destination_fqdns is not None: + destination_fqdns.set_elements(AAZStrType, ".") + + destination_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.destinationIpGroups") + if destination_ip_groups is not None: + destination_ip_groups.set_elements(AAZStrType, ".") + + destination_ports = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.destinationPorts") + if destination_ports is not None: + destination_ports.set_elements(AAZStrType, ".") + + ip_protocols = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.ipProtocols") + if ip_protocols is not None: + ip_protocols.set_elements(AAZStrType, ".") + + source_addresses = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.sourceAddresses") + if source_addresses is not None: + source_addresses.set_elements(AAZStrType, ".") + + source_ip_groups = _builder.get(".properties.ruleCollections[]{ruleCollectionType:FirewallPolicyNatRuleCollection}.rules[]{ruleType:NetworkRule}.sourceIpGroups") + if source_ip_groups is not None: + source_ip_groups.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_firewall_policy_rule_collection_group_read = None + + @classmethod + def _build_schema_firewall_policy_rule_collection_group_read(cls, _schema): + if cls._schema_firewall_policy_rule_collection_group_read is not None: + _schema.etag = cls._schema_firewall_policy_rule_collection_group_read.etag + _schema.id = cls._schema_firewall_policy_rule_collection_group_read.id + _schema.name = cls._schema_firewall_policy_rule_collection_group_read.name + _schema.properties = cls._schema_firewall_policy_rule_collection_group_read.properties + _schema.type = cls._schema_firewall_policy_rule_collection_group_read.type + return + + cls._schema_firewall_policy_rule_collection_group_read = _schema_firewall_policy_rule_collection_group_read = AAZObjectType() + + firewall_policy_rule_collection_group_read = _schema_firewall_policy_rule_collection_group_read + firewall_policy_rule_collection_group_read.etag = AAZStrType( + flags={"read_only": True}, + ) + firewall_policy_rule_collection_group_read.id = AAZStrType() + firewall_policy_rule_collection_group_read.name = AAZStrType() + firewall_policy_rule_collection_group_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + firewall_policy_rule_collection_group_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_firewall_policy_rule_collection_group_read.properties + properties.priority = AAZIntType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rule_collections = AAZListType( + serialized_name="ruleCollections", + ) + + rule_collections = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections + rule_collections.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element + _element.name = AAZStrType() + _element.priority = AAZIntType() + _element.rule_collection_type = AAZStrType( + serialized_name="ruleCollectionType", + flags={"required": True}, + ) + + disc_firewall_policy_filter_rule_collection = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection") + disc_firewall_policy_filter_rule_collection.action = AAZObjectType() + disc_firewall_policy_filter_rule_collection.rules = AAZListType() + + action = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").action + action.type = AAZStrType() + + rules = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").rules + rules.Element = AAZObjectType() + cls._build_schema_firewall_policy_rule_read(rules.Element) + + disc_firewall_policy_nat_rule_collection = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection") + disc_firewall_policy_nat_rule_collection.action = AAZObjectType() + disc_firewall_policy_nat_rule_collection.rules = AAZListType() + + action = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").action + action.type = AAZStrType() + + rules = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").rules + rules.Element = AAZObjectType() + cls._build_schema_firewall_policy_rule_read(rules.Element) + + _schema.etag = cls._schema_firewall_policy_rule_collection_group_read.etag + _schema.id = cls._schema_firewall_policy_rule_collection_group_read.id + _schema.name = cls._schema_firewall_policy_rule_collection_group_read.name + _schema.properties = cls._schema_firewall_policy_rule_collection_group_read.properties + _schema.type = cls._schema_firewall_policy_rule_collection_group_read.type + + _schema_firewall_policy_rule_read = None + + @classmethod + def _build_schema_firewall_policy_rule_read(cls, _schema): + if cls._schema_firewall_policy_rule_read is not None: + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + return + + cls._schema_firewall_policy_rule_read = _schema_firewall_policy_rule_read = AAZObjectType() + + firewall_policy_rule_read = _schema_firewall_policy_rule_read + firewall_policy_rule_read.description = AAZStrType() + firewall_policy_rule_read.name = AAZStrType() + firewall_policy_rule_read.rule_type = AAZStrType( + serialized_name="ruleType", + flags={"required": True}, + ) + + disc_application_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule") + disc_application_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_application_rule.fqdn_tags = AAZListType( + serialized_name="fqdnTags", + ) + disc_application_rule.protocols = AAZListType() + disc_application_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_application_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_application_rule.target_fqdns = AAZListType( + serialized_name="targetFqdns", + ) + disc_application_rule.target_urls = AAZListType( + serialized_name="targetUrls", + ) + disc_application_rule.terminate_tls = AAZBoolType( + serialized_name="terminateTLS", + ) + disc_application_rule.web_categories = AAZListType( + serialized_name="webCategories", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").destination_addresses + destination_addresses.Element = AAZStrType() + + fqdn_tags = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").fqdn_tags + fqdn_tags.Element = AAZStrType() + + protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols + protocols.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols.Element + _element.port = AAZIntType() + _element.protocol_type = AAZStrType( + serialized_name="protocolType", + ) + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + target_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_fqdns + target_fqdns.Element = AAZStrType() + + target_urls = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_urls + target_urls.Element = AAZStrType() + + web_categories = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").web_categories + web_categories.Element = AAZStrType() + + disc_nat_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule") + disc_nat_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_nat_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_nat_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_nat_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_nat_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_nat_rule.translated_address = AAZStrType( + serialized_name="translatedAddress", + ) + disc_nat_rule.translated_fqdn = AAZStrType( + serialized_name="translatedFqdn", + ) + disc_nat_rule.translated_port = AAZStrType( + serialized_name="translatedPort", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + disc_network_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule") + disc_network_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_network_rule.destination_fqdns = AAZListType( + serialized_name="destinationFqdns", + ) + disc_network_rule.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + disc_network_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_network_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_network_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_network_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_fqdns + destination_fqdns.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + + +__all__ = ["Update"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_wait.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_wait.py new file mode 100644 index 00000000000..b1b1be17857 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/_wait.py @@ -0,0 +1,438 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy rule-collection-group wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/rulecollectiongroups/{}/ruleCollectionGroupDrafts/default", "2023-09-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.policy_name = AAZStrArg( + options=["--policy-name"], + help="The name of the Firewall Policy.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + id_part="child_name_1", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPolicyRuleCollectionGroupsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class FirewallPolicyRuleCollectionGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-09-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.priority = AAZIntType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rule_collections = AAZListType( + serialized_name="ruleCollections", + ) + + rule_collections = cls._schema_on_200.properties.rule_collections + rule_collections.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.rule_collections.Element + _element.name = AAZStrType() + _element.priority = AAZIntType() + _element.rule_collection_type = AAZStrType( + serialized_name="ruleCollectionType", + flags={"required": True}, + ) + + disc_firewall_policy_filter_rule_collection = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection") + disc_firewall_policy_filter_rule_collection.action = AAZObjectType() + disc_firewall_policy_filter_rule_collection.rules = AAZListType() + + action = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").action + action.type = AAZStrType() + + rules = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").rules + rules.Element = AAZObjectType() + _WaitHelper._build_schema_firewall_policy_rule_read(rules.Element) + + disc_firewall_policy_nat_rule_collection = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection") + disc_firewall_policy_nat_rule_collection.action = AAZObjectType() + disc_firewall_policy_nat_rule_collection.rules = AAZListType() + + action = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").action + action.type = AAZStrType() + + rules = cls._schema_on_200.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").rules + rules.Element = AAZObjectType() + _WaitHelper._build_schema_firewall_policy_rule_read(rules.Element) + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + _schema_firewall_policy_rule_read = None + + @classmethod + def _build_schema_firewall_policy_rule_read(cls, _schema): + if cls._schema_firewall_policy_rule_read is not None: + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + return + + cls._schema_firewall_policy_rule_read = _schema_firewall_policy_rule_read = AAZObjectType() + + firewall_policy_rule_read = _schema_firewall_policy_rule_read + firewall_policy_rule_read.description = AAZStrType() + firewall_policy_rule_read.name = AAZStrType() + firewall_policy_rule_read.rule_type = AAZStrType( + serialized_name="ruleType", + flags={"required": True}, + ) + + disc_application_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule") + disc_application_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_application_rule.fqdn_tags = AAZListType( + serialized_name="fqdnTags", + ) + disc_application_rule.protocols = AAZListType() + disc_application_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_application_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_application_rule.target_fqdns = AAZListType( + serialized_name="targetFqdns", + ) + disc_application_rule.target_urls = AAZListType( + serialized_name="targetUrls", + ) + disc_application_rule.terminate_tls = AAZBoolType( + serialized_name="terminateTLS", + ) + disc_application_rule.web_categories = AAZListType( + serialized_name="webCategories", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").destination_addresses + destination_addresses.Element = AAZStrType() + + fqdn_tags = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").fqdn_tags + fqdn_tags.Element = AAZStrType() + + protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols + protocols.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols.Element + _element.port = AAZIntType() + _element.protocol_type = AAZStrType( + serialized_name="protocolType", + ) + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + target_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_fqdns + target_fqdns.Element = AAZStrType() + + target_urls = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_urls + target_urls.Element = AAZStrType() + + web_categories = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").web_categories + web_categories.Element = AAZStrType() + + disc_nat_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule") + disc_nat_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_nat_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_nat_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_nat_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_nat_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_nat_rule.translated_address = AAZStrType( + serialized_name="translatedAddress", + ) + disc_nat_rule.translated_fqdn = AAZStrType( + serialized_name="translatedFqdn", + ) + disc_nat_rule.translated_port = AAZStrType( + serialized_name="translatedPort", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + disc_network_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule") + disc_network_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_network_rule.destination_fqdns = AAZListType( + serialized_name="destinationFqdns", + ) + disc_network_rule.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + disc_network_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_network_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_network_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_network_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_fqdns + destination_fqdns.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + + +__all__ = ["Wait"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/__cmd_group.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/__cmd_group.py new file mode 100644 index 00000000000..090ca26e35d --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/__cmd_group.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "network firewall policy rule-collection-group draft collection", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage and configure Azure firewall policy rule collections in the rule collection group draft. + + Currently, Azure Firewall policy support two kinds of rule collections which are Filter collection and NAT collection. There are three kinds of rules which are application rule, network rule and nat rule. + NAT collection support having a list of nat rule. Filter collection support including a list of rules(network rule or application rule) in it. But all of rules should be the same type. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/__init__.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/__init__.py new file mode 100644 index 00000000000..d63ae5a6fc9 --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * diff --git a/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/_list.py b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/_list.py new file mode 100644 index 00000000000..d58cfba95da --- /dev/null +++ b/src/azure-firewall/azext_firewall/aaz/latest/network/firewall/policy/rule_collection_group/rule_collection_group_draft/collection/_list.py @@ -0,0 +1,471 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network firewall policy rule-collection-group draft collection list", + is_preview=True, +) +class List(AAZCommand): + """List all rule collections of an Azure firewall policy rule collection group draft. + """ + + _aaz_info = { + "version": "2022-01-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/firewallpolicies/{}/rulecollectiongroups/{}/rulecollectiongroupdrafts/default", "2023-09-01", "properties.ruleCollections"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.policy_name = AAZStrArg( + options=["--policy-name"], + help="The name of the Firewall Policy.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.rule_collection_group_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FirewallPolicyRuleCollectionGroupsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.ruleCollections + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.ruleCollections = value + return + + class FirewallPolicyRuleCollectionGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "firewallPolicyName", self.ctx.args.policy_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "ruleCollectionGroupName", self.ctx.args.rule_collection_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-01-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _ListHelper._build_schema_firewall_policy_rule_collection_group_read(cls._schema_on_200) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_firewall_policy_rule_collection_group_read = None + + @classmethod + def _build_schema_firewall_policy_rule_collection_group_read(cls, _schema): + if cls._schema_firewall_policy_rule_collection_group_read is not None: + _schema.etag = cls._schema_firewall_policy_rule_collection_group_read.etag + _schema.id = cls._schema_firewall_policy_rule_collection_group_read.id + _schema.name = cls._schema_firewall_policy_rule_collection_group_read.name + _schema.properties = cls._schema_firewall_policy_rule_collection_group_read.properties + _schema.type = cls._schema_firewall_policy_rule_collection_group_read.type + return + + cls._schema_firewall_policy_rule_collection_group_read = _schema_firewall_policy_rule_collection_group_read = AAZObjectType() + + firewall_policy_rule_collection_group_read = _schema_firewall_policy_rule_collection_group_read + firewall_policy_rule_collection_group_read.etag = AAZStrType( + flags={"read_only": True}, + ) + firewall_policy_rule_collection_group_read.id = AAZStrType() + firewall_policy_rule_collection_group_read.name = AAZStrType() + firewall_policy_rule_collection_group_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + firewall_policy_rule_collection_group_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_firewall_policy_rule_collection_group_read.properties + properties.priority = AAZIntType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rule_collections = AAZListType( + serialized_name="ruleCollections", + ) + + rule_collections = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections + rule_collections.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element + _element.name = AAZStrType() + _element.priority = AAZIntType() + _element.rule_collection_type = AAZStrType( + serialized_name="ruleCollectionType", + flags={"required": True}, + ) + + disc_firewall_policy_filter_rule_collection = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection") + disc_firewall_policy_filter_rule_collection.action = AAZObjectType() + disc_firewall_policy_filter_rule_collection.rules = AAZListType() + + action = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").action + action.type = AAZStrType() + + rules = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyFilterRuleCollection").rules + rules.Element = AAZObjectType() + cls._build_schema_firewall_policy_rule_read(rules.Element) + + disc_firewall_policy_nat_rule_collection = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection") + disc_firewall_policy_nat_rule_collection.action = AAZObjectType() + disc_firewall_policy_nat_rule_collection.rules = AAZListType() + + action = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").action + action.type = AAZStrType() + + rules = _schema_firewall_policy_rule_collection_group_read.properties.rule_collections.Element.discriminate_by("rule_collection_type", "FirewallPolicyNatRuleCollection").rules + rules.Element = AAZObjectType() + cls._build_schema_firewall_policy_rule_read(rules.Element) + + _schema.etag = cls._schema_firewall_policy_rule_collection_group_read.etag + _schema.id = cls._schema_firewall_policy_rule_collection_group_read.id + _schema.name = cls._schema_firewall_policy_rule_collection_group_read.name + _schema.properties = cls._schema_firewall_policy_rule_collection_group_read.properties + _schema.type = cls._schema_firewall_policy_rule_collection_group_read.type + + _schema_firewall_policy_rule_read = None + + @classmethod + def _build_schema_firewall_policy_rule_read(cls, _schema): + if cls._schema_firewall_policy_rule_read is not None: + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + return + + cls._schema_firewall_policy_rule_read = _schema_firewall_policy_rule_read = AAZObjectType() + + firewall_policy_rule_read = _schema_firewall_policy_rule_read + firewall_policy_rule_read.description = AAZStrType() + firewall_policy_rule_read.name = AAZStrType() + firewall_policy_rule_read.rule_type = AAZStrType( + serialized_name="ruleType", + flags={"required": True}, + ) + + disc_application_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule") + disc_application_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_application_rule.fqdn_tags = AAZListType( + serialized_name="fqdnTags", + ) + disc_application_rule.protocols = AAZListType() + disc_application_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_application_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_application_rule.target_fqdns = AAZListType( + serialized_name="targetFqdns", + ) + disc_application_rule.target_urls = AAZListType( + serialized_name="targetUrls", + ) + disc_application_rule.terminate_tls = AAZBoolType( + serialized_name="terminateTLS", + ) + disc_application_rule.web_categories = AAZListType( + serialized_name="webCategories", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").destination_addresses + destination_addresses.Element = AAZStrType() + + fqdn_tags = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").fqdn_tags + fqdn_tags.Element = AAZStrType() + + protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols + protocols.Element = AAZObjectType() + + _element = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").protocols.Element + _element.port = AAZIntType() + _element.protocol_type = AAZStrType( + serialized_name="protocolType", + ) + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + target_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_fqdns + target_fqdns.Element = AAZStrType() + + target_urls = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").target_urls + target_urls.Element = AAZStrType() + + web_categories = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "ApplicationRule").web_categories + web_categories.Element = AAZStrType() + + disc_nat_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule") + disc_nat_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_nat_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_nat_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_nat_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_nat_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + disc_nat_rule.translated_address = AAZStrType( + serialized_name="translatedAddress", + ) + disc_nat_rule.translated_fqdn = AAZStrType( + serialized_name="translatedFqdn", + ) + disc_nat_rule.translated_port = AAZStrType( + serialized_name="translatedPort", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NatRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + disc_network_rule = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule") + disc_network_rule.destination_addresses = AAZListType( + serialized_name="destinationAddresses", + ) + disc_network_rule.destination_fqdns = AAZListType( + serialized_name="destinationFqdns", + ) + disc_network_rule.destination_ip_groups = AAZListType( + serialized_name="destinationIpGroups", + ) + disc_network_rule.destination_ports = AAZListType( + serialized_name="destinationPorts", + ) + disc_network_rule.ip_protocols = AAZListType( + serialized_name="ipProtocols", + ) + disc_network_rule.source_addresses = AAZListType( + serialized_name="sourceAddresses", + ) + disc_network_rule.source_ip_groups = AAZListType( + serialized_name="sourceIpGroups", + ) + + destination_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_addresses + destination_addresses.Element = AAZStrType() + + destination_fqdns = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_fqdns + destination_fqdns.Element = AAZStrType() + + destination_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ip_groups + destination_ip_groups.Element = AAZStrType() + + destination_ports = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").destination_ports + destination_ports.Element = AAZStrType() + + ip_protocols = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").ip_protocols + ip_protocols.Element = AAZStrType() + + source_addresses = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_addresses + source_addresses.Element = AAZStrType() + + source_ip_groups = _schema_firewall_policy_rule_read.discriminate_by("rule_type", "NetworkRule").source_ip_groups + source_ip_groups.Element = AAZStrType() + + _schema.description = cls._schema_firewall_policy_rule_read.description + _schema.name = cls._schema_firewall_policy_rule_read.name + _schema.rule_type = cls._schema_firewall_policy_rule_read.rule_type + _schema.discriminate_by( + "rule_type", + "ApplicationRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "ApplicationRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NatRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NatRule", + ) + ) + _schema.discriminate_by( + "rule_type", + "NetworkRule", + cls._schema_firewall_policy_rule_read.discriminate_by( + "rule_type", + "NetworkRule", + ) + ) + + +__all__ = ["List"] diff --git a/src/azure-firewall/azext_firewall/commands.py b/src/azure-firewall/azext_firewall/commands.py index d12d76e9ef9..e2a48c18bb6 100644 --- a/src/azure-firewall/azext_firewall/commands.py +++ b/src/azure-firewall/azext_firewall/commands.py @@ -90,15 +90,16 @@ def load_command_table(self, _): # region AzureFirewallPolicies with self.command_group('network firewall policy'): - from .custom import AzureFirewallPoliciesCreate, AzureFirewallPoliciesUpdate + from .custom import AzureFirewallPoliciesCreate, AzureFirewallPoliciesUpdate, AzureFirewallPoliciesDeploy self.command_table['network firewall policy create'] = AzureFirewallPoliciesCreate(loader=self) self.command_table['network firewall policy update'] = AzureFirewallPoliciesUpdate(loader=self) + self.command_table['network firewall policy deploy'] = AzureFirewallPoliciesDeploy(loader=self) with self.command_group('network firewall policy intrusion-detection'): - from .custom import IntrusionDetectionAdd, IntrusionDetectionRemove, IntrusionDetectionList - self.command_table['network firewall policy intrusion-detection add'] = IntrusionDetectionAdd(loader=self) - self.command_table['network firewall policy intrusion-detection remove'] = IntrusionDetectionRemove(loader=self) - self.command_table['network firewall policy intrusion-detection list'] = IntrusionDetectionList(loader=self) + from .custom import AzureFirewallPolicyIntrusionDetectionAdd, AzureFirewallPolicyIntrusionDetectionRemove, AzureFirewallPolicyIntrusionDetectionList + self.command_table['network firewall policy intrusion-detection add'] = AzureFirewallPolicyIntrusionDetectionAdd(loader=self) + self.command_table['network firewall policy intrusion-detection remove'] = AzureFirewallPolicyIntrusionDetectionRemove(loader=self) + self.command_table['network firewall policy intrusion-detection list'] = AzureFirewallPolicyIntrusionDetectionList(loader=self) with self.command_group('network firewall policy rule-collection-group'): from .custom import RuleCollectionGroupCreate, RuleCollectionGroupUpdate @@ -106,15 +107,43 @@ def load_command_table(self, _): self.command_table['network firewall policy rule-collection-group update'] = RuleCollectionGroupUpdate(loader=self) with self.command_group('network firewall policy rule-collection-group collection'): - from .custom import NatCollectionAdd, FilterCollectionAdd, CollectionRemove - self.command_table['network firewall policy rule-collection-group collection add-nat-collection'] = NatCollectionAdd(loader=self) - self.command_table['network firewall policy rule-collection-group collection add-filter-collection'] = FilterCollectionAdd(loader=self) - self.command_table['network firewall policy rule-collection-group collection remove'] = CollectionRemove(loader=self) + from .custom import RuleCollectionGroupNatCollectionAdd, RuleCollectionGroupFilterCollectionAdd, RuleCollectionGroupCollectionRemove + self.command_table['network firewall policy rule-collection-group collection add-nat-collection'] = RuleCollectionGroupNatCollectionAdd(loader=self) + self.command_table['network firewall policy rule-collection-group collection add-filter-collection'] = RuleCollectionGroupFilterCollectionAdd(loader=self) + self.command_table['network firewall policy rule-collection-group collection remove'] = RuleCollectionGroupCollectionRemove(loader=self) with self.command_group('network firewall policy rule-collection-group collection rule'): - from .custom import FilterRuleAdd, FilterRuleUpdate, FilterRuleRemove - self.command_table['network firewall policy rule-collection-group collection rule add'] = FilterRuleAdd(loader=self) - self.command_table['network firewall policy rule-collection-group collection rule update'] = FilterRuleUpdate(loader=self) - self.command_table['network firewall policy rule-collection-group collection rule remove'] = FilterRuleRemove(loader=self) + from .custom import RuleCollectionGroupFilterRuleAdd, RuleCollectionGroupFilterRuleUpdate, RuleCollectionGroupFilterRuleRemove + self.command_table['network firewall policy rule-collection-group collection rule add'] = RuleCollectionGroupFilterRuleAdd(loader=self) + self.command_table['network firewall policy rule-collection-group collection rule update'] = RuleCollectionGroupFilterRuleUpdate(loader=self) + self.command_table['network firewall policy rule-collection-group collection rule remove'] = RuleCollectionGroupFilterRuleRemove(loader=self) + + with self.command_group('network firewall policy draft'): + from .custom import AzureFirewallPolicyDraftsCreate, AzureFirewallPolicyDraftsUpdate + self.command_table['network firewall policy draft create'] = AzureFirewallPolicyDraftsCreate(loader=self) + self.command_table['network firewall policy draft update'] = AzureFirewallPolicyDraftsUpdate(loader=self) + + with self.command_group('network firewall policy draft intrusion-detection'): + from .custom import AzureFirewallPolicyDraftIntrusionDetectionAdd, AzureFirewallPolicyDraftIntrusionDetectionRemove, AzureFirewallPolicyDraftIntrusionDetectionList + self.command_table['network firewall policy draft intrusion-detection add'] = AzureFirewallPolicyDraftIntrusionDetectionAdd(loader=self) + self.command_table['network firewall policy draft intrusion-detection remove'] = AzureFirewallPolicyDraftIntrusionDetectionRemove(loader=self) + self.command_table['network firewall policy draft intrusion-detection list'] = AzureFirewallPolicyDraftIntrusionDetectionList(loader=self) + + with self.command_group('network firewall policy rule-collection-group draft'): + from .custom import RuleCollectionGroupDraftCreate, RuleCollectionGroupDraftUpdate + self.command_table['network firewall policy rule-collection-group draft create'] = RuleCollectionGroupDraftCreate(loader=self) + self.command_table['network firewall policy rule-collection-group draft update'] = RuleCollectionGroupDraftUpdate(loader=self) + + with self.command_group('network firewall policy rule-collection-group draft collection'): + from .custom import RuleCollectionGroupDraftNatCollectionAdd, RuleCollectionGroupDraftFilterCollectionAdd, RuleCollectionGroupDraftCollectionRemove + self.command_table['network firewall policy rule-collection-group draft collection add-nat-collection'] = RuleCollectionGroupDraftNatCollectionAdd(loader=self) + self.command_table['network firewall policy rule-collection-group draft collection add-filter-collection'] = RuleCollectionGroupDraftFilterCollectionAdd(loader=self) + self.command_table['network firewall policy rule-collection-group draft collection remove'] = RuleCollectionGroupDraftCollectionRemove(loader=self) + + with self.command_group('network firewall policy rule-collection-group draft collection rule'): + from .custom import RuleCollectionGroupDraftFilterRuleAdd, RuleCollectionGroupDraftFilterRuleUpdate, RuleCollectionGroupDraftFilterRuleRemove + self.command_table['network firewall policy rule-collection-group draft collection rule add'] = RuleCollectionGroupDraftFilterRuleAdd(loader=self) + self.command_table['network firewall policy rule-collection-group draft collection rule update'] = RuleCollectionGroupDraftFilterRuleUpdate(loader=self) + self.command_table['network firewall policy rule-collection-group draft collection rule remove'] = RuleCollectionGroupDraftFilterRuleRemove(loader=self) # endregion diff --git a/src/azure-firewall/azext_firewall/custom.py b/src/azure-firewall/azext_firewall/custom.py index 11351c735bf..3e965907de7 100644 --- a/src/azure-firewall/azext_firewall/custom.py +++ b/src/azure-firewall/azext_firewall/custom.py @@ -18,10 +18,15 @@ from .aaz.latest.network.firewall import Create as _AzureFirewallCreate, Update as _AzureFirewallUpdate, \ Show as _AzureFirewallShow from .aaz.latest.network.firewall.policy import Create as _AzureFirewallPoliciesCreate, \ - Update as _AzureFirewallPoliciesUpdate + Update as _AzureFirewallPoliciesUpdate, Deploy as _AzureFirewallPoliciesDeploy from .aaz.latest.network.firewall.policy.rule_collection_group import Create as _RuleCollectionGroupCreate, \ Update as _RuleCollectionGroupUpdate -from .aaz.latest.network.firewall.policy.intrusion_detection import Show as _IntrusionDetectionShow +from .aaz.latest.network.firewall.policy.intrusion_detection import PolicyShow as _PolicyIntrusionDetectionShow, \ + DraftShow as _PolicyDraftIntrusionDetectionShow +from .aaz.latest.network.firewall.policy.policy_draft import Create as _AzureFirewallPolicyDraftsCreate, \ + Update as _AzureFirewallPolicyDraftsUpdate +from .aaz.latest.network.firewall.policy.rule_collection_group.rule_collection_group_draft import Create as _RuleCollectionGroupDraftCreate, \ + Update as _RuleCollectionGroupDraftUpdate logger = get_logger(__name__) @@ -675,7 +680,6 @@ def create_af_application_rule(cmd, resource_group_name, azure_firewall_name, co @register_command( "network firewall threat-intel-allowlist create", - is_preview=True, ) class ThreatIntelAllowListCreate(_AzureFirewallUpdate): """Create an Azure Firewall Threat Intelligence Allow List. @@ -731,7 +735,6 @@ def _output(self, *args, **kwargs): @register_command( "network firewall threat-intel-allowlist update", - is_preview=True, ) class ThreatIntelAllowListUpdate(_AzureFirewallUpdate): """Update Azure Firewall Threat Intelligence Allow List. @@ -789,7 +792,6 @@ def _output(self, *args, **kwargs): @register_command( "network firewall threat-intel-allowlist show", - is_preview=True, ) class ThreatIntelAllowListShow(_AzureFirewallShow): """ @@ -809,7 +811,6 @@ def _output(self, *args, **kwargs): @register_command( "network firewall threat-intel-allowlist delete", - is_preview=True, ) class ThreatIntelAllowListDelete(_AzureFirewallUpdate): """ @@ -908,7 +909,7 @@ def pre_operations(self): args.user_assigned_identities = None -class IntrusionDetectionAdd(_AzureFirewallPoliciesUpdate): +class AzureFirewallPolicyIntrusionDetectionAdd(_AzureFirewallPoliciesUpdate): """ Add overrided intrusion signature or a bypass rule or private ranges list for intrusion detection """ @@ -1019,9 +1020,8 @@ def _output(self, *args, **kwargs): @register_command( "network firewall policy intrusion-detection list", - is_preview=True, ) -class IntrusionDetectionList(_IntrusionDetectionShow): +class AzureFirewallPolicyIntrusionDetectionList(_PolicyIntrusionDetectionShow): """ List all intrusion detection configuration """ @@ -1039,7 +1039,7 @@ def _output(self, *args, **kwargs): self.ctx.vars.instance.properties.intrusion_detection.configuration, client_flatten=True) -class IntrusionDetectionRemove(_AzureFirewallPoliciesUpdate): +class AzureFirewallPolicyIntrusionDetectionRemove(_AzureFirewallPoliciesUpdate): """ Remove overrided intrusion signature or a bypass rule """ @@ -1086,6 +1086,215 @@ def _output(self, *args, **kwargs): self.ctx.vars.instance.properties.intrusion_detection.configuration, client_flatten=True) +class AzureFirewallPolicyDraftsCreate(_AzureFirewallPolicyDraftsCreate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZResourceIdArgFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.base_policy._fmt = AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" + "/firewallPolicies/{}", + ) + return args_schema + + def pre_operations(self): + args = self.ctx.args + if has_value(args.dns_servers): + if not has_value(args.enable_dns_proxy): + args.enable_dns_proxy = False + + +class AzureFirewallPolicyDraftsUpdate(_AzureFirewallPolicyDraftsUpdate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.configuration._registered = False + return args_schema + + +class AzureFirewallPoliciesDeploy(_AzureFirewallPoliciesDeploy): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + return args_schema + + +class AzureFirewallPolicyDraftIntrusionDetectionAdd(_AzureFirewallPolicyDraftsUpdate): + """ + Add overrided intrusion signature or a bypass rule or private ranges list for intrusion detection + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZListArg, AAZArgEnum, AAZResourceIdArg, AAZResourceIdArgFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._options = ['--policy-name'] + args_schema.signature_id = AAZStrArg( + options=['--signature-id'], + help="Signature id." + ) + args_schema.signature_mode = AAZStrArg( + options=['--mode'], + help="The signature state" + ) + args_schema.signature_mode.enum = AAZArgEnum({'Off': 'off', 'Alert': 'Alert', 'Deny': 'Deny'}) + args_schema.bypass_rule_name = AAZStrArg( + options=['--rule-name'], + help="Name of the bypass traffic rule" + ) + args_schema.bypass_rule_description = AAZStrArg( + options=['--rule-description'], + help="Description of the bypass traffic rule" + ) + args_schema.bypass_rule_protocol = AAZStrArg( + options=['--rule-protocol'], + help="The rule bypass protocol" + ) + args_schema.bypass_rule_protocol.enum = AAZArgEnum({'TCP': 'TCP', 'UDP': 'UDP', 'ICMP': 'ICMP', 'Any': 'Any'}) + args_schema.bypass_rule_source_addresses = AAZListArg( + options=['--rule-src-addresses'], + help="Space-separated list of source IP addresses or ranges for this rule" + ) + args_schema.bypass_rule_source_addresses.Element = AAZStrArg() + args_schema.bypass_rule_destination_addresses = AAZListArg( + options=['--rule-dest-addresses'], + help="Space-separated list of destination IP addresses or ranges for this rule" + ) + args_schema.bypass_rule_destination_addresses.Element = AAZStrArg() + args_schema.bypass_rule_destination_ports = AAZListArg( + options=['--rule-dest-ports'], + help="Space-separated list of destination ports or ranges" + ) + args_schema.bypass_rule_destination_ports.Element = AAZStrArg() + args_schema.bypass_rule_source_ip_groups = AAZListArg( + options=['--rule-src-ip-groups'], + help="Space-separated list of source IpGroups" + ) + args_schema.bypass_rule_source_ip_groups.Element = AAZStrArg() + args_schema.bypass_rule_destination_ip_groups = AAZListArg( + options=['--rule-dest-ip-groups'], + help="Space-separated list of destination IpGroups for this rule" + ) + args_schema.bypass_rule_destination_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + + return args_schema + + def pre_instance_update(self, instance): + from azure.cli.core.azclierror import RequiredArgumentMissingError, InvalidArgumentValueError + args = self.ctx.args + if not has_value(instance.properties.intrusion_detection): + raise RequiredArgumentMissingError( + 'Intrusion detection mode is not set. Setting it by update command first') + + if has_value(args.signature_id) and has_value(args.signature_mode): + signature_override = { + 'id': args.signature_id, + 'mode': args.signature_mode + } + if has_value(instance.properties.intrusion_detection.configuration): + for overrided_signature in instance.properties.intrusion_detection.configuration.signature_overrides: + if overrided_signature.id == args.signature_id: + raise InvalidArgumentValueError( + f'Signature ID {args.signature_id} exists. Delete it first or try update instead') + instance.properties.intrusion_detection.configuration.signature_overrides.append(signature_override) + else: + instance.properties.intrusion_detection.configuration = { + 'signatureOverrides': [signature_override] + } + + if has_value(args.bypass_rule_name): + bypass_traffic = { + 'name': args.bypass_rule_name, + 'description': args.bypass_rule_description, + 'protocol': args.bypass_rule_protocol, + 'sourceAddresses': args.bypass_rule_source_addresses, + 'destinationAddresses': args.bypass_rule_destination_addresses, + 'destinationPorts': args.bypass_rule_destination_ports, + 'sourceIpGroups': args.bypass_rule_source_ip_groups, + 'destinationIpGroups': args.bypass_rule_destination_ip_groups, + } + instance.properties.intrusion_detection.configuration.bypass_traffic_settings.append(bypass_traffic) + + if has_value(args.private_ranges): + instance.properties.intrusion_detection.configuration.private_ranges = args.private_ranges + + def _output(self, *args, **kwargs): + return self.deserialize_output( + self.ctx.vars.instance.properties.intrusion_detection.configuration, client_flatten=True) + + +@register_command( + "network firewall policy draft intrusion-detection list", + is_preview=True, +) +class AzureFirewallPolicyDraftIntrusionDetectionList(_PolicyDraftIntrusionDetectionShow): + """ + List all intrusion detection configuration + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._options = ['--policy-name'] + return args_schema + + def _output(self, *args, **kwargs): + if not has_value(self.ctx.vars.instance.properties.intrusion_detection.configuration): + return [] + return self.deserialize_output( + self.ctx.vars.instance.properties.intrusion_detection.configuration, client_flatten=True) + + +class AzureFirewallPolicyDraftIntrusionDetectionRemove(_AzureFirewallPolicyDraftsUpdate): + """ + Remove overrided intrusion signature or a bypass rule + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._options = ['--policy-name'] + args_schema.signature_id = AAZStrArg( + options=['--signature-id'], + help="Signature id." + ) + args_schema.bypass_rule_name = AAZStrArg( + options=['--rule-name'], + help="Name of the bypass traffic rule" + ) + return args_schema + + def pre_instance_update(self, instance): + from azure.cli.core.azclierror import RequiredArgumentMissingError, InvalidArgumentValueError + args = self.ctx.args + if not has_value(instance.properties.intrusion_detection): + raise RequiredArgumentMissingError( + 'Intrusion detection mode is not set. Setting it by update command first') + + if has_value(args.signature_id): + signatures = instance.properties.intrusion_detection.configuration.signature_overrides + new_signatures = [s for s in signatures if s.id != args.signature_id] + if len(signatures) == len(new_signatures): + raise InvalidArgumentValueError(f"Signature ID {args.signature_id} doesn't exist") + instance.properties.intrusion_detection.configuration.signature_overrides = new_signatures + + if has_value(args.bypass_rule_name): + bypass_settings = instance.properties.intrusion_detection.configuration.bypass_traffic_settings + new_bypass_settings = [s for s in bypass_settings if s.name != args.bypass_rule_name] + if len(bypass_settings) == len(new_bypass_settings): + raise InvalidArgumentValueError(f"Bypass rule with name {args.bypass_rule_name} doesn't exist") + instance.properties.intrusion_detection.configuration.bypass_traffic_settings = new_bypass_settings + + def _output(self, *args, **kwargs): + return self.deserialize_output( + self.ctx.vars.instance.properties.intrusion_detection.configuration, client_flatten=True) + + class RuleCollectionGroupCreate(_RuleCollectionGroupCreate): @classmethod def _build_arguments_schema(cls, *args, **kwargs): @@ -1116,11 +1325,40 @@ def pre_instance_update(self, instance): instance.properties.priority = args.priority +class RuleCollectionGroupDraftCreate(_RuleCollectionGroupDraftCreate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.priority._required = True + args_schema.rule_collections._registered = False + return args_schema + + +class RuleCollectionGroupDraftUpdate(_RuleCollectionGroupDraftUpdate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZDictArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.tags = AAZDictArg( + options=["--tags"], + help="Space-separated tags: key[=value] [key[=value] ...].", + ) + args_schema.tags.Element = AAZStrArg() + args_schema.rule_collections._registered = False + return args_schema + + def pre_instance_update(self, instance): + args = self.ctx.args + if has_value(args.tags): + instance.tags = args.tags + if has_value(args.priority): + instance.properties.priority = args.priority + + @register_command( "network firewall policy rule-collection-group collection add-nat-collection", - is_preview=True, ) -class NatCollectionAdd(_RuleCollectionGroupUpdate): +class RuleCollectionGroupNatCollectionAdd(_RuleCollectionGroupUpdate): """ Add a NAT collection into an Azure firewall policy rule collection group. @@ -1272,9 +1510,8 @@ def _output(self, *args, **kwargs): @register_command( "network firewall policy rule-collection-group collection add-filter-collection", - is_preview=True, ) -class FilterCollectionAdd(_RuleCollectionGroupUpdate): +class RuleCollectionGroupFilterCollectionAdd(_RuleCollectionGroupUpdate): """ Add a filter collection into an Azure firewall policy rule collection group. @@ -1400,7 +1637,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=['--enable-tls-inspection', '--enable-tls-insp'], help="Enable flag to terminate TLS connection for this rule", default=False, - is_preview=True, arg_group="Application Rule" ) args_schema.fqdn_tags = AAZListArg( @@ -1424,7 +1660,6 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.target_urls = AAZListArg( options=["--target-urls"], help="Space-separated list of target urls for this rule.", - is_preview=True, arg_group="Application Rule" ) args_schema.target_urls.Element = AAZStrArg() @@ -1501,9 +1736,8 @@ def _output(self, *args, **kwargs): @register_command( "network firewall policy rule-collection-group collection remove", - is_preview=True, ) -class CollectionRemove(_RuleCollectionGroupUpdate): +class RuleCollectionGroupCollectionRemove(_RuleCollectionGroupUpdate): """ Remove a rule collection from an Azure firewall policy rule collection group. """ @@ -1555,9 +1789,8 @@ def _output(self, *args, **kwargs): @register_command( "network firewall policy rule-collection-group collection rule add", - is_preview=True, ) -class FilterRuleAdd(_RuleCollectionGroupUpdate): +class RuleCollectionGroupFilterRuleAdd(_RuleCollectionGroupUpdate): """ Add a rule into an Azure firewall policy rule collection. """ @@ -1589,7 +1822,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=['--enable-tls-inspection', '--enable-tls-insp'], help="Enable flag to terminate TLS connection for this rule", default=False, - is_preview=True, arg_group="Application Rule" ) args_schema.fqdn_tags = AAZListArg( @@ -1613,7 +1845,6 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.target_urls = AAZListArg( options=["--target-urls"], help="Space-separated list of target urls for this rule.", - is_preview=True, arg_group="Application Rule" ) args_schema.target_urls.Element = AAZStrArg() @@ -1786,9 +2017,8 @@ def pre_instance_update(self, instance): @register_command( "network firewall policy rule-collection-group collection rule remove", - is_preview=True, ) -class FilterRuleRemove(_RuleCollectionGroupUpdate): +class RuleCollectionGroupFilterRuleRemove(_RuleCollectionGroupUpdate): """ Remove a rule from an Azure firewall policy rule collection. Filter collection supports having a list of network rules or application rules. @@ -1853,9 +2083,8 @@ def pre_instance_update(self, instance): @register_command( "network firewall policy rule-collection-group collection rule update", - is_preview=True, ) -class FilterRuleUpdate(_RuleCollectionGroupUpdate): +class RuleCollectionGroupFilterRuleUpdate(_RuleCollectionGroupUpdate): """ Update a rule of an Azure firewall policy rule collection. Filter collection supports having a list of network rules or application rules. @@ -1895,7 +2124,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=['--enable-tls-inspection', '--enable-tls-insp'], help="Enable flag to terminate TLS connection for this rule", default=False, - is_preview=True, arg_group="Application Rule" ) args_schema.fqdn_tags = AAZListArg( @@ -1919,7 +2147,965 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.target_urls = AAZListArg( options=["--target-urls"], help="Space-separated list of target urls for this rule.", - is_preview=True, + arg_group="Application Rule" + ) + args_schema.target_urls.Element = AAZStrArg() + args_schema.web_categories = AAZListArg( + options=["--web-categories"], + help="Space-separated list of web categories for this rule.", + arg_group="Application Rule" + ) + args_schema.web_categories.Element = AAZStrArg() + args_schema.ip_protocols = AAZListArg( + options=["--ip-protocols"], + help="Space-separated list of IP protocols. This argument is supported for Nat and Network Rule. ", + arg_group="Common Rule", + ) + args_schema.ip_protocols.Element = AAZStrArg() + args_schema.ip_protocols.enum = AAZArgEnum({'TCP': 'TCP', 'UDP': 'UDP', 'Any': 'Any', 'ICMP': 'ICMP'}) + args_schema.description = AAZStrArg( + options=["--description"], + help="The description of rule.", + arg_group="Common Rule" + ) + args_schema.destination_addresses = AAZListArg( + options=["--destination-addresses", "--dest-addr"], + help="Space-separated list of destination IP addresses.", + arg_group="Common Rule" + ) + args_schema.destination_addresses.Element = AAZStrArg() + args_schema.destination_ports = AAZListArg( + options=["--destination-ports"], + help="Space-separated list of destination ports. This argument is supported for Nat and Network Rule.", + arg_group="Common Rule" + ) + args_schema.destination_ports.Element = AAZStrArg() + args_schema.source_addresses = AAZListArg( + options=["--source-addresses"], + help="Space-separated list of source IP ddresses.", + arg_group="Common Rule" + ) + args_schema.source_addresses.Element = AAZStrArg() + args_schema.source_ip_groups = AAZListArg( + options=["--source-ip-groups"], + help="Space-separated list of name or resource id of source IpGroups.", + arg_group="Common Rule" + ) + args_schema.source_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.translated_address = AAZStrArg( + options=["--translated-address"], + help="Translated address for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.translated_fqdn = AAZStrArg( + options=["--translated-fqdn"], + help="Translated FQDN for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.translated_port = AAZStrArg( + options=["--translated-port"], + help="Translated port for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.destination_ip_groups = AAZListArg( + options=['--destination-ip-groups', '--dest-ipg'], + help="Space-separated list of name or resource id of destination IpGroups.", + arg_group="Network Rule" + ) + args_schema.destination_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.destination_fqdns = AAZListArg( + options=["--destination-fqdns"], + help="Space-separated list of destination FQDNs.", + arg_group="Network Rule" + ) + args_schema.destination_fqdns.Element = AAZStrArg() + args_schema.rule_name = AAZStrArg( + help="The name of rule.", + ) + args_schema.rule_name._registered = False + args_schema.priority._registered = False + args_schema.rule_collections._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.rule_name = args.name + args.name = args.rcg_name + + def pre_instance_update(self, instance): + args = self.ctx.args + target_rule_collection = None + for rule_collection in instance.properties.rule_collections: + if rule_collection.name == args.collection_name: + target_rule_collection = rule_collection + + if target_rule_collection is None: + raise UserFault("Cannot find corresponding rule, please check parameters") + + new_rule = None + for i, rule in enumerate(target_rule_collection.rules): + if args.rule_name == rule.name: + if rule.rule_type == "NetworkRule": + new_rule = { + 'name': args.rule_name, + 'description': args.description if has_value(args.description) else rule.description, + 'rule_type': 'NetworkRule', + 'ip_protocols': args.ip_protocols if has_value(args.ip_protocols) else rule.ip_protocols, + 'source_addresses': args.source_addresses if has_value(args.source_addresses) else rule.source_addresses, + 'destination_addresses': args.destination_addresses if has_value(args.destination_addresses) else rule.destination_addresses, + 'destination_ports': args.destination_ports if has_value(args.destination_ports) else rule.destination_ports, + 'source_ip_groups': args.source_ip_groups if has_value(args.source_ip_groups) else rule.source_ip_groups, + 'destination_ip_groups': args.destination_ip_groups if has_value(args.destination_ip_groups) else rule.destination_ip_groups, + 'destination_fqdns': args.destination_fqdns if has_value(args.destination_fqdns) else rule.destination_fqdns + } + elif rule.rule_type == 'ApplicationRule': + protocols = rule.protocols + if has_value(args.protocols): + protocols = list( + map(lambda x: {'protocol_type': x[0], 'port': int(x[1])}, + args.protocols.to_serialized_data().items())) + new_rule = { + 'name': args.rule_name, + 'description': args.description if has_value(args.description) else rule.description, + 'rule_type': 'ApplicationRule', + 'source_addresses': args.source_addresses if has_value(args.source_addresses) else rule.source_addresses, + 'protocols': protocols, + 'destination_addresses': args.destination_addresses if has_value(args.destination_addresses) else rule.destination_addresses, + 'fqdn_tags': args.fqdn_tags if has_value(args.fqdn_tags) else rule.fqdn_tags, + 'target_fqdns': args.target_fqdns if has_value(args.target_fqdns) else rule.target_fqdns, + 'target_urls': args.target_urls if has_value(args.target_urls) else rule.target_urls, + 'source_ip_groups': args.source_ip_groups if has_value(args.source_ip_groups) else rule.source_ip_groups, + 'terminate_tls': args.enable_tls_inspection if has_value(args.enable_tls_inspection) else rule.enable_tls_inspection, + 'web_categories': args.web_categories if has_value(args.web_categories) else rule.web_categories + } + elif rule.rule_type == 'NatRule': + new_rule = { + 'name': args.rule_name, + 'description': args.description if has_value(args.description) else rule.description, + 'rule_type': 'NatRule', + 'ip_protocols': args.ip_protocols if has_value(args.ip_protocols) else rule.ip_protocols, + 'source_addresses': args.source_addresses if has_value(args.source_addresses) else rule.source_addresses, + 'destination_addresses': args.destination_addresses if has_value(args.destination_addresses) else rule.destination_addresses, + 'destination_ports': args.destination_ports if has_value(args.destination_ports) else rule.destination_ports, + 'translated_address': args.translated_address if has_value(args.translated_address) else rule.translated_address, + 'translated_fqdn': args.translated_fqdn if has_value(args.translated_fqdn) else rule.translated_fqdn, + 'translated_port': args.translated_port if has_value(args.translated_port) else rule.translated_port, + 'source_ip_groups': args.source_ip_groups if has_value(args.source_ip_groups) else rule.source_ip_groups + } + else: + raise ServiceError(f'Undefined rule_type : {rule.rule_type}') + if new_rule is not None: + target_rule_collection.rules[i] = new_rule + if new_rule is None: + raise UserFault(f'{args.rule_name} does not exist!!!') + + +@register_command( + "network firewall policy rule-collection-group draft collection add-nat-collection", + is_preview=True, +) +class RuleCollectionGroupDraftNatCollectionAdd(_RuleCollectionGroupDraftUpdate): + """ + Add a NAT collection into an Azure firewall policy rule collection group draft. + + :example: Add a NAT collection into the rule collection group draft + az network firewall policy rule-collection-group draft collection add-nat-collection -n + nat_collection --collection-priority 10003 --policy-name {policy} -g {rg} --rule-collection- + group-name {collectiongroup} --action DNAT --rule-name network_rule --description "test" + --destination-addresses "202.120.36.15" --source-addresses "202.120.36.13" "202.120.36.14" + --translated-address 128.1.1.1 --translated-port 1234 --destination-ports 12000 12001 --ip- + protocols TCP UDP + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZListArg, AAZArgEnum, AAZResourceIdArg, AAZResourceIdArgFormat, \ + AAZIntArg, AAZIntArgFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._required = True + args_schema.name._options = ['--name', '-n'] + args_schema.name.help = 'The name of the collection in Firewall Policy Rule Collection Group.' + args_schema.name._arg_group = "" + args_schema.name._id_part = None + args_schema.policy_name._id_part = None + args_schema.rcg_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.collection_priority = AAZIntArg( + options=["--collection-priority"], + arg_group="", + help="The priority of the rule in Firewall Policy Rule Collection Group.", + required=True, + fmt=AAZIntArgFormat( + maximum=65000, + minimum=100, + ), + ) + args_schema.nat_action = AAZStrArg( + options=["--action"], + help="The action type of a rule collection.", + ) + args_schema.nat_action.enum = AAZArgEnum({'DNAT': 'DNAT', 'SNAT': 'SNAT'}) + args_schema.ip_protocols = AAZListArg( + options=["--ip-protocols"], + help="Space-separated list of IP protocols. This argument is supported for Nat and Network Rule. ", + required=True, + arg_group="Common Rule", + ) + args_schema.ip_protocols.Element = AAZStrArg() + args_schema.ip_protocols.enum = AAZArgEnum({'TCP': 'TCP', 'UDP': 'UDP', 'Any': 'Any', 'ICMP': 'ICMP'}) + args_schema.description = AAZStrArg( + options=["--description"], + help="The description of rule.", + arg_group="Common Rule" + ) + args_schema.destination_addresses = AAZListArg( + options=["--destination-addresses", "--dest-addr"], + help="Space-separated list of destination IP addresses.", + arg_group="Common Rule" + ) + args_schema.destination_addresses.Element = AAZStrArg() + args_schema.destination_ports = AAZListArg( + options=["--destination-ports"], + help="Space-separated list of destination ports. This argument is supported for Nat and Network Rule.", + arg_group="Common Rule" + ) + args_schema.destination_ports.Element = AAZStrArg() + args_schema.rule_name = AAZStrArg( + options=["--rule-name"], + help="The name of rule.", + arg_group="Common Rule" + ) + args_schema.source_addresses = AAZListArg( + options=["--source-addresses"], + help="Space-separated list of source IP ddresses.", + arg_group="Common Rule" + ) + args_schema.source_addresses.Element = AAZStrArg() + args_schema.source_ip_groups = AAZListArg( + options=["--source-ip-groups"], + help="Space-separated list of name or resource id of source IpGroups.", + arg_group="Common Rule" + ) + args_schema.source_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.translated_address = AAZStrArg( + options=["--translated-address"], + help="Translated address for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.translated_fqdn = AAZStrArg( + options=["--translated-fqdn"], + help="Translated FQDN for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.translated_port = AAZStrArg( + options=["--translated-port"], + help="Translated port for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.rule_collection_name = AAZStrArg( + help="The name of the rule collection.", + ) + args_schema.rule_collection_name._registered = False + args_schema.priority._registered = False + args_schema.rule_collections._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.rule_collection_name = args.name + args.name = args.rcg_name + + def pre_instance_update(self, instance): + args = self.ctx.args + nat_rule = { + 'name': args.rule_name, + 'description': args.description, + 'rule_type': 'NatRule', + 'ip_protocols': args.ip_protocols, + 'source_addresses': args.source_addresses, + 'destination_addresses': args.destination_addresses, + 'destination_ports': args.destination_ports, + 'translated_address': args.translated_address, + 'translated_fqdn': args.translated_fqdn, + 'translated_port': args.translated_port, + 'source_ip_groups': args.source_ip_groups + } + rule_collection = { + 'name': args.rule_collection_name, + 'priority': args.collection_priority, + 'rule_collection_type': 'FirewallPolicyNatRuleCollection', + 'action': { + 'type': args.nat_action + }, + 'rules': [nat_rule] + } + instance.properties.rule_collections.append(rule_collection) + + def _output(self, *args, **kwargs): + return {'ruleCollections': self.deserialize_output(self.ctx.vars.instance.properties.rule_collections, + client_flatten=True)} + + +@register_command( + "network firewall policy rule-collection-group draft collection add-filter-collection", + is_preview=True, +) +class RuleCollectionGroupDraftFilterCollectionAdd(_RuleCollectionGroupDraftUpdate): + """ + Add a filter collection into an Azure firewall policy rule collection group draft. + + :example: Add a filter collection with Network rule into the rule collection group draft + az network firewall policy rule-collection-group draft collection add-filter-collection -g {rg} + --policy-name {policy} --rule-collection-group-name {collectiongroup} --name + filter_collection --action Allow --rule-name network_rule --rule-type NetworkRule + --description "test" --destination-addresses "202.120.36.15" --source-addresses + "202.120.36.13" "202.120.36.14" --destination-ports 12003 12004 --ip-protocols TCP UDP + --collection-priority 11002 + + :example: Add a filter collection with Application rule into the rule collection group draft + az network firewall policy rule-collection-group draft collection add-filter-collection -g {rg} + --policy-name {policy} --rule-collection-group-name {collectiongroup} --name + filter_collection --action Allow --rule-name application_rule --rule-type ApplicationRule + --description "test" --destination-addresses "202.120.36.15" "202.120.36.16" --source- + addresses "202.120.36.13" "202.120.36.14" --protocols Http=12800 Https=12801 --fqdn-tags + AzureBackup HDInsight --collection-priority 11100 + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZListArg, AAZArgEnum, AAZBoolArg, AAZDictArg, AAZResourceIdArg, \ + AAZResourceIdArgFormat, AAZIntArg, AAZIntArgFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._required = True + args_schema.name._options = ['--name', '-n'] + args_schema.name.help = 'The name of the collection in Firewall Policy Rule Collection Group.' + args_schema.name._arg_group = "" + args_schema.name._id_part = None + args_schema.policy_name._id_part = None + args_schema.rcg_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.collection_priority = AAZIntArg( + options=["--collection-priority"], + arg_group="", + help="The priority of the rule in Firewall Policy Rule Collection Group.", + required=True, + fmt=AAZIntArgFormat( + maximum=65000, + minimum=100, + ), + ) + args_schema.filter_action = AAZStrArg( + options=["--action"], + help="The action type of a rule collection.", + ) + args_schema.filter_action.enum = AAZArgEnum({'Allow': 'Allow', 'Deny': 'Deny'}) + args_schema.ip_protocols = AAZListArg( + options=["--ip-protocols"], + help="Space-separated list of IP protocols. This argument is supported for Nat and Network Rule. ", + arg_group="Common Rule", + ) + args_schema.ip_protocols.Element = AAZStrArg() + args_schema.ip_protocols.enum = AAZArgEnum({'TCP': 'TCP', 'UDP': 'UDP', 'Any': 'Any', 'ICMP': 'ICMP'}) + args_schema.description = AAZStrArg( + options=["--description"], + help="The description of rule.", + arg_group="Common Rule" + ) + args_schema.destination_addresses = AAZListArg( + options=["--destination-addresses", "--dest-addr"], + help="Space-separated list of destination IP addresses.", + arg_group="Common Rule" + ) + args_schema.destination_addresses.Element = AAZStrArg() + args_schema.destination_ports = AAZListArg( + options=["--destination-ports"], + help="Space-separated list of destination ports. This argument is supported for Nat and Network Rule.", + arg_group="Common Rule" + ) + args_schema.destination_ports.Element = AAZStrArg() + args_schema.rule_name = AAZStrArg( + options=["--rule-name"], + help="The name of rule.", + arg_group="Common Rule" + ) + args_schema.rule_type = AAZStrArg( + options=["--rule-type"], + help="The type of rule.", + arg_group="Common Rule" + ) + args_schema.rule_type.enum = AAZArgEnum({'ApplicationRule': 'ApplicationRule', + 'NetworkRule': 'NetworkRule', + 'NatRule': 'NatRule'}) + args_schema.source_addresses = AAZListArg( + options=["--source-addresses"], + help="Space-separated list of source IP ddresses.", + arg_group="Common Rule" + ) + args_schema.source_addresses.Element = AAZStrArg() + args_schema.source_ip_groups = AAZListArg( + options=["--source-ip-groups"], + help="Space-separated list of name or resource id of source IpGroups.", + arg_group="Common Rule" + ) + args_schema.source_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.destination_ip_groups = AAZListArg( + options=['--destination-ip-groups', '--dest-ipg'], + help="Space-separated list of name or resource id of destination IpGroups.", + arg_group="Network Rule" + ) + args_schema.destination_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.destination_fqdns = AAZListArg( + options=["--destination-fqdns"], + help="Space-separated list of destination FQDNs.", + arg_group="Network Rule" + ) + args_schema.destination_fqdns.Element = AAZStrArg() + args_schema.enable_tls_inspection = AAZBoolArg( + options=['--enable-tls-inspection', '--enable-tls-insp'], + help="Enable flag to terminate TLS connection for this rule", + default=False, + arg_group="Application Rule" + ) + args_schema.fqdn_tags = AAZListArg( + options=["--fqdn-tags"], + help="Space-separated list of FQDN tags for this rule.", + arg_group="Application Rule" + ) + args_schema.fqdn_tags.Element = AAZStrArg() + args_schema.protocols = AAZDictArg( + options=["--protocols"], + help="Space-separated list of protocols and port numbers to use, in PROTOCOL=PORT format.", + arg_group="Application Rule" + ) + args_schema.protocols.Element = AAZStrArg() + args_schema.target_fqdns = AAZListArg( + options=["--target-fqdns"], + help="Space-separated list of FQDNs for this rule.", + arg_group="Application Rule" + ) + args_schema.target_fqdns.Element = AAZStrArg() + args_schema.target_urls = AAZListArg( + options=["--target-urls"], + help="Space-separated list of target urls for this rule.", + arg_group="Application Rule" + ) + args_schema.target_urls.Element = AAZStrArg() + args_schema.web_categories = AAZListArg( + options=["--web-categories"], + help="Space-separated list of web categories for this rule.", + arg_group="Application Rule" + ) + args_schema.web_categories.Element = AAZStrArg() + args_schema.rule_collection_name = AAZStrArg( + help="The name of the rule collection.", + ) + args_schema.rule_collection_name._registered = False + args_schema.priority._registered = False + args_schema.rule_collections._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.rule_collection_name = args.name + args.name = args.rcg_name + + def pre_instance_update(self, instance): + args = self.ctx.args + if has_value(args.target_fqdns) and has_value(args.fqdn_tags): + raise ArgumentUsageError('usage error: --target-fqdns | --fqdn-tags') + + if args.rule_type == 'NetworkRule': + rule = { + 'name': args.rule_name, + 'description': args.description, + 'rule_type': 'NetworkRule', + 'ip_protocols': args.ip_protocols, + 'source_addresses': args.source_addresses, + 'destination_addresses': args.destination_addresses, + 'destination_ports': args.destination_ports, + 'source_ip_groups': args.source_ip_groups, + 'destination_ip_groups': args.destination_ip_groups, + 'destination_fqdns': args.destination_fqdns + } + else: + protocols = [] + if has_value(args.protocols): + protocols = list(map(lambda x: {'protocol_type': x[0], 'port': int(x[1])}, args.protocols.to_serialized_data().items())) + rule = { + 'name': args.rule_name, + 'description': args.description, + 'rule_type': 'ApplicationRule', + 'source_addresses': args.source_addresses, + 'protocols': protocols, + 'destination_addresses': args.destination_addresses, + 'fqdn_tags': args.fqdn_tags, + 'target_fqdns': args.target_fqdns, + 'target_urls': args.target_urls, + 'source_ip_groups': args.source_ip_groups, + 'terminate_tls': args.enable_tls_inspection, + 'web_categories': args.web_categories + } + rule_collection = { + 'name': args.rule_collection_name, + 'priority': args.collection_priority, + 'rule_collection_type': 'FirewallPolicyFilterRuleCollection', + 'action': { + 'type': args.filter_action + }, + 'rules': [rule] + } + instance.properties.rule_collections.append(rule_collection) + + def _output(self, *args, **kwargs): + return {'ruleCollections': self.deserialize_output(self.ctx.vars.instance.properties.rule_collections, + client_flatten=True)} + + +@register_command( + "network firewall policy rule-collection-group draft collection remove", + is_preview=True, +) +class RuleCollectionGroupDraftCollectionRemove(_RuleCollectionGroupDraftUpdate): + """ + Remove a rule collection from an Azure firewall policy rule collection group draft. + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._required = True + args_schema.name.help = 'The name of the collection in Firewall Policy Rule Collection Group.' + args_schema.name._arg_group = "" + args_schema.name._id_part = None + args_schema.policy_name._id_part = None + args_schema.rcg_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.rule_collection_name = AAZStrArg( + help="The name of the rule collection.", + ) + args_schema.rule_collection_name._registered = False + args_schema.priority._registered = False + args_schema.rule_collections._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.rule_collection_name = args.name + args.name = args.rcg_name + + def pre_instance_update(self, instance): + args = self.ctx.args + removed_rule_collection = None + for rule_collection in instance.properties.rule_collections: + if rule_collection.name == args.rule_collection_name: + removed_rule_collection = rule_collection + + if removed_rule_collection is not None: + new_rule_collections = copy.deepcopy(instance.properties.rule_collections.to_serialized_data()) + new_rule_collections.remove(removed_rule_collection.to_serialized_data()) + instance.properties.rule_collections = new_rule_collections + + def _output(self, *args, **kwargs): + return {'ruleCollections': self.deserialize_output(self.ctx.vars.instance.properties.rule_collections, + client_flatten=True)} + + +@register_command( + "network firewall policy rule-collection-group draft collection rule add", + is_preview=True, +) +class RuleCollectionGroupDraftFilterRuleAdd(_RuleCollectionGroupDraftUpdate): + """ + Add a rule into an Azure firewall policy draft rule collection. + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZListArg, AAZArgEnum, AAZBoolArg, AAZDictArg, AAZResourceIdArg, \ + AAZResourceIdArgFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._required = True + args_schema.name._options = ['--name', '-n'] + args_schema.name.help = 'The name of rule.' + args_schema.name._arg_group = 'Common Rule' + args_schema.name._id_part = None + args_schema.policy_name._id_part = None + args_schema.collection_name = AAZStrArg( + options=["--collection-name"], + help="The name of the rule collection in Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.rcg_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.enable_tls_inspection = AAZBoolArg( + options=['--enable-tls-inspection', '--enable-tls-insp'], + help="Enable flag to terminate TLS connection for this rule", + default=False, + arg_group="Application Rule" + ) + args_schema.fqdn_tags = AAZListArg( + options=["--fqdn-tags"], + help="Space-separated list of FQDN tags for this rule.", + arg_group="Application Rule" + ) + args_schema.fqdn_tags.Element = AAZStrArg() + args_schema.protocols = AAZDictArg( + options=["--protocols"], + help="Space-separated list of protocols and port numbers to use, in PROTOCOL=PORT format.", + arg_group="Application Rule" + ) + args_schema.protocols.Element = AAZStrArg() + args_schema.target_fqdns = AAZListArg( + options=["--target-fqdns"], + help="Space-separated list of FQDNs for this rule.", + arg_group="Application Rule" + ) + args_schema.target_fqdns.Element = AAZStrArg() + args_schema.target_urls = AAZListArg( + options=["--target-urls"], + help="Space-separated list of target urls for this rule.", + arg_group="Application Rule" + ) + args_schema.target_urls.Element = AAZStrArg() + args_schema.web_categories = AAZListArg( + options=["--web-categories"], + help="Space-separated list of web categories for this rule.", + arg_group="Application Rule" + ) + args_schema.web_categories.Element = AAZStrArg() + args_schema.ip_protocols = AAZListArg( + options=["--ip-protocols"], + help="Space-separated list of IP protocols. This argument is supported for Nat and Network Rule. ", + arg_group="Common Rule", + ) + args_schema.ip_protocols.Element = AAZStrArg() + args_schema.ip_protocols.enum = AAZArgEnum({'TCP': 'TCP', 'UDP': 'UDP', 'Any': 'Any', 'ICMP': 'ICMP'}) + args_schema.description = AAZStrArg( + options=["--description"], + help="The description of rule.", + arg_group="Common Rule" + ) + args_schema.destination_addresses = AAZListArg( + options=["--destination-addresses", "--dest-addr"], + help="Space-separated list of destination IP addresses.", + arg_group="Common Rule" + ) + args_schema.destination_addresses.Element = AAZStrArg() + args_schema.destination_ports = AAZListArg( + options=["--destination-ports"], + help="Space-separated list of destination ports. This argument is supported for Nat and Network Rule.", + arg_group="Common Rule" + ) + args_schema.destination_ports.Element = AAZStrArg() + args_schema.rule_type = AAZStrArg( + options=["--rule-type"], + help="The type of rule.", + required=True, + arg_group="Common Rule" + ) + args_schema.rule_type.enum = AAZArgEnum({'ApplicationRule': 'ApplicationRule', + 'NetworkRule': 'NetworkRule', + 'NatRule': 'NatRule'}) + args_schema.source_addresses = AAZListArg( + options=["--source-addresses"], + help="Space-separated list of source IP ddresses.", + arg_group="Common Rule" + ) + args_schema.source_addresses.Element = AAZStrArg() + args_schema.source_ip_groups = AAZListArg( + options=["--source-ip-groups"], + help="Space-separated list of name or resource id of source IpGroups.", + arg_group="Common Rule" + ) + args_schema.source_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.translated_address = AAZStrArg( + options=["--translated-address"], + help="Translated address for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.translated_fqdn = AAZStrArg( + options=["--translated-fqdn"], + help="Translated FQDN for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.translated_port = AAZStrArg( + options=["--translated-port"], + help="Translated port for this NAT rule collection.", + arg_group="Nat Rule" + ) + args_schema.destination_ip_groups = AAZListArg( + options=['--destination-ip-groups', '--dest-ipg'], + help="Space-separated list of name or resource id of destination IpGroups.", + arg_group="Network Rule" + ) + args_schema.destination_ip_groups.Element = AAZResourceIdArg( + fmt=AAZResourceIdArgFormat( + template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ipGroups/{}" + ) + ) + args_schema.destination_fqdns = AAZListArg( + options=["--destination-fqdns"], + help="Space-separated list of destination FQDNs.", + arg_group="Network Rule" + ) + args_schema.destination_fqdns.Element = AAZStrArg() + args_schema.rule_name = AAZStrArg( + help="The name of rule.", + ) + args_schema.rule_name._registered = False + args_schema.priority._registered = False + args_schema.rule_collections._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.rule_name = args.name + args.name = args.rcg_name + + def pre_instance_update(self, instance): + args = self.ctx.args + target_rule_collection = None + for rule_collection in instance.properties.rule_collections: + if rule_collection.name == args.collection_name: + target_rule_collection = rule_collection + + if target_rule_collection is None: + raise CLIError("Cannot find corresponding rule.") + + if target_rule_collection.rule_collection_type == "FirewallPolicyFilterRuleCollection" and args.rule_type == 'NatRule': + raise CLIError("FirewallPolicyFilterRule doesn't support Nat rule.") + + if target_rule_collection.rule_collection_type == "FirewallPolicyNatRuleCollection" and args.rule_type in ['NetworkRule', 'ApplicationRule']: + raise CLIError("FirewallPolicyNatRule supports neither Network rule nor Application rule.") + + rule = None + if args.rule_type == "NetworkRule": + rule = { + 'name': args.rule_name, + 'description': args.description, + 'rule_type': 'NetworkRule', + 'ip_protocols': args.ip_protocols, + 'source_addresses': args.source_addresses, + 'destination_addresses': args.destination_addresses, + 'destination_ports': args.destination_ports, + 'source_ip_groups': args.source_ip_groups, + 'destination_ip_groups': args.destination_ip_groups, + 'destination_fqdns': args.destination_fqdns + } + elif args.rule_type == 'ApplicationRule': + protocols = [] + if has_value(args.protocols): + protocols = list( + map(lambda x: {'protocol_type': x[0], 'port': int(x[1])}, args.protocols.to_serialized_data().items())) + rule = { + 'name': args.rule_name, + 'description': args.description, + 'rule_type': 'ApplicationRule', + 'source_addresses': args.source_addresses, + 'protocols': protocols, + 'destination_addresses': args.destination_addresses, + 'fqdn_tags': args.fqdn_tags, + 'target_fqdns': args.target_fqdns, + 'target_urls': args.target_urls, + 'source_ip_groups': args.source_ip_groups, + 'terminate_tls': args.enable_tls_inspection, + 'web_categories': args.web_categories + } + + elif args.rule_type == 'NatRule': + rule = { + 'name': args.rule_name, + 'description': args.description, + 'rule_type': 'NatRule', + 'ip_protocols': args.ip_protocols, + 'source_addresses': args.source_addresses, + 'destination_addresses': args.destination_addresses, + 'destination_ports': args.destination_ports, + 'translated_address': args.translated_address, + 'translated_fqdn': args.translated_fqdn, + 'translated_port': args.translated_port, + 'source_ip_groups': args.source_ip_groups + } + + target_rule_collection.rules.append(rule) + + +@register_command( + "network firewall policy rule-collection-group draft collection rule remove", + is_preview=True, +) +class RuleCollectionGroupDraftFilterRuleRemove(_RuleCollectionGroupDraftUpdate): + """ + Remove a rule from an Azure firewall policy rule collection draft. + Filter collection supports having a list of network rules or application rules. + NatRule collection supports including a list of nat rules. + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._required = True + args_schema.name._options = ['--name', '-n'] + args_schema.name.help = 'The name of rule.' + args_schema.name._arg_group = 'Common Rule' + args_schema.name._id_part = None + args_schema.policy_name._id_part = None + args_schema.collection_name = AAZStrArg( + options=["--collection-name"], + help="The name of the rule collection in Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.rcg_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.rule_name = AAZStrArg( + help="The name of rule.", + ) + args_schema.rule_name._registered = False + args_schema.priority._registered = False + args_schema.rule_collections._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.rule_name = args.name + args.name = args.rcg_name + + def pre_instance_update(self, instance): + args = self.ctx.args + target_rule_collection = None + for rule_collection in instance.properties.rule_collections: + if rule_collection.name == args.collection_name: + target_rule_collection = rule_collection + + if target_rule_collection is None: + raise CLIError("Cannot find corresponding rule collection.") + + removed_rule = None + for rule in target_rule_collection.rules: + if rule.name == args.rule_name: + removed_rule = rule + + if removed_rule is not None: + new_rules = copy.deepcopy(target_rule_collection.rules.to_serialized_data()) + new_rules.remove(removed_rule.to_serialized_data()) + target_rule_collection.rules = new_rules + + +@register_command( + "network firewall policy rule-collection-group draft collection rule update", + is_preview=True, +) +class RuleCollectionGroupDraftFilterRuleUpdate(_RuleCollectionGroupDraftUpdate): + """ + Update a rule of an Azure firewall policy rule collection. + Filter collection supports having a list of network rules or application rules. + NatRule collection supports including a list of nat rules. + + :example: Update a rule of an Azure firewall policy rule collection. + az network firewall policy rule-collection-group draft collection rule update -g {rg} --policy- + name {policy} --rule-collection-group-name {rcg} --collection-name {cn} -n {rule_name} + --target-fqdns XXX + + """ + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZBoolArg, AAZListArg, AAZDictArg, AAZArgEnum, AAZResourceIdArg, \ + AAZResourceIdArgFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.name._required = True + args_schema.name._options = ['--name', '-n'] + args_schema.name.help = 'The name of rule.' + args_schema.name._arg_group = 'Common Rule' + args_schema.name._id_part = None + args_schema.policy_name._id_part = None + args_schema.collection_name = AAZStrArg( + options=["--collection-name"], + help="The name of the rule collection in Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.rcg_name = AAZStrArg( + options=["--rcg-name", "--rule-collection-group-name"], + help="The name of the Firewall Policy Rule Collection Group.", + required=True, + arg_group="", + ) + args_schema.enable_tls_inspection = AAZBoolArg( + options=['--enable-tls-inspection', '--enable-tls-insp'], + help="Enable flag to terminate TLS connection for this rule", + default=False, + arg_group="Application Rule" + ) + args_schema.fqdn_tags = AAZListArg( + options=["--fqdn-tags"], + help="Space-separated list of FQDN tags for this rule.", + arg_group="Application Rule" + ) + args_schema.fqdn_tags.Element = AAZStrArg() + args_schema.protocols = AAZDictArg( + options=["--protocols"], + help="Space-separated list of protocols and port numbers to use, in PROTOCOL=PORT format.", + arg_group="Application Rule" + ) + args_schema.protocols.Element = AAZStrArg() + args_schema.target_fqdns = AAZListArg( + options=["--target-fqdns"], + help="Space-separated list of FQDNs for this rule.", + arg_group="Application Rule" + ) + args_schema.target_fqdns.Element = AAZStrArg() + args_schema.target_urls = AAZListArg( + options=["--target-urls"], + help="Space-separated list of target urls for this rule.", arg_group="Application Rule" ) args_schema.target_urls.Element = AAZStrArg() diff --git a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_policy_draft.yaml b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_policy_draft.yaml new file mode 100644 index 00000000000..f9b6c839888 --- /dev/null +++ b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_policy_draft.yaml @@ -0,0 +1,1423 @@ +interactions: +- request: + body: '{"location": "SwitzerlandNorth", "properties": {"intrusionDetection": {"mode": + "Off"}, "sku": {"tier": "Premium"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l --sku --idps-mode + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001317024 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Premium\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Alert\",\r\n \"intrusionDetection\": {\r\n \"mode\": \"Off\",\r\n + \ \"profile\": \"Standard\"\r\n },\r\n \"provisioningState\": \"Updating\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"f45e1527-0ceb-403e-9f2d-9a3345705aa5\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/58122f0b-ef0c-4009-a97d-3537c6a69c85?api-version=2022-01-01&t=638562792061082462&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=IFYp1Dr6LgWiYqjr56KpGlHkEOMtmZ1NXfsJvGhrJYoDNxf9lMDOwY-TCgD1zEOz24g5TeMpdEKVD3SmGubbUe2-w_Qzi8_VY9pQgWvq07NSCNPlgtT-EP4fSeVL0R3aBVdmUOg4Qu93tDMRjY4kszrtzUgLuXvnyrH2oEHTmjjCF9M8L0h57pHT5ZAPYnYJbyJnSq4e8c4QkkglaRxJlY5uWjEKBJ9jovl9skf8RWWxV8J-hO7ZBWU5nwajNsy2vGT1aigYGTkVuJjX2lzR17zkclC4UAjGxHmo_PHkRp1P_VdZ-35zz4I9rC4h6b4Ebfcz8IptQETuu26XaVgnOA&h=i_k7ke6U3N1VecXePceK7rha1UYPgwFuuvZJSegRrRE + cache-control: + - no-cache + content-length: + - '685' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-msedge-ref: + - 'Ref A: FD79AA4C32BA46CDAF890B2AAEB4B5DC Ref B: MRS211050619035 Ref C: 2024-07-11T07:20:01Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --sku --idps-mode + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/58122f0b-ef0c-4009-a97d-3537c6a69c85?api-version=2022-01-01&t=638562792061082462&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=IFYp1Dr6LgWiYqjr56KpGlHkEOMtmZ1NXfsJvGhrJYoDNxf9lMDOwY-TCgD1zEOz24g5TeMpdEKVD3SmGubbUe2-w_Qzi8_VY9pQgWvq07NSCNPlgtT-EP4fSeVL0R3aBVdmUOg4Qu93tDMRjY4kszrtzUgLuXvnyrH2oEHTmjjCF9M8L0h57pHT5ZAPYnYJbyJnSq4e8c4QkkglaRxJlY5uWjEKBJ9jovl9skf8RWWxV8J-hO7ZBWU5nwajNsy2vGT1aigYGTkVuJjX2lzR17zkclC4UAjGxHmo_PHkRp1P_VdZ-35zz4I9rC4h6b4Ebfcz8IptQETuu26XaVgnOA&h=i_k7ke6U3N1VecXePceK7rha1UYPgwFuuvZJSegRrRE + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 34D4764393964435A38BFE8362100189 Ref B: MRS211050619035 Ref C: 2024-07-11T07:20:06Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --sku --idps-mode + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/58122f0b-ef0c-4009-a97d-3537c6a69c85?api-version=2022-01-01&t=638562792061082462&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=IFYp1Dr6LgWiYqjr56KpGlHkEOMtmZ1NXfsJvGhrJYoDNxf9lMDOwY-TCgD1zEOz24g5TeMpdEKVD3SmGubbUe2-w_Qzi8_VY9pQgWvq07NSCNPlgtT-EP4fSeVL0R3aBVdmUOg4Qu93tDMRjY4kszrtzUgLuXvnyrH2oEHTmjjCF9M8L0h57pHT5ZAPYnYJbyJnSq4e8c4QkkglaRxJlY5uWjEKBJ9jovl9skf8RWWxV8J-hO7ZBWU5nwajNsy2vGT1aigYGTkVuJjX2lzR17zkclC4UAjGxHmo_PHkRp1P_VdZ-35zz4I9rC4h6b4Ebfcz8IptQETuu26XaVgnOA&h=i_k7ke6U3N1VecXePceK7rha1UYPgwFuuvZJSegRrRE + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: B4E412E3F04F49138FEE451EBF405187 Ref B: MRS211050619035 Ref C: 2024-07-11T07:20:16Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --sku --idps-mode + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001317024 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Premium\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Alert\",\r\n \"intrusionDetection\": {\r\n \"mode\": \"Off\",\r\n + \ \"profile\": \"Standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"f45e1527-0ceb-403e-9f2d-9a3345705aa5\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '686' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:17 GMT + etag: + - '"f45e1527-0ceb-403e-9f2d-9a3345705aa5"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 4EA05DDA8F7F4EAC8AFB2C66753237DD Ref B: MRS211050619035 Ref C: 2024-07-11T07:20:16Z' + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft create + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Unknown\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"997b294e-5b0c-4689-b01f-e3ff97bfa570\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + x-msedge-ref: + - 'Ref A: FD6BBBF1874740F3BEAD9AB76A5AB38E Ref B: MRS211050618049 Ref C: 2024-07-11T07:20:18Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft create + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Unknown\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"997b294e-5b0c-4689-b01f-e3ff97bfa570\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:19 GMT + etag: + - '"997b294e-5b0c-4689-b01f-e3ff97bfa570"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: E5D4FB4EB2574C57BD2093800FC7D9E4 Ref B: MRS211050618049 Ref C: 2024-07-11T07:20:20Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft update + Connection: + - keep-alive + ParameterSetName: + - -g --name --threat-intel-mode --idps-mode + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Unknown\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"997b294e-5b0c-4689-b01f-e3ff97bfa570\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:22 GMT + etag: + - '"997b294e-5b0c-4689-b01f-e3ff97bfa570"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: E2A6456042004BC6B6E784E3FD8CA168 Ref B: MRS211050618033 Ref C: 2024-07-11T07:20:21Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default", + "properties": {"intrusionDetection": {"mode": "Alert"}, "threatIntelMode": "Deny"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft update + Connection: + - keep-alive + Content-Length: + - '289' + Content-Type: + - application/json + ParameterSetName: + - -g --name --threat-intel-mode --idps-mode + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"intrusionDetection\": {\r\n \"mode\": \"Alert\"\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"a2982fd3-edd9-4e8e-9b9a-dc1acd37c6e2\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '509' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + x-msedge-ref: + - 'Ref A: C52F479039B0452BA9C12D0307BE637B Ref B: MRS211050618033 Ref C: 2024-07-11T07:20:22Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection add + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --mode --signature-id --private-ranges + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"intrusionDetection\": {\r\n \"mode\": \"Alert\"\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"a2982fd3-edd9-4e8e-9b9a-dc1acd37c6e2\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '509' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:25 GMT + etag: + - '"a2982fd3-edd9-4e8e-9b9a-dc1acd37c6e2"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 63C29BB8CD544FBF800612A936D1D94D Ref B: MRS211050315049 Ref C: 2024-07-11T07:20:25Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default", + "properties": {"intrusionDetection": {"configuration": {"privateRanges": ["167.220.204.0/24", + "167.221.205.101/32"], "signatureOverrides": [{"id": "10001", "mode": "Deny"}]}, + "mode": "Alert"}, "snat": {"privateRanges": ["167.220.204.0/24", "167.221.205.101/32"]}, + "threatIntelMode": "Deny"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection add + Connection: + - keep-alive + Content-Length: + - '497' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --mode --signature-id --private-ranges + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.204.0/24\",\r\n + \ \"167.221.205.101/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.204.0/24\",\r\n + \ \"167.221.205.101/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"c5ce2735-5be4-42c3-b385-2c9ea13ad38f\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '929' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + x-msedge-ref: + - 'Ref A: D65342EBC0A345778464D7581E5CF557 Ref B: MRS211050315049 Ref C: 2024-07-11T07:20:25Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection add + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --mode --signature-id --private-ranges + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.204.0/24\",\r\n + \ \"167.221.205.101/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.204.0/24\",\r\n + \ \"167.221.205.101/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"c5ce2735-5be4-42c3-b385-2c9ea13ad38f\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '929' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:27 GMT + etag: + - '"c5ce2735-5be4-42c3-b385-2c9ea13ad38f"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: D431D1F1833B45D3953E49315E248EC7 Ref B: MRS211050315037 Ref C: 2024-07-11T07:20:27Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default", + "properties": {"intrusionDetection": {"configuration": {"bypassTrafficSettings": + [], "privateRanges": ["167.220.208.0/24", "167.221.205.102/32"], "signatureOverrides": + [{"id": "10001", "mode": "Deny"}, {"id": "20001", "mode": "Alert"}]}, "mode": + "Alert"}, "snat": {"privateRanges": ["167.220.208.0/24", "167.221.205.102/32"]}, + "threatIntelMode": "Deny"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection add + Connection: + - keep-alive + Content-Length: + - '560' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --mode --signature-id --private-ranges + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n },\r\n {\r\n \"id\": \"20001\",\r\n + \ \"mode\": \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"00b785cf-6f4d-4413-851b-984572cfaa2e\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1013' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + x-msedge-ref: + - 'Ref A: 656667845E8142F69D87053B2A395408 Ref B: MRS211050315037 Ref C: 2024-07-11T07:20:28Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection add + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-name --rule-protocol --rule-src-addresses --rule-dest-addresses + --rule-dest-ports + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n },\r\n {\r\n \"id\": \"20001\",\r\n + \ \"mode\": \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"00b785cf-6f4d-4413-851b-984572cfaa2e\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1013' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:30 GMT + etag: + - '"00b785cf-6f4d-4413-851b-984572cfaa2e"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: A365CDAEA0C54C5F8004C2C8C6EFE011 Ref B: MRS211050315011 Ref C: 2024-07-11T07:20:30Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default", + "properties": {"intrusionDetection": {"configuration": {"bypassTrafficSettings": + [{"destinationAddresses": ["192.168.0.103", "192.168.0.104"], "destinationPorts": + ["8080", "9090", "5432"], "name": "bypass-rule-1", "protocol": "TCP", "sourceAddresses": + ["10.0.0.12", "10.0.0.15"]}], "privateRanges": ["167.220.208.0/24", "167.221.205.102/32"], + "signatureOverrides": [{"id": "10001", "mode": "Deny"}, {"id": "20001", "mode": + "Alert"}]}, "mode": "Alert"}, "snat": {"privateRanges": ["167.220.208.0/24", + "167.221.205.102/32"]}, "threatIntelMode": "Deny"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection add + Connection: + - keep-alive + Content-Length: + - '757' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-name --rule-protocol --rule-src-addresses --rule-dest-addresses + --rule-dest-ports + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n },\r\n {\r\n \"id\": \"20001\",\r\n + \ \"mode\": \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [\r\n {\r\n \"name\": \"bypass-rule-1\",\r\n \"protocol\": + \"TCP\",\r\n \"sourceAddresses\": [\r\n \"10.0.0.12\",\r\n + \ \"10.0.0.15\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"192.168.0.103\",\r\n \"192.168.0.104\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"8080\",\r\n + \ \"9090\",\r\n \"5432\"\r\n ]\r\n }\r\n + \ ],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"639b5fbe-86dc-449d-997f-bc34247b7a24\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-msedge-ref: + - 'Ref A: 734BAF27794546BEBD851022EB12AF84 Ref B: MRS211050315011 Ref C: 2024-07-11T07:20:31Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection list + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n },\r\n {\r\n \"id\": \"20001\",\r\n + \ \"mode\": \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [\r\n {\r\n \"name\": \"bypass-rule-1\",\r\n \"protocol\": + \"TCP\",\r\n \"sourceAddresses\": [\r\n \"10.0.0.12\",\r\n + \ \"10.0.0.15\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"192.168.0.103\",\r\n \"192.168.0.104\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"8080\",\r\n + \ \"9090\",\r\n \"5432\"\r\n ]\r\n }\r\n + \ ],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"639b5fbe-86dc-449d-997f-bc34247b7a24\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:34 GMT + etag: + - '"639b5fbe-86dc-449d-997f-bc34247b7a24"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: A01055DAAFA54785A3BD713A0AA504F9 Ref B: MRS211050619033 Ref C: 2024-07-11T07:20:35Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection remove + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-name --signature-id + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"10001\",\r\n \"mode\": + \"Deny\"\r\n },\r\n {\r\n \"id\": \"20001\",\r\n + \ \"mode\": \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [\r\n {\r\n \"name\": \"bypass-rule-1\",\r\n \"protocol\": + \"TCP\",\r\n \"sourceAddresses\": [\r\n \"10.0.0.12\",\r\n + \ \"10.0.0.15\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"192.168.0.103\",\r\n \"192.168.0.104\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"8080\",\r\n + \ \"9090\",\r\n \"5432\"\r\n ]\r\n }\r\n + \ ],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"639b5fbe-86dc-449d-997f-bc34247b7a24\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:35 GMT + etag: + - '"639b5fbe-86dc-449d-997f-bc34247b7a24"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 03115BAFA4D343709D5B3645107FC11B Ref B: MRS211050315049 Ref C: 2024-07-11T07:20:35Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default", + "properties": {"intrusionDetection": {"configuration": {"bypassTrafficSettings": + [], "privateRanges": ["167.220.208.0/24", "167.221.205.102/32"], "signatureOverrides": + [{"id": "20001", "mode": "Alert"}]}, "mode": "Alert"}, "snat": {"privateRanges": + ["167.220.208.0/24", "167.221.205.102/32"]}, "threatIntelMode": "Deny"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection remove + Connection: + - keep-alive + Content-Length: + - '527' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-name --signature-id + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"20001\",\r\n \"mode\": + \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"52b340e9-322c-4162-a243-0159cb7254a9\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '930' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + x-msedge-ref: + - 'Ref A: 9D22512F61324359AD34FC2974CF6F68 Ref B: MRS211050315049 Ref C: 2024-07-11T07:20:36Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft intrusion-detection list + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Deny\",\r\n + \ \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"20001\",\r\n \"mode\": + \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"52b340e9-322c-4162-a243-0159cb7254a9\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '930' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:38 GMT + etag: + - '"52b340e9-322c-4162-a243-0159cb7254a9"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 3A8077EBFD9842BC8B8E2A3CCCAAFFB6 Ref B: MRS211050313025 Ref C: 2024-07-11T07:20:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001317024 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Premium\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Alert\",\r\n \"intrusionDetection\": {\r\n \"mode\": \"Off\",\r\n + \ \"profile\": \"Standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"f45e1527-0ceb-403e-9f2d-9a3345705aa5\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '686' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:38 GMT + etag: + - '"f45e1527-0ceb-403e-9f2d-9a3345705aa5"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 5E00A560D4CF4764ACCEDF6FC99C3F36 Ref B: MRS211050315033 Ref C: 2024-07-11T07:20:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/deploy?api-version=2023-09-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/006ecec7-9a52-4906-b43a-e4ec707fcee2?api-version=2023-09-01&t=638562792398555539&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=d-9zwe-YI370AijwKLQNpWzE1r1w8X4Riz41NfbPaX7QCJTGCoNar0s2MHM4d7qMUWMQ_g1wJCRxFqzGAIijQRKoSnnx7vyfiIY_S7ksgcDrZC6j_QlEIARa6u_AqOTVaZ6Y5MIcNVdCRjRrOF2R2CY3ycIMSF4DpsQTdcMHeRd_BcAEK1TMFI0Mg-soI5oaZ5xee5iL05aWJ0LmPshnm1Oyz7biNChi-bM-XorYCWOBuCs9fvJf5C-qBkbPIfUSKLA54lPZxV_A5jmGMhTk1aNC_6HNkkQLKp8J6YHe-Tpcgl6nUXI_-zJp0otjS14hcS53y3S5STCBuyyoGj62pw&h=mozC-z-Ub1nLLaNNdC5rqMpjFfPO8brdL0LIJXewYVQ + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:39 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/006ecec7-9a52-4906-b43a-e4ec707fcee2?api-version=2023-09-01&t=638562792398555539&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=d-9zwe-YI370AijwKLQNpWzE1r1w8X4Riz41NfbPaX7QCJTGCoNar0s2MHM4d7qMUWMQ_g1wJCRxFqzGAIijQRKoSnnx7vyfiIY_S7ksgcDrZC6j_QlEIARa6u_AqOTVaZ6Y5MIcNVdCRjRrOF2R2CY3ycIMSF4DpsQTdcMHeRd_BcAEK1TMFI0Mg-soI5oaZ5xee5iL05aWJ0LmPshnm1Oyz7biNChi-bM-XorYCWOBuCs9fvJf5C-qBkbPIfUSKLA54lPZxV_A5jmGMhTk1aNC_6HNkkQLKp8J6YHe-Tpcgl6nUXI_-zJp0otjS14hcS53y3S5STCBuyyoGj62pw&h=mozC-z-Ub1nLLaNNdC5rqMpjFfPO8brdL0LIJXewYVQ + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-msedge-ref: + - 'Ref A: 0C1202A7090A40718FA81AB72875BA87 Ref B: MRS211050619039 Ref C: 2024-07-11T07:20:39Z' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/006ecec7-9a52-4906-b43a-e4ec707fcee2?api-version=2023-09-01&t=638562792398555539&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=d-9zwe-YI370AijwKLQNpWzE1r1w8X4Riz41NfbPaX7QCJTGCoNar0s2MHM4d7qMUWMQ_g1wJCRxFqzGAIijQRKoSnnx7vyfiIY_S7ksgcDrZC6j_QlEIARa6u_AqOTVaZ6Y5MIcNVdCRjRrOF2R2CY3ycIMSF4DpsQTdcMHeRd_BcAEK1TMFI0Mg-soI5oaZ5xee5iL05aWJ0LmPshnm1Oyz7biNChi-bM-XorYCWOBuCs9fvJf5C-qBkbPIfUSKLA54lPZxV_A5jmGMhTk1aNC_6HNkkQLKp8J6YHe-Tpcgl6nUXI_-zJp0otjS14hcS53y3S5STCBuyyoGj62pw&h=mozC-z-Ub1nLLaNNdC5rqMpjFfPO8brdL0LIJXewYVQ + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: DC7278D5B9FB467681C43DABDF407391 Ref B: MRS211050619039 Ref C: 2024-07-11T07:20:39Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/006ecec7-9a52-4906-b43a-e4ec707fcee2?api-version=2023-09-01&t=638562792398555539&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=d-9zwe-YI370AijwKLQNpWzE1r1w8X4Riz41NfbPaX7QCJTGCoNar0s2MHM4d7qMUWMQ_g1wJCRxFqzGAIijQRKoSnnx7vyfiIY_S7ksgcDrZC6j_QlEIARa6u_AqOTVaZ6Y5MIcNVdCRjRrOF2R2CY3ycIMSF4DpsQTdcMHeRd_BcAEK1TMFI0Mg-soI5oaZ5xee5iL05aWJ0LmPshnm1Oyz7biNChi-bM-XorYCWOBuCs9fvJf5C-qBkbPIfUSKLA54lPZxV_A5jmGMhTk1aNC_6HNkkQLKp8J6YHe-Tpcgl6nUXI_-zJp0otjS14hcS53y3S5STCBuyyoGj62pw&h=mozC-z-Ub1nLLaNNdC5rqMpjFfPO8brdL0LIJXewYVQ + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 626E385E16D94A518D7E89CBF78DE33F Ref B: MRS211050619039 Ref C: 2024-07-11T07:20:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/006ecec7-9a52-4906-b43a-e4ec707fcee2?api-version=2023-09-01&t=638562792398555539&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=d-9zwe-YI370AijwKLQNpWzE1r1w8X4Riz41NfbPaX7QCJTGCoNar0s2MHM4d7qMUWMQ_g1wJCRxFqzGAIijQRKoSnnx7vyfiIY_S7ksgcDrZC6j_QlEIARa6u_AqOTVaZ6Y5MIcNVdCRjRrOF2R2CY3ycIMSF4DpsQTdcMHeRd_BcAEK1TMFI0Mg-soI5oaZ5xee5iL05aWJ0LmPshnm1Oyz7biNChi-bM-XorYCWOBuCs9fvJf5C-qBkbPIfUSKLA54lPZxV_A5jmGMhTk1aNC_6HNkkQLKp8J6YHe-Tpcgl6nUXI_-zJp0otjS14hcS53y3S5STCBuyyoGj62pw&h=mozC-z-Ub1nLLaNNdC5rqMpjFfPO8brdL0LIJXewYVQ + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 22A66D0BE0DE47B2BEAA03A9F0FF2181 Ref B: MRS211050619039 Ref C: 2024-07-11T07:20:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001317024 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Premium\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Deny\",\r\n \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"20001\",\r\n \"mode\": + \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"2ffc530c-4370-4f56-86e0-aaef1a462887\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1078' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:50 GMT + etag: + - '"2ffc530c-4370-4f56-86e0-aaef1a462887"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 636A00A4D13042DEAFB999E07FD6531B Ref B: MRS211050313019 Ref C: 2024-07-11T07:20:51Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy intrusion-detection list + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001317024 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Premium\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Deny\",\r\n \"snat\": {\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n },\r\n \"intrusionDetection\": + {\r\n \"mode\": \"Alert\",\r\n \"configuration\": {\r\n \"signatureOverrides\": + [\r\n {\r\n \"id\": \"20001\",\r\n \"mode\": + \"Alert\"\r\n }\r\n ],\r\n \"bypassTrafficSettings\": + [],\r\n \"privateRanges\": [\r\n \"167.220.208.0/24\",\r\n + \ \"167.221.205.102/32\"\r\n ]\r\n }\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"2ffc530c-4370-4f56-86e0-aaef1a462887\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1078' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 07:20:51 GMT + etag: + - '"2ffc530c-4370-4f56-86e0-aaef1a462887"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 4FC52FE03DED4343BB0369FC59894FDF Ref B: MRS211050313025 Ref C: 2024-07-11T07:20:51Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 11 Jul 2024 07:20:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + x-msedge-ref: + - 'Ref A: 334A362BF31B41528FBE5690EAACF191 Ref B: MRS211050313017 Ref C: 2024-07-11T07:20:52Z' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_policy_rcg_draft.yaml b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_policy_rcg_draft.yaml new file mode 100644 index 00000000000..4c2cc11b7c3 --- /dev/null +++ b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_policy_rcg_draft.yaml @@ -0,0 +1,2670 @@ +interactions: +- request: + body: '{"location": "SwitzerlandNorth"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001263618 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Standard\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Alert\",\r\n \"provisioningState\": \"Updating\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"87af4aed-a92a-4cca-a4ec-ee4424a1bfda\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/206ee1cb-c02f-44ab-ac36-a12ae0230ba7?api-version=2022-01-01&t=638562879153089443&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=KGjilr54OUm9efNcHgCUMJgq9fwRVknAjXX47TbEfdSJj4DhenYEMYQTBXwmoUWDSDFihhKZkLjO0-3Ppy_bVzqdaEEoCczV2wTKadf27Ym8DSE-oJ67emhIe-i42brWoxdb7fY4-jTkklU7QP_h-FRQ0FN-wJ15a-bDqbkIetvfMRul44cXctSpwDJLpuTlloUXBxzVQEV6J_GJgVywhmf_hnGH3_j08jNOc3v4JMEjqwN1jL2C7kFfbVh1F25fOvjaCIjZ_5ihbaBAGev435uFt0ZDxDOvig__R6On5u5DCKeCb6NeCOjxTvv-am6t4gU-DP1vgQeqykYH05xJMQ&h=VnWS33z2mgKU8hOyzkpHLvBElzxvhC30BumRy-0EH7g + cache-control: + - no-cache + content-length: + - '598' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + x-msedge-ref: + - 'Ref A: 7BF5514B33184BE0964938C580A61C12 Ref B: MRS211050619027 Ref C: 2024-07-11T09:45:10Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/206ee1cb-c02f-44ab-ac36-a12ae0230ba7?api-version=2022-01-01&t=638562879153089443&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=KGjilr54OUm9efNcHgCUMJgq9fwRVknAjXX47TbEfdSJj4DhenYEMYQTBXwmoUWDSDFihhKZkLjO0-3Ppy_bVzqdaEEoCczV2wTKadf27Ym8DSE-oJ67emhIe-i42brWoxdb7fY4-jTkklU7QP_h-FRQ0FN-wJ15a-bDqbkIetvfMRul44cXctSpwDJLpuTlloUXBxzVQEV6J_GJgVywhmf_hnGH3_j08jNOc3v4JMEjqwN1jL2C7kFfbVh1F25fOvjaCIjZ_5ihbaBAGev435uFt0ZDxDOvig__R6On5u5DCKeCb6NeCOjxTvv-am6t4gU-DP1vgQeqykYH05xJMQ&h=VnWS33z2mgKU8hOyzkpHLvBElzxvhC30BumRy-0EH7g + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: D94648A343C2454495614138FC5C4431 Ref B: MRS211050619027 Ref C: 2024-07-11T09:45:15Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001263618 MB\",\r\n \"sku\": + {\r\n \"tier\": \"Standard\"\r\n },\r\n \"childPolicies\": [],\r\n + \ \"ruleCollectionGroups\": [],\r\n \"firewalls\": [],\r\n \"threatIntelMode\": + \"Alert\",\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies\",\r\n + \ \"etag\": \"87af4aed-a92a-4cca-a4ec-ee4424a1bfda\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '599' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:16 GMT + etag: + - '"87af4aed-a92a-4cca-a4ec-ee4424a1bfda"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: D15DFCD804944739816FCF7BE7F72477 Ref B: MRS211050619027 Ref C: 2024-07-11T09:45:16Z' + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft create + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Unknown\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"a730f97d-42ab-4f6e-b3d6-2d6bf3baed94\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-msedge-ref: + - 'Ref A: 3BA3AD43B15843A78BFC20543C53531D Ref B: MRS211050619011 Ref C: 2024-07-11T09:45:17Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy draft create + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"threatIntelMode\": \"Unknown\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/firewallPolicyDrafts/default\",\r\n + \ \"name\": \"myclipolicy\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts\",\r\n + \ \"etag\": \"a730f97d-42ab-4f6e-b3d6-2d6bf3baed94\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:19 GMT + etag: + - '"a730f97d-42ab-4f6e-b3d6-2d6bf3baed94"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 8675D50DCA954C3392CE4F3909545309 Ref B: MRS211050619011 Ref C: 2024-07-11T09:45:18Z' + status: + code: 200 + message: OK +- request: + body: '{"name": "myclirulecollectiongroup", "properties": {"priority": 10000}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group create + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + ParameterSetName: + - -g --priority --policy-name -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001322746 MB\",\r\n \"priority\": + 10000,\r\n \"ruleCollections\": [],\r\n \"provisioningState\": \"Updating\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups\",\r\n + \ \"etag\": \"896a5e38-dbbf-4cf4-973d-d73c2a497fcf\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/3e53259a-5de6-456f-92cd-61645702a2a5?api-version=2022-01-01&t=638562879222462281&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=jZbLP-sLmUchJxjaNef2l0VjFDabvV2HRoJixdQUAYGwya3jU6710t3qQb-SNMiHyy6PSXXXiaQrJ8w1w218PtqNSMdREvTEg3hGnJ535K6QVHmxk23vn5Ip3i1-DLooOF99uvP1h1RgZcFPB0ZRva0BLpjpg7wQcyIGLohMvDZvCR1OSJOKr1BISgFtnSyQyLkbJaugRUKw81ciZvS5ivkGN_G9WMlyTaxJjy4EeJozIwvR-xXa-vAoUoTcAT2Ybjfbekaq6O0QFP218A7Ff_RZwTtpOcaQU21eIEgyqoLGE-6La3nGXOAUmAY7PllYiIYj3zFv__7Kyb4A6_FLPA&h=pve6mMcblPqfz3L8B3KbBT-VztbHm6RhdNmyCWQvVc0 + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:21 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-msedge-ref: + - 'Ref A: 76EFCA5DF2D64776A498F2545AAA20B4 Ref B: MRS211050618017 Ref C: 2024-07-11T09:45:19Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group create + Connection: + - keep-alive + ParameterSetName: + - -g --priority --policy-name -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/3e53259a-5de6-456f-92cd-61645702a2a5?api-version=2022-01-01&t=638562879222462281&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=jZbLP-sLmUchJxjaNef2l0VjFDabvV2HRoJixdQUAYGwya3jU6710t3qQb-SNMiHyy6PSXXXiaQrJ8w1w218PtqNSMdREvTEg3hGnJ535K6QVHmxk23vn5Ip3i1-DLooOF99uvP1h1RgZcFPB0ZRva0BLpjpg7wQcyIGLohMvDZvCR1OSJOKr1BISgFtnSyQyLkbJaugRUKw81ciZvS5ivkGN_G9WMlyTaxJjy4EeJozIwvR-xXa-vAoUoTcAT2Ybjfbekaq6O0QFP218A7Ff_RZwTtpOcaQU21eIEgyqoLGE-6La3nGXOAUmAY7PllYiIYj3zFv__7Kyb4A6_FLPA&h=pve6mMcblPqfz3L8B3KbBT-VztbHm6RhdNmyCWQvVc0 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: AF95829A3DCC44CBB4CAD1A8940AFDE6 Ref B: MRS211050618017 Ref C: 2024-07-11T09:45:22Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group create + Connection: + - keep-alive + ParameterSetName: + - -g --priority --policy-name -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/3e53259a-5de6-456f-92cd-61645702a2a5?api-version=2022-01-01&t=638562879222462281&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=jZbLP-sLmUchJxjaNef2l0VjFDabvV2HRoJixdQUAYGwya3jU6710t3qQb-SNMiHyy6PSXXXiaQrJ8w1w218PtqNSMdREvTEg3hGnJ535K6QVHmxk23vn5Ip3i1-DLooOF99uvP1h1RgZcFPB0ZRva0BLpjpg7wQcyIGLohMvDZvCR1OSJOKr1BISgFtnSyQyLkbJaugRUKw81ciZvS5ivkGN_G9WMlyTaxJjy4EeJozIwvR-xXa-vAoUoTcAT2Ybjfbekaq6O0QFP218A7Ff_RZwTtpOcaQU21eIEgyqoLGE-6La3nGXOAUmAY7PllYiIYj3zFv__7Kyb4A6_FLPA&h=pve6mMcblPqfz3L8B3KbBT-VztbHm6RhdNmyCWQvVc0 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: BF54821BF35049C599EE672648A271DE Ref B: MRS211050618017 Ref C: 2024-07-11T09:45:33Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group create + Connection: + - keep-alive + ParameterSetName: + - -g --priority --policy-name -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"size\": \"0.001322746 MB\",\r\n \"priority\": + 10000,\r\n \"ruleCollections\": [],\r\n \"provisioningState\": \"Succeeded\"\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups\",\r\n + \ \"etag\": \"0c78ed33-2dce-4b15-8937-24cf17cfa67e\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:33 GMT + etag: + - '"0c78ed33-2dce-4b15-8937-24cf17cfa67e"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: D7081DD3B51748B69616E16FA2EAF5AD Ref B: MRS211050618017 Ref C: 2024-07-11T09:45:34Z' + status: + code: 200 + message: OK +- request: + body: '{"name": "myclirulecollectiongroup", "properties": {"priority": 150}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft create + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + ParameterSetName: + - -g --name --priority --policy-name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 150,\r\n \"ruleCollections\": + []\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '128' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-msedge-ref: + - 'Ref A: 93456ABBF4214391951FBA71E1EDA6B7 Ref B: MRS211050618011 Ref C: 2024-07-11T09:45:34Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft create + Connection: + - keep-alive + ParameterSetName: + - -g --name --priority --policy-name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 150,\r\n \"ruleCollections\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"18bfdf52-2146-43d9-9481-4145bd5f4218\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:36 GMT + etag: + - '"18bfdf52-2146-43d9-9481-4145bd5f4218"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: B3691901298D44F19D2549C6926C201D Ref B: MRS211050618011 Ref C: 2024-07-11T09:45:36Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft update + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --name --priority + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 150,\r\n \"ruleCollections\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"18bfdf52-2146-43d9-9481-4145bd5f4218\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:36 GMT + etag: + - '"18bfdf52-2146-43d9-9481-4145bd5f4218"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: BAA16D7207284C59A40D95A7027601E1 Ref B: MRS211050619051 Ref C: 2024-07-11T09:45:36Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + []}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft update + Connection: + - keep-alive + Content-Length: + - '350' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --name --priority + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + []\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '130' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + x-msedge-ref: + - 'Ref A: 2ACD60F9CE1D4F049E02790171693B36 Ref B: MRS211050619051 Ref C: 2024-07-11T09:45:37Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft show + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name -n + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"76eed1c6-4cc8-4bcc-9614-09a9dea2930b\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:40 GMT + etag: + - '"76eed1c6-4cc8-4bcc-9614-09a9dea2930b"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 03ABA66E2868455CB8AACAA5957BE34C Ref B: MRS211050315027 Ref C: 2024-07-11T09:45:39Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-nat-collection + Connection: + - keep-alive + ParameterSetName: + - -n --policy-name --rule-collection-group-name -g --collection-priority --action + --rule-name --description --destination-addresses --source-addresses --translated-address + --translated-port --destination-ports --ip-protocols + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"76eed1c6-4cc8-4bcc-9614-09a9dea2930b\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:40 GMT + etag: + - '"76eed1c6-4cc8-4bcc-9614-09a9dea2930b"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: E6AC5AA4416B4B46B6FEF596E7036A43 Ref B: MRS211050619027 Ref C: 2024-07-11T09:45:40Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "DNAT"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "translatedAddress": "128.1.1.1", "translatedPort": "1234"}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-nat-collection + Connection: + - keep-alive + Content-Length: + - '783' + Content-Type: + - application/json + ParameterSetName: + - -n --policy-name --rule-collection-group-name -g --collection-priority --action + --rule-name --description --destination-addresses --source-addresses --translated-address + --translated-port --destination-ports --ip-protocols + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '990' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-msedge-ref: + - 'Ref A: 1FA32D4311C2438483F20D1975900436 Ref B: MRS211050619027 Ref C: 2024-07-11T09:45:41Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-filter-collection + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-collection-group-name -n --collection-priority --action + --rule-name --rule-type --description --destination-addresses --source-addresses + --destination-ports --ip-protocols + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"c9439e9c-3367-4e66-aa28-bfd7f1951d5c\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1419' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:43 GMT + etag: + - '"c9439e9c-3367-4e66-aa28-bfd7f1951d5c"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 3608A4335E9E4DE4AD226D34F3B58F1C Ref B: MRS211050313035 Ref C: 2024-07-11T09:45:43Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedAddress": "128.1.1.1", "translatedPort": + "1234"}]}, {"name": "filter-collection-1", "priority": 13000, "ruleCollectionType": + "FirewallPolicyFilterRuleCollection", "action": {"type": "Allow"}, "rules": + [{"description": "test", "name": "network-rule", "ruleType": "NetworkRule", + "destinationAddresses": ["202.120.36.15"], "destinationPorts": ["12003", "12004"], + "ipProtocols": ["Any", "ICMP"], "sourceAddresses": ["202.120.36.13", "202.120.36.14"]}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-filter-collection + Connection: + - keep-alive + Content-Length: + - '1203' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-collection-group-name -n --collection-priority --action + --rule-name --rule-type --description --destination-addresses --source-addresses + --destination-ports --ip-protocols + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1906' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + x-msedge-ref: + - 'Ref A: 9EC9F1CBB91F436980D64967BD0816BE Ref B: MRS211050313035 Ref C: 2024-07-11T09:45:43Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-filter-collection + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-collection-group-name -n --collection-priority --action + --rule-name --rule-type --description --destination-addresses --source-addresses + --protocols --fqdn-tags --target-urls --enable-tls-inspection + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"7875565c-10ae-447e-b0d9-87ca98c4669a\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2335' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:45 GMT + etag: + - '"7875565c-10ae-447e-b0d9-87ca98c4669a"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 16341A68A8274FE7A17E22CD16CF11FD Ref B: MRS211050619009 Ref C: 2024-07-11T09:45:45Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedAddress": "128.1.1.1", "translatedPort": + "1234"}]}, {"name": "filter-collection-1", "priority": 13000, "ruleCollectionType": + "FirewallPolicyFilterRuleCollection", "action": {"type": "Allow"}, "rules": + [{"description": "test", "name": "network-rule", "ruleType": "NetworkRule", + "destinationAddresses": ["202.120.36.15"], "destinationFqdns": [], "destinationIpGroups": + [], "destinationPorts": ["12003", "12004"], "ipProtocols": ["Any", "ICMP"], + "sourceAddresses": ["202.120.36.13", "202.120.36.14"], "sourceIpGroups": []}]}, + {"name": "filter-collection-2", "priority": 14000, "ruleCollectionType": "FirewallPolicyFilterRuleCollection", + "action": {"type": "Allow"}, "rules": [{"description": "test", "name": "application-rule", + "ruleType": "ApplicationRule", "destinationAddresses": ["202.120.36.15", "202.120.36.16"], + "fqdnTags": ["AzureBackup", "HDInsight"], "protocols": [{"port": 12800, "protocolType": + "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "targetUrls": ["www.google.com", "www.bing.com"], "terminateTLS": + true}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-filter-collection + Connection: + - keep-alive + Content-Length: + - '1839' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-collection-group-name -n --collection-priority --action + --rule-name --rule-type --description --destination-addresses --source-addresses + --protocols --fqdn-tags --target-urls --enable-tls-inspection + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3172' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + x-msedge-ref: + - 'Ref A: 14A931BB6AD544E0B6B49665ECD0C430 Ref B: MRS211050619009 Ref C: 2024-07-11T09:45:45Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-nat-collection + Connection: + - keep-alive + ParameterSetName: + - -n --policy-name --rule-collection-group-name -g --collection-priority --action + --rule-name --description --destination-addresses --source-addresses --translated-fqdn + --translated-port --destination-ports --ip-protocols + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"08f13fae-f7d3-4cb2-a590-9ead05284783\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3601' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:47 GMT + etag: + - '"08f13fae-f7d3-4cb2-a590-9ead05284783"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 9B40CB99F7C34007BBA845B28A8E8D2E Ref B: MRS211050618009 Ref C: 2024-07-11T09:45:47Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedAddress": "128.1.1.1", "translatedPort": + "1234"}]}, {"name": "filter-collection-1", "priority": 13000, "ruleCollectionType": + "FirewallPolicyFilterRuleCollection", "action": {"type": "Allow"}, "rules": + [{"description": "test", "name": "network-rule", "ruleType": "NetworkRule", + "destinationAddresses": ["202.120.36.15"], "destinationFqdns": [], "destinationIpGroups": + [], "destinationPorts": ["12003", "12004"], "ipProtocols": ["Any", "ICMP"], + "sourceAddresses": ["202.120.36.13", "202.120.36.14"], "sourceIpGroups": []}]}, + {"name": "filter-collection-2", "priority": 14000, "ruleCollectionType": "FirewallPolicyFilterRuleCollection", + "action": {"type": "Allow"}, "rules": [{"description": "test", "name": "application-rule", + "ruleType": "ApplicationRule", "destinationAddresses": ["202.120.36.15", "202.120.36.16"], + "fqdnTags": ["AzureBackup", "HDInsight"], "protocols": [{"port": 12800, "protocolType": + "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "targetFqdns": [], "targetUrls": ["www.google.com", + "www.bing.com"], "terminateTLS": true, "webCategories": []}]}, {"name": "nat-collection-2", + "priority": 1000, "ruleCollectionType": "FirewallPolicyNatRuleCollection", "action": + {"type": "DNAT"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "translatedFqdn": "www.google.com", "translatedPort": "1234"}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection add-nat-collection + Connection: + - keep-alive + Content-Length: + - '2339' + Content-Type: + - application/json + ParameterSetName: + - -n --policy-name --rule-collection-group-name -g --collection-priority --action + --rule-name --description --destination-addresses --source-addresses --translated-fqdn + --translated-port --destination-ports --ip-protocols + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4030' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1190' + x-msedge-ref: + - 'Ref A: F190A6142C9F402C99A83188AC22D062 Ref B: MRS211050618009 Ref C: 2024-07-11T09:45:48Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection rule add + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-collection-group-name --collection-name --name --rule-type + --description --source-addresses --destination-addresses --protocols --target-fqdns + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"2fe3a84a-9d26-4c52-b1e5-6f1958b1004f\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4459' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:49 GMT + etag: + - '"2fe3a84a-9d26-4c52-b1e5-6f1958b1004f"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 829F91591D2243F0830A2655124B0F0C Ref B: MRS211050618017 Ref C: 2024-07-11T09:45:49Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedAddress": "128.1.1.1", "translatedPort": + "1234"}]}, {"name": "filter-collection-1", "priority": 13000, "ruleCollectionType": + "FirewallPolicyFilterRuleCollection", "action": {"type": "Allow"}, "rules": + [{"description": "test", "name": "network-rule", "ruleType": "NetworkRule", + "destinationAddresses": ["202.120.36.15"], "destinationFqdns": [], "destinationIpGroups": + [], "destinationPorts": ["12003", "12004"], "ipProtocols": ["Any", "ICMP"], + "sourceAddresses": ["202.120.36.13", "202.120.36.14"], "sourceIpGroups": []}]}, + {"name": "filter-collection-2", "priority": 14000, "ruleCollectionType": "FirewallPolicyFilterRuleCollection", + "action": {"type": "Allow"}, "rules": [{"description": "test", "name": "application-rule", + "ruleType": "ApplicationRule", "destinationAddresses": ["202.120.36.15", "202.120.36.16"], + "fqdnTags": ["AzureBackup", "HDInsight"], "protocols": [{"port": 12800, "protocolType": + "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "targetFqdns": [], "targetUrls": ["www.google.com", + "www.bing.com"], "terminateTLS": true, "webCategories": []}, {"description": + "test", "name": "application-rule-2", "ruleType": "ApplicationRule", "destinationAddresses": + ["202.120.36.15", "202.120.36.16"], "protocols": [{"port": 12800, "protocolType": + "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "targetFqdns": ["www.bing.com"], "terminateTLS": false}]}, + {"name": "nat-collection-2", "priority": 1000, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedFqdn": "www.google.com", + "translatedPort": "1234"}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection rule add + Connection: + - keep-alive + Content-Length: + - '2716' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-collection-group-name --collection-name --name --rule-type + --description --source-addresses --destination-addresses --protocols --target-fqdns + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n },\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n + \ \"name\": \"application-rule-2\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [\r\n \"www.bing.com\"\r\n + \ ],\r\n \"targetUrls\": [],\r\n \"terminateTLS\": + false,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4949' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-msedge-ref: + - 'Ref A: 96FB24B7963740FF88C5CC6CB282D082 Ref B: MRS211050618017 Ref C: 2024-07-11T09:45:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection list + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-collection-group-name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n },\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n + \ \"name\": \"application-rule-2\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [\r\n \"www.bing.com\"\r\n + \ ],\r\n \"targetUrls\": [],\r\n \"terminateTLS\": + false,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"5c73fefd-76a1-4afe-b8f2-e00d23498865\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '5378' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:52 GMT + etag: + - '"5c73fefd-76a1-4afe-b8f2-e00d23498865"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 805AF603EF6847B79842088A0B0B1A12 Ref B: MRS211050313019 Ref C: 2024-07-11T09:45:52Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection rule remove + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-collection-group-name --collection-name --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n },\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n + \ \"name\": \"application-rule-2\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [\r\n \"www.bing.com\"\r\n + \ ],\r\n \"targetUrls\": [],\r\n \"terminateTLS\": + false,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"5c73fefd-76a1-4afe-b8f2-e00d23498865\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '5378' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:52 GMT + etag: + - '"5c73fefd-76a1-4afe-b8f2-e00d23498865"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 481DDC170BB843D5A7A180F47B9929B0 Ref B: MRS211050313045 Ref C: 2024-07-11T09:45:53Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedAddress": "128.1.1.1", "translatedPort": + "1234"}]}, {"name": "filter-collection-1", "priority": 13000, "ruleCollectionType": + "FirewallPolicyFilterRuleCollection", "action": {"type": "Allow"}, "rules": + [{"description": "test", "name": "network-rule", "ruleType": "NetworkRule", + "destinationAddresses": ["202.120.36.15"], "destinationFqdns": [], "destinationIpGroups": + [], "destinationPorts": ["12003", "12004"], "ipProtocols": ["Any", "ICMP"], + "sourceAddresses": ["202.120.36.13", "202.120.36.14"], "sourceIpGroups": []}]}, + {"name": "filter-collection-2", "priority": 14000, "ruleCollectionType": "FirewallPolicyFilterRuleCollection", + "action": {"type": "Allow"}, "rules": [{"description": "test", "name": "application-rule", + "ruleType": "ApplicationRule", "destinationAddresses": ["202.120.36.15", "202.120.36.16"], + "fqdnTags": ["AzureBackup", "HDInsight"], "protocols": [{"port": 12800, "protocolType": + "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "targetFqdns": [], "targetUrls": ["www.google.com", + "www.bing.com"], "terminateTLS": true, "webCategories": []}, {"description": + "test", "name": "application-rule-2", "ruleType": "ApplicationRule", "destinationAddresses": + ["202.120.36.15", "202.120.36.16"], "fqdnTags": [], "protocols": [{"port": 12800, + "protocolType": "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": + ["202.120.36.13", "202.120.36.14"], "sourceIpGroups": [], "targetFqdns": ["www.bing.com"], + "targetUrls": [], "terminateTLS": false, "webCategories": []}]}, {"name": "nat-collection-2", + "priority": 1000, "ruleCollectionType": "FirewallPolicyNatRuleCollection", "action": + {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedFqdn": "www.google.com", + "translatedPort": "1234"}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection rule remove + Connection: + - keep-alive + Content-Length: + - '2793' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-collection-group-name --collection-name --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n },\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n + \ \"name\": \"application-rule-2\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [\r\n \"www.bing.com\"\r\n + \ ],\r\n \"targetUrls\": [],\r\n \"terminateTLS\": + false,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4949' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1189' + x-msedge-ref: + - 'Ref A: 37910DFFE4A1445D9F46E4625077CA9D Ref B: MRS211050313045 Ref C: 2024-07-11T09:45:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection remove + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --rule-collection-group-name --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NetworkRule\",\r\n \"ipv6Rule\": false,\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"ipProtocols\": + [\r\n \"Any\",\r\n \"ICMP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationIpGroups\": [],\r\n \"destinationFqdns\": + [],\r\n \"destinationPorts\": [\r\n \"12003\",\r\n + \ \"12004\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-1\",\r\n \"priority\": 13000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyFilterRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Allow\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n \"name\": + \"application-rule\",\r\n \"description\": \"test\",\r\n \"protocols\": + [\r\n {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [\r\n \"AzureBackup\",\r\n \"HDInsight\"\r\n + \ ],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [],\r\n \"targetUrls\": [\r\n \"www.google.com\",\r\n + \ \"www.bing.com\"\r\n ],\r\n \"terminateTLS\": + true,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n },\r\n {\r\n \"ruleType\": \"ApplicationRule\",\r\n + \ \"name\": \"application-rule-2\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [\r\n \"www.bing.com\"\r\n + \ ],\r\n \"targetUrls\": [],\r\n \"terminateTLS\": + false,\r\n \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\",\r\n \"202.120.36.16\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"httpHeadersToInsert\": + []\r\n }\r\n ],\r\n \"name\": \"filter-collection-2\",\r\n + \ \"priority\": 14000\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyNatRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Dnat\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"NatRule\",\r\n \"name\": \"network-rule\",\r\n \"description\": + \"test\",\r\n \"translatedFqdn\": \"www.google.com\",\r\n \"translatedPort\": + \"1234\",\r\n \"ipProtocols\": [\r\n \"TCP\",\r\n + \ \"UDP\"\r\n ],\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"sourceIpGroups\": [],\r\n \"destinationAddresses\": + [\r\n \"202.120.36.15\"\r\n ],\r\n \"destinationPorts\": + [\r\n \"12000\"\r\n ]\r\n }\r\n ],\r\n + \ \"name\": \"nat-collection-2\",\r\n \"priority\": 1000\r\n + \ }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"6a682079-3909-4994-a353-a290364471c3\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '5378' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:54 GMT + etag: + - '"6a682079-3909-4994-a353-a290364471c3"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 13457DFCD9FC4FDA8F86528E9F8BB12C Ref B: MRS211050315029 Ref C: 2024-07-11T09:45:55Z' + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default", + "name": "myclirulecollectiongroup", "properties": {"priority": 12000, "ruleCollections": + [{"name": "nat-collection", "priority": 10005, "ruleCollectionType": "FirewallPolicyNatRuleCollection", + "action": {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedAddress": "128.1.1.1", "translatedPort": + "1234"}]}, {"name": "filter-collection-2", "priority": 14000, "ruleCollectionType": + "FirewallPolicyFilterRuleCollection", "action": {"type": "Allow"}, "rules": + [{"description": "test", "name": "application-rule", "ruleType": "ApplicationRule", + "destinationAddresses": ["202.120.36.15", "202.120.36.16"], "fqdnTags": ["AzureBackup", + "HDInsight"], "protocols": [{"port": 12800, "protocolType": "Http"}, {"port": + 12801, "protocolType": "Https"}], "sourceAddresses": ["202.120.36.13", "202.120.36.14"], + "sourceIpGroups": [], "targetFqdns": [], "targetUrls": ["www.google.com", "www.bing.com"], + "terminateTLS": true, "webCategories": []}, {"description": "test", "name": + "application-rule-2", "ruleType": "ApplicationRule", "destinationAddresses": + ["202.120.36.15", "202.120.36.16"], "fqdnTags": [], "protocols": [{"port": 12800, + "protocolType": "Http"}, {"port": 12801, "protocolType": "Https"}], "sourceAddresses": + ["202.120.36.13", "202.120.36.14"], "sourceIpGroups": [], "targetFqdns": ["www.bing.com"], + "targetUrls": [], "terminateTLS": false, "webCategories": []}]}, {"name": "nat-collection-2", + "priority": 1000, "ruleCollectionType": "FirewallPolicyNatRuleCollection", "action": + {"type": "Dnat"}, "rules": [{"description": "test", "name": "network-rule", + "ruleType": "NatRule", "destinationAddresses": ["202.120.36.15"], "destinationPorts": + ["12000"], "ipProtocols": ["TCP", "UDP"], "sourceAddresses": ["202.120.36.13", + "202.120.36.14"], "sourceIpGroups": [], "translatedFqdn": "www.google.com", + "translatedPort": "1234"}]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft collection remove + Connection: + - keep-alive + Content-Length: + - '2322' + Content-Type: + - application/json + ParameterSetName: + - -g --policy-name --rule-collection-group-name --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"ApplicationRule\",\r\n \"name\": \"application-rule\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [\r\n + \ \"AzureBackup\",\r\n \"HDInsight\"\r\n ],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [],\r\n + \ \"targetUrls\": [\r\n \"www.google.com\",\r\n \"www.bing.com\"\r\n + \ ],\r\n \"terminateTLS\": true,\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\",\r\n + \ \"202.120.36.16\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"httpHeadersToInsert\": []\r\n },\r\n {\r\n + \ \"ruleType\": \"ApplicationRule\",\r\n \"name\": \"application-rule-2\",\r\n + \ \"description\": \"test\",\r\n \"protocols\": [\r\n + \ {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [\r\n \"www.bing.com\"\r\n ],\r\n \"targetUrls\": + [],\r\n \"terminateTLS\": false,\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\",\r\n + \ \"202.120.36.16\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"httpHeadersToInsert\": []\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-2\",\r\n \"priority\": 14000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedFqdn\": + \"www.google.com\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection-2\",\r\n + \ \"priority\": 1000\r\n }\r\n ]\r\n },\r\n \"etag\": \"00000000-0000-0000-0000-000000000000\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4033' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + x-msedge-ref: + - 'Ref A: C35DC99EBB8747409871287DA4B3B41D Ref B: MRS211050315029 Ref C: 2024-07-11T09:45:55Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group draft show + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default?api-version=2023-09-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"ApplicationRule\",\r\n \"name\": \"application-rule\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [\r\n + \ \"AzureBackup\",\r\n \"HDInsight\"\r\n ],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [],\r\n + \ \"targetUrls\": [\r\n \"www.google.com\",\r\n \"www.bing.com\"\r\n + \ ],\r\n \"terminateTLS\": true,\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\",\r\n + \ \"202.120.36.16\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"httpHeadersToInsert\": []\r\n },\r\n {\r\n + \ \"ruleType\": \"ApplicationRule\",\r\n \"name\": \"application-rule-2\",\r\n + \ \"description\": \"test\",\r\n \"protocols\": [\r\n + \ {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [\r\n \"www.bing.com\"\r\n ],\r\n \"targetUrls\": + [],\r\n \"terminateTLS\": false,\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\",\r\n + \ \"202.120.36.16\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"httpHeadersToInsert\": []\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-2\",\r\n \"priority\": 14000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedFqdn\": + \"www.google.com\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection-2\",\r\n + \ \"priority\": 1000\r\n }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup/ruleCollectionGroupDrafts/default\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts\",\r\n + \ \"etag\": \"6f75ca71-0a22-46db-b6f7-52b4ec7a6e34\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4462' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:56 GMT + etag: + - '"6f75ca71-0a22-46db-b6f7-52b4ec7a6e34"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 4D7E6A91FC6B464B8D06670E33169867 Ref B: MRS211050313031 Ref C: 2024-07-11T09:45:57Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/deploy?api-version=2023-09-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/dbc257da-bedd-42df-81a5-f0b88fcbf56a?api-version=2023-09-01&t=638562879586528282&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=GRExyO3pRAqeWAGqbhFW_BM2-gQZnNqQTrGfOQ7aj0OmAfqkvFkV8QoyWAMbJS1QGme3VolpLUHTm2DT7-YJy8aL6KhgGS1rs9KLjE_xninZQRLmTT7YZo1SlIPnnrcq-2zlFc4XHpihyRzfNwPpFIUTyjzUM_GqO6rw-IZTXD82reIpSS_AZ52Nb4gW-GD2-nd04QzDLSIaj1CBy3otCyazAlqvr-KUMkhl6zMd45pjU1PsGhS5SIcCjvBsxCYvBOSiRLMAgkg9UfR_U4vXiAJ9uTNu2mWoWOuRSQo_eV8BTs7FY2Cu245-5QpbNd8I9g40axx64ySsmBUggk9SqQ&h=XPM9O3On0sUOehZt5umbbH6oA_w1r94enuzpS0q_Tbw + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:57 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/dbc257da-bedd-42df-81a5-f0b88fcbf56a?api-version=2023-09-01&t=638562879586528282&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=GRExyO3pRAqeWAGqbhFW_BM2-gQZnNqQTrGfOQ7aj0OmAfqkvFkV8QoyWAMbJS1QGme3VolpLUHTm2DT7-YJy8aL6KhgGS1rs9KLjE_xninZQRLmTT7YZo1SlIPnnrcq-2zlFc4XHpihyRzfNwPpFIUTyjzUM_GqO6rw-IZTXD82reIpSS_AZ52Nb4gW-GD2-nd04QzDLSIaj1CBy3otCyazAlqvr-KUMkhl6zMd45pjU1PsGhS5SIcCjvBsxCYvBOSiRLMAgkg9UfR_U4vXiAJ9uTNu2mWoWOuRSQo_eV8BTs7FY2Cu245-5QpbNd8I9g40axx64ySsmBUggk9SqQ&h=XPM9O3On0sUOehZt5umbbH6oA_w1r94enuzpS0q_Tbw + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 92A5CBD8C4174052BE353FCF9E3CA965 Ref B: MRS211050618029 Ref C: 2024-07-11T09:45:57Z' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/dbc257da-bedd-42df-81a5-f0b88fcbf56a?api-version=2023-09-01&t=638562879586528282&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=GRExyO3pRAqeWAGqbhFW_BM2-gQZnNqQTrGfOQ7aj0OmAfqkvFkV8QoyWAMbJS1QGme3VolpLUHTm2DT7-YJy8aL6KhgGS1rs9KLjE_xninZQRLmTT7YZo1SlIPnnrcq-2zlFc4XHpihyRzfNwPpFIUTyjzUM_GqO6rw-IZTXD82reIpSS_AZ52Nb4gW-GD2-nd04QzDLSIaj1CBy3otCyazAlqvr-KUMkhl6zMd45pjU1PsGhS5SIcCjvBsxCYvBOSiRLMAgkg9UfR_U4vXiAJ9uTNu2mWoWOuRSQo_eV8BTs7FY2Cu245-5QpbNd8I9g40axx64ySsmBUggk9SqQ&h=XPM9O3On0sUOehZt5umbbH6oA_w1r94enuzpS0q_Tbw + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:45:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 677E0F720B42446CB93629D874CA4454 Ref B: MRS211050618029 Ref C: 2024-07-11T09:45:58Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/dbc257da-bedd-42df-81a5-f0b88fcbf56a?api-version=2023-09-01&t=638562879586528282&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=GRExyO3pRAqeWAGqbhFW_BM2-gQZnNqQTrGfOQ7aj0OmAfqkvFkV8QoyWAMbJS1QGme3VolpLUHTm2DT7-YJy8aL6KhgGS1rs9KLjE_xninZQRLmTT7YZo1SlIPnnrcq-2zlFc4XHpihyRzfNwPpFIUTyjzUM_GqO6rw-IZTXD82reIpSS_AZ52Nb4gW-GD2-nd04QzDLSIaj1CBy3otCyazAlqvr-KUMkhl6zMd45pjU1PsGhS5SIcCjvBsxCYvBOSiRLMAgkg9UfR_U4vXiAJ9uTNu2mWoWOuRSQo_eV8BTs7FY2Cu245-5QpbNd8I9g40axx64ySsmBUggk9SqQ&h=XPM9O3On0sUOehZt5umbbH6oA_w1r94enuzpS0q_Tbw + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:46:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 169CCAC3DD5441408876AAA3117F2036 Ref B: MRS211050618029 Ref C: 2024-07-11T09:46:08Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy deploy + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/switzerlandnorth/nfvOperations/dbc257da-bedd-42df-81a5-f0b88fcbf56a?api-version=2023-09-01&t=638562879586528282&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=GRExyO3pRAqeWAGqbhFW_BM2-gQZnNqQTrGfOQ7aj0OmAfqkvFkV8QoyWAMbJS1QGme3VolpLUHTm2DT7-YJy8aL6KhgGS1rs9KLjE_xninZQRLmTT7YZo1SlIPnnrcq-2zlFc4XHpihyRzfNwPpFIUTyjzUM_GqO6rw-IZTXD82reIpSS_AZ52Nb4gW-GD2-nd04QzDLSIaj1CBy3otCyazAlqvr-KUMkhl6zMd45pjU1PsGhS5SIcCjvBsxCYvBOSiRLMAgkg9UfR_U4vXiAJ9uTNu2mWoWOuRSQo_eV8BTs7FY2Cu245-5QpbNd8I9g40axx64ySsmBUggk9SqQ&h=XPM9O3On0sUOehZt5umbbH6oA_w1r94enuzpS0q_Tbw + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:46:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 200E0F5FA7BD4B5083890EA686E79A77 Ref B: MRS211050618029 Ref C: 2024-07-11T09:46:09Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy rule-collection-group show + Connection: + - keep-alive + ParameterSetName: + - -g --policy-name --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup?api-version=2022-01-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"priority\": 12000,\r\n \"ruleCollections\": + [\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedAddress\": + \"128.1.1.1\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection\",\r\n + \ \"priority\": 10005\r\n },\r\n {\r\n \"ruleCollectionType\": + \"FirewallPolicyFilterRuleCollection\",\r\n \"action\": {\r\n \"type\": + \"Allow\"\r\n },\r\n \"rules\": [\r\n {\r\n \"ruleType\": + \"ApplicationRule\",\r\n \"name\": \"application-rule\",\r\n \"description\": + \"test\",\r\n \"protocols\": [\r\n {\r\n \"protocolType\": + \"Http\",\r\n \"port\": 12800\r\n },\r\n {\r\n + \ \"protocolType\": \"Https\",\r\n \"port\": + 12801\r\n }\r\n ],\r\n \"fqdnTags\": [\r\n + \ \"AzureBackup\",\r\n \"HDInsight\"\r\n ],\r\n + \ \"webCategories\": [],\r\n \"targetFqdns\": [],\r\n + \ \"targetUrls\": [\r\n \"www.google.com\",\r\n \"www.bing.com\"\r\n + \ ],\r\n \"terminateTLS\": true,\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\",\r\n + \ \"202.120.36.16\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"httpHeadersToInsert\": []\r\n },\r\n {\r\n + \ \"ruleType\": \"ApplicationRule\",\r\n \"name\": \"application-rule-2\",\r\n + \ \"description\": \"test\",\r\n \"protocols\": [\r\n + \ {\r\n \"protocolType\": \"Http\",\r\n \"port\": + 12800\r\n },\r\n {\r\n \"protocolType\": + \"Https\",\r\n \"port\": 12801\r\n }\r\n ],\r\n + \ \"fqdnTags\": [],\r\n \"webCategories\": [],\r\n \"targetFqdns\": + [\r\n \"www.bing.com\"\r\n ],\r\n \"targetUrls\": + [],\r\n \"terminateTLS\": false,\r\n \"sourceAddresses\": + [\r\n \"202.120.36.13\",\r\n \"202.120.36.14\"\r\n + \ ],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\",\r\n + \ \"202.120.36.16\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"httpHeadersToInsert\": []\r\n }\r\n ],\r\n + \ \"name\": \"filter-collection-2\",\r\n \"priority\": 14000\r\n + \ },\r\n {\r\n \"ruleCollectionType\": \"FirewallPolicyNatRuleCollection\",\r\n + \ \"action\": {\r\n \"type\": \"Dnat\"\r\n },\r\n \"rules\": + [\r\n {\r\n \"ruleType\": \"NatRule\",\r\n \"name\": + \"network-rule\",\r\n \"description\": \"test\",\r\n \"translatedFqdn\": + \"www.google.com\",\r\n \"translatedPort\": \"1234\",\r\n \"ipProtocols\": + [\r\n \"TCP\",\r\n \"UDP\"\r\n ],\r\n + \ \"sourceAddresses\": [\r\n \"202.120.36.13\",\r\n + \ \"202.120.36.14\"\r\n ],\r\n \"sourceIpGroups\": + [],\r\n \"destinationAddresses\": [\r\n \"202.120.36.15\"\r\n + \ ],\r\n \"destinationPorts\": [\r\n \"12000\"\r\n + \ ]\r\n }\r\n ],\r\n \"name\": \"nat-collection-2\",\r\n + \ \"priority\": 1000\r\n }\r\n ],\r\n \"provisioningState\": + \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy/ruleCollectionGroups/myclirulecollectiongroup\",\r\n + \ \"name\": \"myclirulecollectiongroup\",\r\n \"type\": \"Microsoft.Network/FirewallPolicies/RuleCollectionGroups\",\r\n + \ \"etag\": \"42aa842c-2b44-4293-8489-29576365291b\",\r\n \"location\": \"SwitzerlandNorth\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4441' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Jul 2024 09:46:09 GMT + etag: + - '"42aa842c-2b44-4293-8489-29576365291b"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 9CDDF8F1E6FD4E1C9346500642C4CE43 Ref B: MRS211050619017 Ref C: 2024-07-11T09:46:10Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall policy delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_policy_draft000001/providers/Microsoft.Network/firewallPolicies/myclipolicy?api-version=2022-01-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 11 Jul 2024 09:46:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-msedge-ref: + - 'Ref A: 2A9E42E0A5D144E099869DCFF8E50AD1 Ref B: MRS211050313049 Ref C: 2024-07-11T09:46:10Z' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_firewall_basic_sku.yaml b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_firewall_basic_sku.yaml index 8f9eba6d23f..0ba762d16c6 100644 --- a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_firewall_basic_sku.yaml +++ b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_firewall_basic_sku.yaml @@ -13,31 +13,33 @@ interactions: ParameterSetName: - -n -g --sku --tier User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_firewall_basic_sku_000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-01-10T09:17:08Z","module":"azure-firewall"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-07-14T19:45:45Z","module":"azure-firewall","Created":"2024-07-14T19:45:48.3253050Z","CreationDate":"2024-07-14T19:45:48.3252988Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '405' + - '492' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:16 GMT + - Sun, 14 Jul 2024 19:45:55 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: B88406E552F5431D93FE86599814E3BE Ref B: MRS211050618037 Ref C: 2024-07-14T19:45:55Z' status: code: 200 message: OK @@ -55,31 +57,33 @@ interactions: ParameterSetName: - -n -g --address-prefixes --subnet-name --subnet-prefixes User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_firewall_basic_sku_000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-01-10T09:17:08Z","module":"azure-firewall"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-07-14T19:45:45Z","module":"azure-firewall","Created":"2024-07-14T19:45:48.3253050Z","CreationDate":"2024-07-14T19:45:48.3252988Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '405' + - '492' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:17 GMT + - Sun, 14 Jul 2024 19:45:56 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: B02C8D90DBF243D1A91714496BD0A82C Ref B: MRS211050313021 Ref C: 2024-07-14T19:45:57Z' status: code: 200 message: OK @@ -104,19 +108,19 @@ interactions: ParameterSetName: - -n -g --address-prefixes --subnet-name --subnet-prefixes User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003?api-version=2022-01-01 response: body: string: "{\r\n \"name\": \"vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003\",\r\n - \ \"etag\": \"W/\\\"9acae816-5440-460f-ae86-ef4831aa3f1d\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"2bd43819-145c-4899-81c7-01b0e8d18f9a\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": - \"c4a4ec27-5ff0-41a5-8247-89028f3aa3d4\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"9f5753b3-fb1a-4694-b78c-d995fb3a1c10\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n \ {\r\n \"name\": \"AzureFirewallSubnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallSubnet\",\r\n - \ \"etag\": \"W/\\\"9acae816-5440-460f-ae86-ef4831aa3f1d\\\"\",\r\n + \ \"etag\": \"W/\\\"2bd43819-145c-4899-81c7-01b0e8d18f9a\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": @@ -127,7 +131,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/03942ac5-38d1-4b67-8218-fd450d3098e3?api-version=2022-01-01&t=638404750402456343&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rW86JjMIkDfU-Yw2iTmo3QrM7oSOQGgI8cRKzB8PqTPtv-3NEiwnk0Um2aqONmDQS7lNVnhXNJPRPPplULaoxKlpSJOLlHYWt8TGDH8QIV1H7iWe4sTQtTvkymPvr1MrWut2xUgshT-YdgeNWnlDcHmmWqQMqHsACWEMAEIyTPN1iSRNdovUQsndY0NlCTw2DOz1yILqrJS5vnIvFF3TyCpOw0lYCVvivOVzqQnhJSehFvDfVBRAlcdPA2srewHu2fw6SM7Uv0u-zzVaOL1hf985GqawcksxzzxUVUdXb9UrW9hE-_0sPlVQwn8WQddSJwhTf6e8lQNmtKgFf7gnDA&h=vtLqD1MZhgTbUzHiQWd8iLJjDayAULwIfUTIuia0K_U + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/89e7aca3-3cd6-40cd-82c1-6a341284d04f?api-version=2022-01-01&t=638565831634026047&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=ITtJBlv1rgtJYlIPLsvwiChTRgxxVJVpxxfG5C4lubi3Do3pGhhYGmvSqUggBC6fMtR_8SE3KG1lqA0439_1NN8mIqrEwHV_WXUmMQJxn-Kme2j5AnPP36kSeGMOz1HEdxOU0eRWYJuGr82-P6ODMyWDbEsTViX9NAs0vzLEHXEdVyXLC2XNCh-sx_CWBbT6S7hV2IGP-X0UaEm5tQzIwJD0b2pGO0F__uMVV7s6AF8ild6ZmcDbjTIVFuKd7VQ1AoCi1ArbQT-KYHBNfWVRZ6Olk4EUZr42h2gBaIxrcrIoPueGslJqhTHeWDu9l49jOVqDdrTFVlDmyXocbw-_gA&h=tMD3s2qMQ7YtVDhQ-8QJ8vtOfdcsq0-3xv8ds8ePW4o cache-control: - no-cache content-length: @@ -135,22 +139,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:19 GMT + - Sun, 14 Jul 2024 19:46:03 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - df495391-40f0-45e0-a0cc-c5b91c85d66a + - bcc79ff2-6874-445a-8221-1242a0c486ae x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' + x-msedge-ref: + - 'Ref A: A30B94638A2F4CC0A633A24AE9658697 Ref B: MRS211050315037 Ref C: 2024-07-14T19:45:57Z' status: code: 201 message: Created @@ -168,58 +173,9 @@ interactions: ParameterSetName: - -n -g --address-prefixes --subnet-name --subnet-prefixes User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/03942ac5-38d1-4b67-8218-fd450d3098e3?api-version=2022-01-01&t=638404750402456343&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rW86JjMIkDfU-Yw2iTmo3QrM7oSOQGgI8cRKzB8PqTPtv-3NEiwnk0Um2aqONmDQS7lNVnhXNJPRPPplULaoxKlpSJOLlHYWt8TGDH8QIV1H7iWe4sTQtTvkymPvr1MrWut2xUgshT-YdgeNWnlDcHmmWqQMqHsACWEMAEIyTPN1iSRNdovUQsndY0NlCTw2DOz1yILqrJS5vnIvFF3TyCpOw0lYCVvivOVzqQnhJSehFvDfVBRAlcdPA2srewHu2fw6SM7Uv0u-zzVaOL1hf985GqawcksxzzxUVUdXb9UrW9hE-_0sPlVQwn8WQddSJwhTf6e8lQNmtKgFf7gnDA&h=vtLqD1MZhgTbUzHiQWd8iLJjDayAULwIfUTIuia0K_U - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 10 Jan 2024 09:17:19 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 4dbf8f73-a15f-47a8-bbbf-61db482f0e14 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network vnet create - Connection: - - keep-alive - ParameterSetName: - - -n -g --address-prefixes --subnet-name --subnet-prefixes - User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/03942ac5-38d1-4b67-8218-fd450d3098e3?api-version=2022-01-01&t=638404750402456343&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rW86JjMIkDfU-Yw2iTmo3QrM7oSOQGgI8cRKzB8PqTPtv-3NEiwnk0Um2aqONmDQS7lNVnhXNJPRPPplULaoxKlpSJOLlHYWt8TGDH8QIV1H7iWe4sTQtTvkymPvr1MrWut2xUgshT-YdgeNWnlDcHmmWqQMqHsACWEMAEIyTPN1iSRNdovUQsndY0NlCTw2DOz1yILqrJS5vnIvFF3TyCpOw0lYCVvivOVzqQnhJSehFvDfVBRAlcdPA2srewHu2fw6SM7Uv0u-zzVaOL1hf985GqawcksxzzxUVUdXb9UrW9hE-_0sPlVQwn8WQddSJwhTf6e8lQNmtKgFf7gnDA&h=vtLqD1MZhgTbUzHiQWd8iLJjDayAULwIfUTIuia0K_U + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/89e7aca3-3cd6-40cd-82c1-6a341284d04f?api-version=2022-01-01&t=638565831634026047&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=ITtJBlv1rgtJYlIPLsvwiChTRgxxVJVpxxfG5C4lubi3Do3pGhhYGmvSqUggBC6fMtR_8SE3KG1lqA0439_1NN8mIqrEwHV_WXUmMQJxn-Kme2j5AnPP36kSeGMOz1HEdxOU0eRWYJuGr82-P6ODMyWDbEsTViX9NAs0vzLEHXEdVyXLC2XNCh-sx_CWBbT6S7hV2IGP-X0UaEm5tQzIwJD0b2pGO0F__uMVV7s6AF8ild6ZmcDbjTIVFuKd7VQ1AoCi1ArbQT-KYHBNfWVRZ6Olk4EUZr42h2gBaIxrcrIoPueGslJqhTHeWDu9l49jOVqDdrTFVlDmyXocbw-_gA&h=tMD3s2qMQ7YtVDhQ-8QJ8vtOfdcsq0-3xv8ds8ePW4o response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -231,24 +187,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:30 GMT + - Sun, 14 Jul 2024 19:46:04 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 1b13b38c-dd8d-4594-b647-ffb912098d8c + - 17238694-6f49-4028-bb94-573083d833dc + x-msedge-ref: + - 'Ref A: B20E941E5F3C48AF87E383212511C727 Ref B: MRS211050315037 Ref C: 2024-07-14T19:46:03Z' status: code: 200 message: OK @@ -266,19 +219,19 @@ interactions: ParameterSetName: - -n -g --address-prefixes --subnet-name --subnet-prefixes User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003?api-version=2022-01-01 response: body: string: "{\r\n \"name\": \"vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003\",\r\n - \ \"etag\": \"W/\\\"0b9c26e8-bd45-4cae-a1e7-842c5dd56c8e\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"0fb08202-2543-4112-9884-50d242824b8d\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": - \"c4a4ec27-5ff0-41a5-8247-89028f3aa3d4\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"9f5753b3-fb1a-4694-b78c-d995fb3a1c10\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n \ {\r\n \"name\": \"AzureFirewallSubnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallSubnet\",\r\n - \ \"etag\": \"W/\\\"0b9c26e8-bd45-4cae-a1e7-842c5dd56c8e\\\"\",\r\n + \ \"etag\": \"W/\\\"0fb08202-2543-4112-9884-50d242824b8d\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": @@ -293,26 +246,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:31 GMT + - Sun, 14 Jul 2024 19:46:05 GMT etag: - - W/"0b9c26e8-bd45-4cae-a1e7-842c5dd56c8e" + - W/"0fb08202-2543-4112-9884-50d242824b8d" expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 4135f405-8889-493a-aad9-494e8246cb56 + - a2f25c90-1cf2-41dc-b148-fa3cac280da0 + x-msedge-ref: + - 'Ref A: 09B8EDBF321F4873B4644BB039B07A30 Ref B: MRS211050315037 Ref C: 2024-07-14T19:46:04Z' status: code: 200 message: OK @@ -336,40 +286,46 @@ interactions: ParameterSetName: - -n -g --vnet-name --address-prefixes User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet?api-version=2023-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet?api-version=2024-01-01 response: body: - string: '{"name":"AzureFirewallManagementSubnet","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet","etag":"W/\"b61ec515-17aa-47c8-98c3-f7bc547e007d\"","properties":{"provisioningState":"Updating","addressPrefix":"10.0.1.0/24","delegations":[],"privateEndpointNetworkPolicies":"Disabled","privateLinkServiceNetworkPolicies":"Enabled"},"type":"Microsoft.Network/virtualNetworks/subnets"}' + string: "{\r\n \"name\": \"AzureFirewallManagementSubnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet\",\r\n + \ \"etag\": \"W/\\\"cc3226fb-99fb-4bac-849f-5eeb925fb1dd\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n + \ \"ipamPoolPrefixAllocations\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": + \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n + \ },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/2f66a6f8-b063-41f1-984b-f3e497b373c5?api-version=2023-09-01&t=638404750526309068&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=wSbK_GYNmsunlYeA0LRE6Q3uAOHd40jbaXJYMPr7___7wYzi2wKI5_6EWrRzuwDQJ2tr6Sty9xLbl6hN8iHbf1hNu3YGxMHEZbE100BzHqY_-mAYK2JUqjGdnsNv4gCDJkjzSSzsPp_NqVI2CkLXGZZvyshdpmJH-PUGgyyqbb6zWqSUymTQwXmOEKM3YeLYcsHVrexz77atsdICnnY2H8m0aiuc4MCEbaUqBEag44pKo3wZgTHOnBHbJ8-EAaYnT0PVN1UuiVBfcJM-vNOwkwYP7Z-d4bG2r__Cqco7u2Xbckbqb-36zS3n2cm3fDHgo8TOtppuxjsdf2cGbXBpsw&h=EB5aU1W0LzmfJp2z7OVU-Lo3Y48COVCiQIRNtGtiG5g + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/257aba32-f0b5-4a17-8ad5-c5e98097dff9?api-version=2024-01-01&t=638565831690628411&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=c6J3tmWNc0m2eBC59vDPTxb7UTMpMBRkGgT_sgHZU7s6FGQHyzOR0Wdj5SSsxApoYkXz7CQtYLdV08SccaJj12SymZMO1rkuc0sj9CvplE5Fd4lu_QD2lyh2WMRO2xiAUl4TqFgs_WNGMax8a_0Sn5YqNqyk6b8o4vwFjZykt6Su2smV2E97umqJXTb_hecvFm0HOfv4s3XYApelJKbzRLlocnXjeQVM5WV7kXxgWDMu4VQSXp5KPvgOwCfQ7iwkcJR6t4pwz7-sI4ciXfQgLNKfZGx-dD82riA4eOWTuUvNkKv8RaNN6aJwIrO4H56VEVNeIhnAlg3s9Q4iPMus0Q&h=GyCZiHhQg-R4OZPgcpGrT3z7Awtq5AUY5jbJYT_vnnw cache-control: - no-cache content-length: - - '529' + - '633' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:32 GMT + - Sun, 14 Jul 2024 19:46:09 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2310c549-175e-4d65-9af2-1cc36d25688a + - eb3a1de7-072d-49ea-8bec-69e2323d53fd x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' + x-msedge-ref: + - 'Ref A: ADC1CEFC09F840C48B5E2B2AB98CBC07 Ref B: MRS211050619017 Ref C: 2024-07-14T19:46:07Z' status: code: 201 message: Created @@ -387,38 +343,35 @@ interactions: ParameterSetName: - -n -g --vnet-name --address-prefixes User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/2f66a6f8-b063-41f1-984b-f3e497b373c5?api-version=2023-09-01&t=638404750526309068&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=wSbK_GYNmsunlYeA0LRE6Q3uAOHd40jbaXJYMPr7___7wYzi2wKI5_6EWrRzuwDQJ2tr6Sty9xLbl6hN8iHbf1hNu3YGxMHEZbE100BzHqY_-mAYK2JUqjGdnsNv4gCDJkjzSSzsPp_NqVI2CkLXGZZvyshdpmJH-PUGgyyqbb6zWqSUymTQwXmOEKM3YeLYcsHVrexz77atsdICnnY2H8m0aiuc4MCEbaUqBEag44pKo3wZgTHOnBHbJ8-EAaYnT0PVN1UuiVBfcJM-vNOwkwYP7Z-d4bG2r__Cqco7u2Xbckbqb-36zS3n2cm3fDHgo8TOtppuxjsdf2cGbXBpsw&h=EB5aU1W0LzmfJp2z7OVU-Lo3Y48COVCiQIRNtGtiG5g + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/257aba32-f0b5-4a17-8ad5-c5e98097dff9?api-version=2024-01-01&t=638565831690628411&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=c6J3tmWNc0m2eBC59vDPTxb7UTMpMBRkGgT_sgHZU7s6FGQHyzOR0Wdj5SSsxApoYkXz7CQtYLdV08SccaJj12SymZMO1rkuc0sj9CvplE5Fd4lu_QD2lyh2WMRO2xiAUl4TqFgs_WNGMax8a_0Sn5YqNqyk6b8o4vwFjZykt6Su2smV2E97umqJXTb_hecvFm0HOfv4s3XYApelJKbzRLlocnXjeQVM5WV7kXxgWDMu4VQSXp5KPvgOwCfQ7iwkcJR6t4pwz7-sI4ciXfQgLNKfZGx-dD82riA4eOWTuUvNkKv8RaNN6aJwIrO4H56VEVNeIhnAlg3s9Q4iPMus0Q&h=GyCZiHhQg-R4OZPgcpGrT3z7Awtq5AUY5jbJYT_vnnw response: body: - string: '{"status":"Succeeded"}' + string: "{\r\n \"status\": \"Succeeded\"\r\n}" headers: cache-control: - no-cache content-length: - - '22' + - '29' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:32 GMT + - Sun, 14 Jul 2024 19:46:10 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fb5735f1-a9aa-47ff-bb47-9105a1801e4c + - b545abed-d16d-4787-aa86-f52d49b11920 + x-msedge-ref: + - 'Ref A: 65C64622DEDC4C1C969F5EFCCCD8CBD4 Ref B: MRS211050619017 Ref C: 2024-07-14T19:46:09Z' status: code: 200 message: OK @@ -436,40 +389,42 @@ interactions: ParameterSetName: - -n -g --vnet-name --address-prefixes User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet?api-version=2023-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet?api-version=2024-01-01 response: body: - string: '{"name":"AzureFirewallManagementSubnet","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet","etag":"W/\"6be1ab73-ca64-41ed-94f2-f4f776cc6dee\"","properties":{"provisioningState":"Succeeded","addressPrefix":"10.0.1.0/24","delegations":[],"privateEndpointNetworkPolicies":"Disabled","privateLinkServiceNetworkPolicies":"Enabled"},"type":"Microsoft.Network/virtualNetworks/subnets"}' + string: "{\r\n \"name\": \"AzureFirewallManagementSubnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet\",\r\n + \ \"etag\": \"W/\\\"873c1e72-159a-4fbe-b126-1542a58ec5cc\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n + \ \"ipamPoolPrefixAllocations\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": + \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n + \ },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: cache-control: - no-cache content-length: - - '530' + - '634' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:32 GMT + - Sun, 14 Jul 2024 19:46:11 GMT etag: - - W/"6be1ab73-ca64-41ed-94f2-f4f776cc6dee" + - W/"873c1e72-159a-4fbe-b126-1542a58ec5cc" expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 7057f0bf-ac51-4ba3-9e7a-4e4334422cb6 + - c84fc99a-4a64-4c77-a8de-45793bd7cc8b + x-msedge-ref: + - 'Ref A: A7AFB07DA4A942A689C07BC25C5D55C9 Ref B: MRS211050619017 Ref C: 2024-07-14T19:46:10Z' status: code: 200 message: OK @@ -487,31 +442,33 @@ interactions: ParameterSetName: - -n -g --sku User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_firewall_basic_sku_000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-01-10T09:17:08Z","module":"azure-firewall"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-07-14T19:45:45Z","module":"azure-firewall","Created":"2024-07-14T19:45:48.3253050Z","CreationDate":"2024-07-14T19:45:48.3252988Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '405' + - '492' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:34 GMT + - Sun, 14 Jul 2024 19:46:12 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: C9700F66338E4714A2F49CDE60CE7314 Ref B: MRS211050313019 Ref C: 2024-07-14T19:46:11Z' status: code: 200 message: OK @@ -534,40 +491,49 @@ interactions: ParameterSetName: - -n -g --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006?api-version=2022-11-01 response: body: - string: '{"name":"public-ip-000006","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006","etag":"W/\"c4eaa506-fb1c-4159-a873-44f4b1b49634\"","location":"westus","properties":{"provisioningState":"Updating","resourceGuid":"2e2a61e7-1e8b-4059-b057-101443cd92b4","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}' + string: "{\r\n \"name\": \"public-ip-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006\",\r\n + \ \"etag\": \"W/\\\"af1afd3a-032f-4a97-81a6-fc88720e8f5c\\\"\",\r\n \"location\": + \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"68aadd28-4337-4b34-837b-854094e41846\",\r\n \"publicIPAddressVersion\": + \"IPv4\",\r\n \"publicIPAllocationMethod\": \"Static\",\r\n \"idleTimeoutInMinutes\": + 4,\r\n \"ipTags\": [],\r\n \"ddosSettings\": {\r\n \"protectionMode\": + \"VirtualNetworkInherited\"\r\n }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": \"Regional\"\r\n + \ }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/f4e6342b-e442-4a85-9b2e-a705a4a551d8?api-version=2022-11-01&t=638404750566636575&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=Kj9Sag8Jqpid8O5PyOswPqK1_wEBcjefESRaQgQZJ9eM1Z9BJZXvmuJhRXFR6bZQz6DjeY5627zPu3mGnCiCO_mvYop6OWokB_IlqeUHx0fvVN_FATIPTHMR5n54oS3D48QReLmRVicAfCWrtrUMdM5oG635gLqc8oFJ0pmaGfy2BMrSFobBJkrrGNh9AIddlU6cPT5tiwvV1t4Ug2mwDLCykjP8GStvhuz_fFATSAE2nvw1Ox6Gvt9KQlXTbQ7Erk71KgJXhklagLFfAAzzz98IXgteb6jgzpzquc3BxQJYMjOVgy3HelXKTWFwRmjfmdpWKZuTPQXnzrj1c76Y5w&h=ELKF0xwmuXFMmlYluQcSx1cteQZ8aUtQO2M4xmP5P8Q + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/eb66da2c-bf49-4e1e-a535-b5c4a5d15572?api-version=2022-11-01&t=638565831743401412&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=kmCzlekUGuHAWRxJXriwsGr7RMKJM5rQG_QZvI-bJb6khNCi0lOuHHJsbcWge0Pyszu_afd-D3Omd3fXW7ZL-8uAHpVzAsN3d-lKDKRs5_hSK0erl8zobWWR0jbN9wlIecxx9y__9lSFmgNFRyBqubk0n3mSLKkWZfNav1zLTtRhE9duna8f1S2BSkdKhgnpRq3I-vOvwI2mfktAuvJtjXlaK51FfxBsHf1LBPhVc66eejKWgUXcP_dVy88Xprw5hqCqvvPMYKYu76fRbDn9yhVzQLLrtrTIoMVWmeu264aFuSOJDmcGAiTz_XE0iJ2CoHqzIxT3ChwKgTZJM_7T-A&h=KBrfr5dM32zbsiwkuam67TBusg73xvFBN9TDXxu0FyA cache-control: - no-cache content-length: - - '625' + - '748' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:36 GMT + - Sun, 14 Jul 2024 19:46:14 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 47321462-c3f5-4754-af08-61f984dca62f + - 81d0f8e6-4825-4b75-b81e-15041c73490e x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' + x-msedge-ref: + - 'Ref A: 0F2C9AA00A414799B6C26CDDBEF4769A Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:12Z' status: code: 201 message: Created @@ -585,38 +551,35 @@ interactions: ParameterSetName: - -n -g --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/f4e6342b-e442-4a85-9b2e-a705a4a551d8?api-version=2022-11-01&t=638404750566636575&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=Kj9Sag8Jqpid8O5PyOswPqK1_wEBcjefESRaQgQZJ9eM1Z9BJZXvmuJhRXFR6bZQz6DjeY5627zPu3mGnCiCO_mvYop6OWokB_IlqeUHx0fvVN_FATIPTHMR5n54oS3D48QReLmRVicAfCWrtrUMdM5oG635gLqc8oFJ0pmaGfy2BMrSFobBJkrrGNh9AIddlU6cPT5tiwvV1t4Ug2mwDLCykjP8GStvhuz_fFATSAE2nvw1Ox6Gvt9KQlXTbQ7Erk71KgJXhklagLFfAAzzz98IXgteb6jgzpzquc3BxQJYMjOVgy3HelXKTWFwRmjfmdpWKZuTPQXnzrj1c76Y5w&h=ELKF0xwmuXFMmlYluQcSx1cteQZ8aUtQO2M4xmP5P8Q + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/eb66da2c-bf49-4e1e-a535-b5c4a5d15572?api-version=2022-11-01&t=638565831743401412&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=kmCzlekUGuHAWRxJXriwsGr7RMKJM5rQG_QZvI-bJb6khNCi0lOuHHJsbcWge0Pyszu_afd-D3Omd3fXW7ZL-8uAHpVzAsN3d-lKDKRs5_hSK0erl8zobWWR0jbN9wlIecxx9y__9lSFmgNFRyBqubk0n3mSLKkWZfNav1zLTtRhE9duna8f1S2BSkdKhgnpRq3I-vOvwI2mfktAuvJtjXlaK51FfxBsHf1LBPhVc66eejKWgUXcP_dVy88Xprw5hqCqvvPMYKYu76fRbDn9yhVzQLLrtrTIoMVWmeu264aFuSOJDmcGAiTz_XE0iJ2CoHqzIxT3ChwKgTZJM_7T-A&h=KBrfr5dM32zbsiwkuam67TBusg73xvFBN9TDXxu0FyA response: body: - string: '{"status":"InProgress"}' + string: "{\r\n \"status\": \"InProgress\"\r\n}" headers: cache-control: - no-cache content-length: - - '23' + - '30' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:36 GMT + - Sun, 14 Jul 2024 19:46:14 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9f9641a7-2f97-4b63-851a-5f161a6b752e + - 7841a932-3fcb-4fea-a648-1cf7bc1687e7 + x-msedge-ref: + - 'Ref A: C2E70A6099AD47FEAC72A284DBA3C65F Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:14Z' status: code: 200 message: OK @@ -634,38 +597,35 @@ interactions: ParameterSetName: - -n -g --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/f4e6342b-e442-4a85-9b2e-a705a4a551d8?api-version=2022-11-01&t=638404750566636575&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=Kj9Sag8Jqpid8O5PyOswPqK1_wEBcjefESRaQgQZJ9eM1Z9BJZXvmuJhRXFR6bZQz6DjeY5627zPu3mGnCiCO_mvYop6OWokB_IlqeUHx0fvVN_FATIPTHMR5n54oS3D48QReLmRVicAfCWrtrUMdM5oG635gLqc8oFJ0pmaGfy2BMrSFobBJkrrGNh9AIddlU6cPT5tiwvV1t4Ug2mwDLCykjP8GStvhuz_fFATSAE2nvw1Ox6Gvt9KQlXTbQ7Erk71KgJXhklagLFfAAzzz98IXgteb6jgzpzquc3BxQJYMjOVgy3HelXKTWFwRmjfmdpWKZuTPQXnzrj1c76Y5w&h=ELKF0xwmuXFMmlYluQcSx1cteQZ8aUtQO2M4xmP5P8Q + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/eb66da2c-bf49-4e1e-a535-b5c4a5d15572?api-version=2022-11-01&t=638565831743401412&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=kmCzlekUGuHAWRxJXriwsGr7RMKJM5rQG_QZvI-bJb6khNCi0lOuHHJsbcWge0Pyszu_afd-D3Omd3fXW7ZL-8uAHpVzAsN3d-lKDKRs5_hSK0erl8zobWWR0jbN9wlIecxx9y__9lSFmgNFRyBqubk0n3mSLKkWZfNav1zLTtRhE9duna8f1S2BSkdKhgnpRq3I-vOvwI2mfktAuvJtjXlaK51FfxBsHf1LBPhVc66eejKWgUXcP_dVy88Xprw5hqCqvvPMYKYu76fRbDn9yhVzQLLrtrTIoMVWmeu264aFuSOJDmcGAiTz_XE0iJ2CoHqzIxT3ChwKgTZJM_7T-A&h=KBrfr5dM32zbsiwkuam67TBusg73xvFBN9TDXxu0FyA response: body: - string: '{"status":"Succeeded"}' + string: "{\r\n \"status\": \"Succeeded\"\r\n}" headers: cache-control: - no-cache content-length: - - '22' + - '29' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:39 GMT + - Sun, 14 Jul 2024 19:46:18 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 18d1de34-9748-48ca-b3cb-5ff7a2aac66b + - 4e5fcd83-5401-4919-ad33-a258b5c18b8c + x-msedge-ref: + - 'Ref A: 1545E160E5F04937AE516935E79A1C1B Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:16Z' status: code: 200 message: OK @@ -683,40 +643,46 @@ interactions: ParameterSetName: - -n -g --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006?api-version=2022-11-01 response: body: - string: '{"name":"public-ip-000006","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006","etag":"W/\"14b8a057-7713-4749-b9b3-ab8f58511398\"","location":"westus","properties":{"provisioningState":"Succeeded","resourceGuid":"2e2a61e7-1e8b-4059-b057-101443cd92b4","ipAddress":"40.85.154.136","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}' + string: "{\r\n \"name\": \"public-ip-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006\",\r\n + \ \"etag\": \"W/\\\"76747a2e-0771-43b7-ab5b-3d11d60c0532\\\"\",\r\n \"location\": + \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"68aadd28-4337-4b34-837b-854094e41846\",\r\n \"ipAddress\": + \"13.88.41.175\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n \"publicIPAllocationMethod\": + \"Static\",\r\n \"idleTimeoutInMinutes\": 4,\r\n \"ipTags\": [],\r\n + \ \"ddosSettings\": {\r\n \"protectionMode\": \"VirtualNetworkInherited\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": \"Regional\"\r\n + \ }\r\n}" headers: cache-control: - no-cache content-length: - - '654' + - '783' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:39 GMT + - Sun, 14 Jul 2024 19:46:18 GMT etag: - - W/"14b8a057-7713-4749-b9b3-ab8f58511398" + - W/"76747a2e-0771-43b7-ab5b-3d11d60c0532" expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 69f89db3-9029-421b-9eba-374f19704d34 + - 7f6ca605-b9cb-490e-a697-3a43ce653644 + x-msedge-ref: + - 'Ref A: 816510DAD95049EEA699161AF43EC9BC Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:18Z' status: code: 200 message: OK @@ -734,31 +700,33 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_firewall_basic_sku_000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-01-10T09:17:08Z","module":"azure-firewall"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-07-14T19:45:45Z","module":"azure-firewall","Created":"2024-07-14T19:45:48.3253050Z","CreationDate":"2024-07-14T19:45:48.3252988Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '405' + - '492' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:40 GMT + - Sun, 14 Jul 2024 19:46:18 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: F412003E1F5B436A84DE4BEF008F88EF Ref B: MRS211050313009 Ref C: 2024-07-14T19:46:19Z' status: code: 200 message: OK @@ -785,26 +753,26 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002?api-version=2022-01-01 response: body: string: "{\r\n \"name\": \"firewall-000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002\",\r\n - \ \"etag\": \"W/\\\"74701f51-7118-4b3a-b9fb-a148c8872004\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"0684f9aa-8b75-4bfa-9d80-960daa0f174a\\\"\",\r\n \"type\": \"Microsoft.Network/azureFirewalls\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"sku\": {\r\n \"name\": \"AZFW_VNet\",\r\n \"tier\": \"Basic\"\r\n },\r\n \"threatIntelMode\": \"Alert\",\r\n \"additionalProperties\": {},\r\n \"managementIpConfiguration\": {\r\n \"name\": \"ipconfig-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002/azureFirewallIpConfigurations/ipconfig-000005\",\r\n - \ \"etag\": \"W/\\\"74701f51-7118-4b3a-b9fb-a148c8872004\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"0684f9aa-8b75-4bfa-9d80-960daa0f174a\\\"\",\r\n \"type\": \"Microsoft.Network/azureFirewalls/azureFirewallIpConfigurations\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006\"\r\n \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet\"\r\n \ }\r\n }\r\n },\r\n \"ipConfigurations\": [\r\n {\r\n \ \"name\": \"ipconfig-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002/azureFirewallIpConfigurations/ipconfig-000004\",\r\n - \ \"etag\": \"W/\\\"74701f51-7118-4b3a-b9fb-a148c8872004\\\"\",\r\n + \ \"etag\": \"W/\\\"0684f9aa-8b75-4bfa-9d80-960daa0f174a\\\"\",\r\n \ \"type\": \"Microsoft.Network/azureFirewalls/azureFirewallIpConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"subnet\": @@ -816,7 +784,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg cache-control: - no-cache content-length: @@ -824,22 +792,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:42 GMT + - Sun, 14 Jul 2024 19:46:25 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3c5c02a9-1ea9-4074-bc62-f01d035e2782 + - d5424abb-fba5-43ef-be1e-061403931d16 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' + x-msedge-ref: + - 'Ref A: B423DB67BE534BD49AEEF6722B77ACF3 Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:19Z' status: code: 201 message: Created @@ -857,9 +826,9 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -871,24 +840,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:42 GMT + - Sun, 14 Jul 2024 19:46:25 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e6d3729a-5bed-47ba-8277-a2127564e59e + - ea383632-cc6d-48c1-bade-5c18e4a86e26 + x-msedge-ref: + - 'Ref A: 11E46AEB74DE4121AE6EB7C9F8844811 Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:25Z' status: code: 200 message: OK @@ -906,9 +872,9 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -920,24 +886,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:17:54 GMT + - Sun, 14 Jul 2024 19:46:36 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b6bf78e3-67ce-47bf-a1a2-398bb04e7a19 + - 06b90271-fb54-4a4c-82b1-92547e09350e + x-msedge-ref: + - 'Ref A: 1C6A89C424334E0F8CC28D8A1154C6F5 Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:36Z' status: code: 200 message: OK @@ -955,9 +918,9 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -969,24 +932,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:18:14 GMT + - Sun, 14 Jul 2024 19:46:58 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ba2a056b-0d82-4800-b9fd-617d34a5c011 + - 53e92839-a8be-43b6-8d7c-af20addee327 + x-msedge-ref: + - 'Ref A: A360F38AC6ED4C35A842684A05C5DA84 Ref B: MRS211050619045 Ref C: 2024-07-14T19:46:57Z' status: code: 200 message: OK @@ -1004,9 +964,9 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -1018,24 +978,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:18:34 GMT + - Sun, 14 Jul 2024 19:47:20 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - c5650aeb-6460-49ef-b4e4-fd2fdde345b9 + - acd1eef5-b4ba-42ba-96aa-c73c72f4e3ba + x-msedge-ref: + - 'Ref A: 4A4C99BC33384F9DB7E8F16953B174FA Ref B: MRS211050619045 Ref C: 2024-07-14T19:47:18Z' status: code: 200 message: OK @@ -1053,9 +1010,9 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -1067,24 +1024,113 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:19:15 GMT + - Sun, 14 Jul 2024 19:48:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - fed7b576-4a3e-43cf-839c-c17015d0721c + x-msedge-ref: + - 'Ref A: 93DC68121116415C9447F109D2416A0D Ref B: MRS211050619045 Ref C: 2024-07-14T19:48:00Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall create + Connection: + - keep-alive + ParameterSetName: + - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 19:48:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 8c6a334e-ce0f-4237-b15b-ae16569125c8 + x-msedge-ref: + - 'Ref A: 37294570A2F746A2B06B545065AAAE74 Ref B: MRS211050619045 Ref C: 2024-07-14T19:48:42Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall create + Connection: + - keep-alive + ParameterSetName: + - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 19:50:02 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 36ed5159-3fdd-48c9-97ee-a1e9db732452 + - ec41ac3e-fbf7-4b08-a40d-b2807ad9762d + x-msedge-ref: + - 'Ref A: F2EF7BCBA8214AE4943E5907B69B8987 Ref B: MRS211050315021 Ref C: 2024-07-14T19:50:03Z' status: code: 200 message: OK @@ -1102,9 +1148,9 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ced11676-c765-4383-a2d4-16bfdb9c5a29?api-version=2022-01-01&t=638404750634484038&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=UqLm-h88k79NVsl9lnHoTn1yU6NVNqfRs_0QBEypMs2ttg4Tp6XxHlUMdc9nQGnHpgXTz3bj4EmB1KYilljekKtJGhlJUye2IhNxd9Nq5KTaGwQgBdwZDqAVNWIE2sKKRxYJnSWg3kh5zZypiS8Kd9jT_zjskbi6SSPE9S6gGWgccBMkaOKFG2OYIn8W3Qp0qug1OKhiyHgh6NE0ngVaYMoHBdysg4g-3N_ucO6BPg2p6lnpEqECXLTQhN0g9eZwFqo5xQyt5X8O3s7ZKx5ygKBEJViAmMG1Hs7ZwPk7hRm1NAOYpwFxLKLgkvc4hkutMkDn9ySEjEcx4wvRhiGcdQ&h=lIu1hNwQZAY95__y2WISmOpMx1Ac4qAUag9SpVCL_Bo + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/857fd3ff-f482-4248-a056-57bdfe3f93a8?api-version=2022-01-01&t=638565831856408474&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=QkkoQ4e4BP_9XFUSgJaNG_fH-eIqOvRO-eroxW8umh2cWAdCr5PUNUJaZI0h7xfI3e1rJ-L-IUV-2rMxnZaz6WrNGQKxhEgSH2yocsv0tMIo4daY9FqM3kZ3dIz6C20Lz1Oie2roddHNmUWdjKyZI2rVe1Ha3_M3PP-RNq8yB5ZvZ2Z-J1XkEdIGuiePOQ6tXaFYsQFYcsofS8m8FiO0r7EstDvc6uJSJVPqHW0M8VcelhSyjRkiFdE70_KWnuiF21uAFRc07jJHMy_wA2eo5EUquaXUTJ8TPfpKj7ZwQOHHRjXO6o1OGfz0NcwQfUFUPipHXviA6HmmDCEQUdcUDQ&h=tW_rvkczZnKrdBGxQxFEMXkorYuUasu_RbRd6NF84xg response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -1116,24 +1162,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:19:56 GMT + - Sun, 14 Jul 2024 19:52:44 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - bdc2c002-5fa4-401b-88ca-5d1234a3d171 + - b52cfa28-50be-4142-a920-9299052e6ce6 + x-msedge-ref: + - 'Ref A: E663F34D73124F16AAC7D10D2BF1F3C7 Ref B: MRS211050315033 Ref C: 2024-07-14T19:52:43Z' status: code: 200 message: OK @@ -1151,26 +1194,26 @@ interactions: ParameterSetName: - -n -g --sku --tier --vnet-name --conf-name --m-conf-name --m-public-ip User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002?api-version=2022-01-01 response: body: string: "{\r\n \"name\": \"firewall-000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002\",\r\n - \ \"etag\": \"W/\\\"d8208675-c88e-4961-94dc-a8415e06acff\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"9d4cd6b6-f09d-451f-b83c-133373383201\\\"\",\r\n \"type\": \"Microsoft.Network/azureFirewalls\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"AZFW_VNet\",\r\n \"tier\": \"Basic\"\r\n },\r\n \"threatIntelMode\": \"Alert\",\r\n \"additionalProperties\": {},\r\n \"managementIpConfiguration\": {\r\n \"name\": \"ipconfig-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002/azureFirewallIpConfigurations/ipconfig-000005\",\r\n - \ \"etag\": \"W/\\\"d8208675-c88e-4961-94dc-a8415e06acff\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"9d4cd6b6-f09d-451f-b83c-133373383201\\\"\",\r\n \"type\": \"Microsoft.Network/azureFirewalls/azureFirewallIpConfigurations\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/publicIPAddresses/public-ip-000006\"\r\n \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualNetworks/vnet-000003/subnets/AzureFirewallManagementSubnet\"\r\n \ }\r\n }\r\n },\r\n \"ipConfigurations\": [\r\n {\r\n \ \"name\": \"ipconfig-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002/azureFirewallIpConfigurations/ipconfig-000004\",\r\n - \ \"etag\": \"W/\\\"d8208675-c88e-4961-94dc-a8415e06acff\\\"\",\r\n + \ \"etag\": \"W/\\\"9d4cd6b6-f09d-451f-b83c-133373383201\\\"\",\r\n \ \"type\": \"Microsoft.Network/azureFirewalls/azureFirewallIpConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -1186,26 +1229,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:19:56 GMT + - Sun, 14 Jul 2024 19:52:44 GMT etag: - - W/"d8208675-c88e-4961-94dc-a8415e06acff" + - W/"9d4cd6b6-f09d-451f-b83c-133373383201" expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - bdd46285-8b73-4171-95ae-57b45246917e + - 704642b1-ad42-40d4-a744-32502b304ff0 + x-msedge-ref: + - 'Ref A: EF4D4BAB7AFC45738BC4DDDE98FAEF7E Ref B: MRS211050315033 Ref C: 2024-07-14T19:52:45Z' status: code: 200 message: OK @@ -1225,7 +1265,7 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002?api-version=2022-01-01 response: @@ -1235,30 +1275,31 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo cache-control: - no-cache content-length: - '0' date: - - Wed, 10 Jan 2024 09:19:59 GMT + - Sun, 14 Jul 2024 19:52:51 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995533793&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=LyMlYCP8OfrN00TCvWJL5A3dXXFFcPlAlnB5Rtz5leva9j3vrsD1P1MXgJhGtlClVQc1k4dYMNtyrn_tYNyikTHa7_wVucXgrL258JVVzwUM8DWN_U9ZRnB_S3t2e3qnNY5CB4lBycjro8gHFa-s3RWR7VWjNIajhMJJtm3tbxzSL-Ebyv-4V2yAm_wwtLuRwlEiTx0HWzd_DpDqvH1dHUKTgGwbiUvBWEUkxco5OVDPxTwytRyfAVuufoTi7jtsbb-YkVczufj2w1cVaUivxQN7T5w-AfBoNQSZ113jee1zD_oDp8oDAASYu3ya1SPoXL8pUlu2y7bZa34wjvkQVA&h=Lsq86F5cgR4p-8h7Iy08m1LRvAo42slvmDNDQc4KP7M + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720702183&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=gXh_b5zBHGLiLu63ClNlmdJu4kXgYCjstaBgTTsafEqjylaPeLtXHl6_tb97AabLDIf6JebL2UBbwxH68BobBkHpxeMARXPlkCN5kyZcHIBR3vAFl2lIZVhklAN29SmP3qXMzIYOHJBjvlrhe2eYzigSdR-RhXid824JGXyTedNM1uAIG4U958K1LqOXBTSLy_W_7J6kA7Loq9hQD3gfnR1UI22KdgTFgssS19bNYeZ_7jrsD-0sj5MbTgn5TskUzgB6T6WGRxg-vaS1lLKZUe66arfDlMVSAcxqXJSMJe5SehLA0ir1zVkA6r6TydA0Gj_Bcpi7x2YRJ4taMF_8nw&h=tfsQ4dz03eRCXmxCwvSMG34AFkIXU0rUyLY67a0w0R0 pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - defad7d0-6bc4-4b23-a7d9-e1cf3044254e + - 8f70e3a5-ad9e-4ecf-bc6a-d70cc4f1311d x-ms-ratelimit-remaining-subscription-deletes: - '14999' + x-msedge-ref: + - 'Ref A: 428CD9664D58476A8555B17A721AE0F8 Ref B: MRS211050619037 Ref C: 2024-07-14T19:52:46Z' status: code: 202 message: Accepted @@ -1276,9 +1317,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -1290,24 +1331,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:19:59 GMT + - Sun, 14 Jul 2024 19:52:53 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8b14a088-9363-4969-bbec-7c521f87de6e + - c699efe7-8afd-4d8f-b658-1768b3cf6980 + x-msedge-ref: + - 'Ref A: 2B6E9E914C8843C09BE4159010892127 Ref B: MRS211050619037 Ref C: 2024-07-14T19:52:52Z' status: code: 200 message: OK @@ -1325,9 +1363,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -1339,24 +1377,159 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:20:10 GMT + - Sun, 14 Jul 2024 19:53:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 2aec4077-a8d5-4918-908d-064376b5ab59 + x-msedge-ref: + - 'Ref A: 5C9EF6F4ECCF489EA594685A0BBE6FE1 Ref B: MRS211050619037 Ref C: 2024-07-14T19:53:03Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall delete + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 19:53:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - d03ef7fb-c5ca-4ea0-abf9-58fa1a83f352 + x-msedge-ref: + - 'Ref A: 8452F67741904985B11C93AE54D0DD59 Ref B: MRS211050619037 Ref C: 2024-07-14T19:53:24Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall delete + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 19:53:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - b932bd58-817e-4ea3-a180-7940967e0dcd + x-msedge-ref: + - 'Ref A: 44BDC8FF59F24072AF68275D4DDF7FB9 Ref B: MRS211050619037 Ref C: 2024-07-14T19:53:44Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall delete + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 19:54:27 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0e86eac6-4c63-43ac-83f6-20678c3fe4d2 + - 94e3f09f-9ad5-4451-94ec-83c275c8cba2 + x-msedge-ref: + - 'Ref A: A858F912D586436D85F5F0A2AAD43BF1 Ref B: MRS211050619037 Ref C: 2024-07-14T19:54:26Z' status: code: 200 message: OK @@ -1374,9 +1547,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -1388,171 +1561,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:20:29 GMT + - Sun, 14 Jul 2024 19:55:08 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 6bb09385-1388-4f06-bc06-895d05d264b5 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network firewall delete - Connection: - - keep-alive - ParameterSetName: - - -n -g - User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 10 Jan 2024 09:20:50 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 99cf5f00-9126-4ffc-aefb-17d3f339b113 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network firewall delete - Connection: - - keep-alive - ParameterSetName: - - -n -g - User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 10 Jan 2024 09:21:31 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 5cd59a63-30a8-466f-b0af-7b93d1e9ac5e - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network firewall delete - Connection: - - keep-alive - ParameterSetName: - - -n -g - User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 10 Jan 2024 09:22:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 55c626f5-5172-4be4-a73f-6ee1805bbae0 + - e2a48b0d-8bee-458a-a3bc-76abbf568d95 + x-msedge-ref: + - 'Ref A: C7515B938DB24F62B7FE416060DA6B81 Ref B: MRS211050619037 Ref C: 2024-07-14T19:55:08Z' status: code: 200 message: OK @@ -1570,9 +1593,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -1584,24 +1607,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:23:32 GMT + - Sun, 14 Jul 2024 19:56:29 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d1b037d3-fa30-4c81-b04c-140b8fed787b + - 1ca03138-c914-4c73-9bbc-f354d05d4cf7 + x-msedge-ref: + - 'Ref A: 795261FE5011479ABEE3DF6524E49A8F Ref B: MRS211050618027 Ref C: 2024-07-14T19:56:29Z' status: code: 200 message: OK @@ -1619,9 +1639,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995377397&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=nUA3e5CotRxBDWb-LLk0zA59enyQ3VGCq5WPU9ZXYCAP5dViAPZiumJvzz-WysICIkRcIPKeUQDVbnEde7U3ohqZMUeLZSqUQsbwHP6SY0wZXKrGKMVDfcO-1Q4AyQI5AWjt0QqtG6fJ9zPU4Y3MuaumPZOwigvXcy9XHywYYp2oernPkAKT-1s6-TcfiYTEzuGxphirqYg2cGdLDJ44XzYyqpwoKbqNIfNANjtPIcx-z9BQRfXk9qPVsptQF67B3SUC3Z4pNKhUYBhIRSql99zWNyJ4HqVItDVacpPUasQ1kCul3oWpjQShGzunSdB5Bh2zHpSu6beBsatXHARHTg&h=5PjX-bUMb3BYJw75TDz5UJe59Oe_0j3sBY9gQ2-Ig2I + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720389467&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=rjcjku0Os-bEMsB2shoc8pK6gfuVf891iEaou9IZv9V8U3fmvAQUNBmxRUU8_r_mCG6OV1iW1_iWaVu8ARwtbf0_e_5Z0HVdy0NAvznhMb6PEYmJrXqy6Hedmyiep3xAVS5TjLEvsuFH8rM3UIFzaG1L3an_iyWn-G4HtO0PbH_gMDw1NQom6tD4H5wut2Svrj-IjZa8NYmPLqkkEuLoD0pe2Egp4gVdKegi-JGEWwnHfB3yLG3WSi-9SALfTv4GIa-QoC84Nqf1m4x4TUYZ9bqFL5gZ6-iG7NSEySSTeKVgFai5HQd7d8dJFRmLU0teBQbYM9jEww5Xw7xqte151w&h=aoDyq6dlNye7aK3Z-Vn1psCZnzxAJZAFXjWSQ6-Rapo response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -1633,24 +1653,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:14 GMT + - Sun, 14 Jul 2024 19:59:11 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 75a4080a-e0c0-43ac-af3a-a7499de68430 + - 8f43bce9-d40c-44d6-a57f-4c2d1dd66c18 + x-msedge-ref: + - 'Ref A: 70FB7A1C3BEB470DA8DBC73C48DB79CF Ref B: MRS211050619029 Ref C: 2024-07-14T19:59:10Z' status: code: 200 message: OK @@ -1668,9 +1685,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404751995533793&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=LyMlYCP8OfrN00TCvWJL5A3dXXFFcPlAlnB5Rtz5leva9j3vrsD1P1MXgJhGtlClVQc1k4dYMNtyrn_tYNyikTHa7_wVucXgrL258JVVzwUM8DWN_U9ZRnB_S3t2e3qnNY5CB4lBycjro8gHFa-s3RWR7VWjNIajhMJJtm3tbxzSL-Ebyv-4V2yAm_wwtLuRwlEiTx0HWzd_DpDqvH1dHUKTgGwbiUvBWEUkxco5OVDPxTwytRyfAVuufoTi7jtsbb-YkVczufj2w1cVaUivxQN7T5w-AfBoNQSZ113jee1zD_oDp8oDAASYu3ya1SPoXL8pUlu2y7bZa34wjvkQVA&h=Lsq86F5cgR4p-8h7Iy08m1LRvAo42slvmDNDQc4KP7M + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565835720702183&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=gXh_b5zBHGLiLu63ClNlmdJu4kXgYCjstaBgTTsafEqjylaPeLtXHl6_tb97AabLDIf6JebL2UBbwxH68BobBkHpxeMARXPlkCN5kyZcHIBR3vAFl2lIZVhklAN29SmP3qXMzIYOHJBjvlrhe2eYzigSdR-RhXid824JGXyTedNM1uAIG4U958K1LqOXBTSLy_W_7J6kA7Loq9hQD3gfnR1UI22KdgTFgssS19bNYeZ_7jrsD-0sj5MbTgn5TskUzgB6T6WGRxg-vaS1lLKZUe66arfDlMVSAcxqXJSMJe5SehLA0ir1zVkA6r6TydA0Gj_Bcpi7x2YRJ4taMF_8nw&h=tfsQ4dz03eRCXmxCwvSMG34AFkIXU0rUyLY67a0w0R0 response: body: string: '' @@ -1678,28 +1695,29 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404755747909954&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=dbHlrWhAqx-1facjrZA0ziM_4aDJY6LbXi2FAQPRWG-UJJuJ7UA6PJpdOlVnheFyY-i1fcZlxj3gJE3hAcTxzKfipV3qXGMgr6xA0RdG4jrzF5aJKl6CanJhXP9PaRkt0MmjP94kDZFxJdqJ7P0yyfIv3hM3hUPbjGA-Gf93Sl-WCNQsWNHXC3CwDjnzJiAmIz3G0o-GusCmlfxEL_N3-VN-s_3kM2GE-aKnFI-cLFR6tYfxzsxmvl1FS9tgKbbOxzuLybYycheLIL4MrhG8IvYH4l_tBFwuEcD9vcD7aumNfoTMd89WFPmAGIkclSQBl8D19aV372CG92QQw8Rp8g&h=gtP6CIls5_E1seaAfcJujMPQaCh_fo02swbf0Fp0MSA + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565839525651952&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=UQiTRVesygKKdXMfwLZiY5BwjSg-PsLffBCleJolmB5gceuHku7w9BAdpokRQMBqvlSwvg-fDExi3zRlsqqq7rsf9mLlQ-3VMy5kn6B_3zLiLRPUauuqZG85koKvvXbP1S9FYGmoVpPqOhx84qJEarfh_PeB7L_J82PrlWhPU8wnFfyrhMjZcoAG5fiS6XMU6zmK3RHKhBlmFpKaFuL-iqQ7Hw7VWZg3UAOHz9z6hwzKBJgcTuyFsPlFALDVO4JTYn9aqAfMpsC__4fcP_ye4-LxRhC87vQYbzD2ZwsC5q4mUtwFAHDEVkX9Vt5TGac0Ckl9zYCT1t0vOzm3QrA5zw&h=o9N9YtLxsrTsV-HkxYaoBAvFymkmoaPtsg7VL-k4H9E cache-control: - no-cache content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:14 GMT + - Sun, 14 Jul 2024 19:59:12 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/fc2627c7-9d0b-4b43-b25c-ea02ed621776?api-version=2022-01-01&t=638404755748066212&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=sr6oBtnnd1J7Gx6HSr6Hl_L_-ZYbAliezTZKdfYmJdUfPfdUqOBozfJ72b9UByOXkH3AgA_eHlvuNbdUk4Php0LYHQnucpouXqjxrNWnRJb0QYWSTCmrNnou6nNfi-g0YL8kJyUgnaIyKAMU5aMJ4hMoGNF1GPSUvHle2hXHP9pKz-_qoXYymgGZX2Wjs48KqSLyVGDQ6J-JTIlVQ-UlRtUMk8OiH6Ju4R1nvCPFOFEIFp0yAlqzxy1WUnOUggOzjsxUJq0YgOt0CoBteezp1MH3ECgJjBoSTXzkFRUZH5e16WiL_14Fx4P3mbsxOhg-Bu7hIxd0yDOeli81Ym6QFw&h=28ds_2gYpLf4HEkTMaG5DEgshLzwi4fYPXAo03lfFfc + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/b0da0f07-08a4-4545-83a2-a2fe60834add?api-version=2022-01-01&t=638565839525808079&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=U0bzc-k1iO4DEAMkg3iOmUpqfzFMTfKuW6ZYXx0_npczKP-oPkL6EVbOyPaPIaQRv52lpK1ACczYLFj5XFo5mZZCxfsSijolkzPcbwDiEsM1m_njv1CYDScdwqlp67JtcPMG2dm1bKqH1T8wp_57vgYyVbYsKcvW4-EfPGrCGmKLUL5PCwzzg_S9DM6UiuCBLiz392HV0KIABDg1H66n0QCetPxElqxEPHSzm1jeE5nXbknihGRR3dEtELjXzQ7si5fcyPf_yXVgO85Cix62jbL0L1_Nlj5_6Bz4eEBAqIZ_lzf5jZ14idw4q5RLQJ3580lVN3CDRDmjUFUqHoXKVQ&h=4PUIVDWH-mWVR2zjN-9FChbIaD_kdXOwUpwIpFiddhA pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - defad7d0-6bc4-4b23-a7d9-e1cf3044254e + - 8f70e3a5-ad9e-4ecf-bc6a-d70cc4f1311d + x-msedge-ref: + - 'Ref A: B168D758F30B49C4BA69345C222414B5 Ref B: MRS211050619029 Ref C: 2024-07-14T19:59:12Z' status: code: 204 message: No Content @@ -1727,9 +1745,9 @@ interactions: content-length: - '0' date: - - Wed, 10 Jan 2024 09:26:16 GMT + - Sun, 14 Jul 2024 19:59:13 GMT expires: - - Wed, 10 Jan 2024 09:26:16 GMT + - Sun, 14 Jul 2024 19:59:13 GMT location: - https://azcliextensionsync.blob.core.windows.net/index1/index.json pragma: @@ -1760,7 +1778,34 @@ interactions: uri: https://azcliextensionsync.blob.core.windows.net/index1/index.json response: body: - string: "{\n \"extensions\": {\n \"account\": [\n {\n \"downloadUrl\": + string: "{\n \"extensions\": {\n \"acat\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/acat-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"acat-1.0.0b1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.61.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/acat\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"acat\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Acat Extension.\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"9c228e93fdda531137ba6e5abad2b48577cf58512e4be0dee51cef111267327a\"\n + \ }\n ],\n \"account\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/account-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"account-0.1.0-py2.py3-none-any.whl\",\n \"metadata\": {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": @@ -7667,113 +7712,18 @@ interactions: \"aks-preview\",\n \"summary\": \"Provides a preview for upcoming AKS features\",\n \"version\": \"0.5.174\"\n },\n \ \"sha256Digest\": \"b3d5716a53bd13ac59226cd0f7758cc11f535d5044fb026f71d3f5eb269cb87c\"\n - \ }\n ],\n \"aksarc\": [\n {\n \"downloadUrl\": - \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.0-py3-none-any.whl\",\n - \ \"filename\": \"aksarc-1.0.0-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": - [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"Programming Language :: Python - :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n - \ ],\n \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n - \ }\n }\n },\n - \ \"extras\": [],\n \"generator\": \"bdist_wheel - (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": - \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": - [\n {\n \"requires\": [\n - \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n - \ \"paramiko (>=3.3.1)\",\n \"paramiko>=3.3.1\"\n - \ ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService - Extension\",\n \"version\": \"1.0.0\"\n },\n - \ \"sha256Digest\": \"e214f2e51d336069bbfd97f7d2ee31f467669e60f1920cee5f73ae2098f12a08\"\n - \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.2-py3-none-any.whl\",\n - \ \"filename\": \"aksarc-1.0.2-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": - [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"Programming Language :: Python - :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n - \ ],\n \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n - \ }\n }\n },\n - \ \"extras\": [],\n \"generator\": \"bdist_wheel - (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": - \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": - [\n {\n \"requires\": [\n - \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n - \ \"paramiko (>=3.3.1)\",\n \"paramiko>=3.3.1\"\n - \ ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService - Extension\",\n \"version\": \"1.0.2\"\n },\n - \ \"sha256Digest\": \"62c4ff20ce9d669ee4063a5bd4f03a7f7b591d2cf9fe74a3719b6be5586a937c\"\n - \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.3-py3-none-any.whl\",\n - \ \"filename\": \"aksarc-1.0.3-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"Programming Language :: Python - :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n - \ ],\n \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n - \ }\n }\n },\n - \ \"extras\": [],\n \"generator\": \"bdist_wheel - (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": - \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": - [\n {\n \"requires\": [\n - \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n - \ \"paramiko (>=3.3.1)\",\n \"paramiko>=3.3.1\"\n - \ ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService - Extension\",\n \"version\": \"1.0.3\"\n },\n - \ \"sha256Digest\": \"192197cf011658d2ed9ff2c98dcc469a4d8119d7988e902437071e9b83d113bf\"\n - \ }\n ],\n \"akshybrid\": [\n {\n \"downloadUrl\": - \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/akshybrid-0.1.1-py3-none-any.whl\",\n - \ \"filename\": \"akshybrid-0.1.1-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": - \"2.32.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n - \ \"Programming Language :: Python :: 3.9\",\n \"License - :: OSI Approved :: MIT License\"\n ],\n \"extensions\": + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": \"azpycli@microsoft.com\",\n \"name\": @@ -7781,30 +7731,25 @@ interactions: \"author\"\n }\n ],\n \ \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/akshybrid\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n - \ \"extras\": [],\n \"generator\": \"bdist_wheel - (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": - \"2.0\",\n \"name\": \"akshybrid\",\n \"run_requires\": - [\n {\n \"requires\": [\n - \ \"kubernetes (==11.0.0)\",\n \"kubernetes==11.0.0\",\n - \ \"pycryptodome (==3.12.0)\",\n \"pycryptodome==3.12.0\"\n - \ ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService - Extension\",\n \"version\": \"0.1.1\"\n },\n - \ \"sha256Digest\": \"2ec4c1150f24ff806dccb4ecefe2f96c736276a9aef725c6988abfcc0adb3546\"\n - \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/akshybrid-0.1.2-py3-none-any.whl\",\n - \ \"filename\": \"akshybrid-0.1.2-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": - \"2.32.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n - \ \"Programming Language :: Python :: 3.9\",\n \"License - :: OSI Approved :: MIT License\"\n ],\n \"extensions\": + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"ee4bbc8d3c175d3aeea67506646d57860f2bd54ea049cf60c7e0e455bda6b283\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-1.0.0b2-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-1.0.0b2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": \"azpycli@microsoft.com\",\n \"name\": @@ -7812,131 +7757,51 @@ interactions: \"author\"\n }\n ],\n \ \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/akshybrid\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"akshybrid\",\n \"summary\": \"Microsoft Azure Command-Line - Tools HybridContainerService Extension\",\n \"version\": - \"0.1.2\"\n },\n \"sha256Digest\": \"9767cda444c421573bc220e01cd58a67c30a36175cedba68b0454a3c6e983a8e\"\n - \ }\n ],\n \"alb\": [\n {\n \"downloadUrl\": - \"https://azcliprod.blob.core.windows.net/cli-extensions/alb-0.2.0-py3-none-any.whl\",\n - \ \"filename\": \"alb-0.2.0-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": - \"2.48.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.7\",\n \"Programming Language :: Python - :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n - \ \"License :: OSI Approved :: MIT License\"\n ],\n - \ \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alb\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alb\",\n \"summary\": \"Microsoft Azure Command-Line - Tools ALB Extension.\",\n \"version\": \"0.2.0\"\n },\n - \ \"sha256Digest\": \"d88930eedb6164a3ac71ff42ab5f8e3b21edb5f95d01274f35fc7f91bbf70378\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alb-1.0.0-py3-none-any.whl\",\n - \ \"filename\": \"alb-1.0.0-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": - \"2.51.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.7\",\n \"Programming Language :: Python - :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n - \ \"License :: OSI Approved :: MIT License\"\n ],\n - \ \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alb\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alb\",\n \"summary\": \"Microsoft Azure Command-Line - Tools ALB Extension.\",\n \"version\": \"1.0.0\"\n },\n - \ \"sha256Digest\": \"b020cd8cd3da6299dc978499dae452768b7651c3ed8e05f2f0b321bd9b8354d4\"\n - \ }\n ],\n \"alertsmanagement\": [\n {\n - \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.1.0-py2.py3-none-any.whl\",\n - \ \"filename\": \"alertsmanagement-0.1.0-py2.py3-none-any.whl\",\n - \ \"metadata\": {\n \"azext.isExperimental\": - true,\n \"azext.minCliCoreVersion\": \"2.3.1\",\n \"classifiers\": - [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": - {\n \"python.details\": {\n \"contacts\": - [\n {\n \"email\": - \"fey@microsoft.com\",\n \"name\": \"Github:qwordy\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alertsmanagement\",\n \"summary\": \"Microsoft Azure - Command-Line Tools Alerts Extension\",\n \"version\": \"0.1.0\"\n - \ },\n \"sha256Digest\": \"80ab78574debff9d8a9106bac3929cb552adea1371ea24f06073669fef708fcd\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.1.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"alertsmanagement-0.1.1-py2.py3-none-any.whl\",\n - \ \"metadata\": {\n \"azext.isExperimental\": - true,\n \"azext.minCliCoreVersion\": \"2.3.1\",\n \"classifiers\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"1.0.0b2\"\n },\n + \ \"sha256Digest\": \"50e8b8f4b2fd02c2085d410efee7558a10a5399aa6d8e2b5def62fdc2d860b16\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-1.0.0b3-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-1.0.0b3-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": - \"fey@microsoft.com\",\n \"name\": \"Github:qwordy\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/alertsmanagement\"\n + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alertsmanagement\",\n \"summary\": \"Microsoft Azure - Command-Line Tools Alerts Extension\",\n \"version\": \"0.1.1\"\n - \ },\n \"sha256Digest\": \"319f2855f71de21b22b721b4b02d50faf858a71c04ced52a4f4c1e4e114dffa6\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.0-py3-none-any.whl\",\n - \ \"filename\": \"alertsmanagement-0.2.0-py3-none-any.whl\",\n + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"1.0.0b3\"\n },\n + \ \"sha256Digest\": \"b5823a278d7b7ab787e8469b6e5f4ce1e7983aac2e6ac79ba38a998da0f5d994\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-1.0.0b4-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-1.0.0b4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": \"azpycli@microsoft.com\",\n \"name\": @@ -7944,25 +7809,25 @@ interactions: \"author\"\n }\n ],\n \ \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/alertsmanagement\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alertsmanagement\",\n \"summary\": \"Microsoft Azure - Command-Line Tools AlertsManagementClient Extension\",\n \"version\": - \"0.2.0\"\n },\n \"sha256Digest\": \"1881c770fca969d269840923f1a6332602ec0a031c7402aaefa3ac6babadf70c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.1-py3-none-any.whl\",\n - \ \"filename\": \"alertsmanagement-0.2.1-py3-none-any.whl\",\n + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"1.0.0b4\"\n },\n + \ \"sha256Digest\": \"dd01c61e5fd22df8845159781a89f783a45e102a9a97acae5bed4a735a2dec6c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-1.0.0b5-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-1.0.0b5-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": \"azpycli@microsoft.com\",\n \"name\": @@ -7970,25 +7835,25 @@ interactions: \"author\"\n }\n ],\n \ \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/alertsmanagement\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alertsmanagement\",\n \"summary\": \"Microsoft Azure - Command-Line Tools AlertsManagementClient Extension\",\n \"version\": - \"0.2.1\"\n },\n \"sha256Digest\": \"4ad81bafbcf4d0cc813918d3a370eda0ff4d7e8d410cadb1adee353e300d58ef\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.2-py3-none-any.whl\",\n - \ \"filename\": \"alertsmanagement-0.2.2-py3-none-any.whl\",\n + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"1.0.0b5\"\n },\n + \ \"sha256Digest\": \"75378ea07dea6fdadb115e41e8394003fd63282560648fa92d8f055f1e2536eb\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-1.0.0b6-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-1.0.0b6-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": \"azpycli@microsoft.com\",\n \"name\": @@ -7996,25 +7861,25 @@ interactions: \"author\"\n }\n ],\n \ \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alertsmanagement\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alertsmanagement\",\n \"summary\": \"Microsoft Azure - Command-Line Tools AlertsManagementClient Extension\",\n \"version\": - \"0.2.2\"\n },\n \"sha256Digest\": \"2221f34f874532e4c5324f821a40a49f6cecca70b72e594144e6baf60b08508e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.3-py3-none-any.whl\",\n - \ \"filename\": \"alertsmanagement-0.2.3-py3-none-any.whl\",\n + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"1.0.0b6\"\n },\n + \ \"sha256Digest\": \"2d535ccdce575a5c3c4bd2aa9be1646d6227339d8142de593e5ab31b9d5018e0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.6\",\n \"Programming - Language :: Python :: 3.7\",\n \"Programming Language - :: Python :: 3.8\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n \"email\": \"azpycli@microsoft.com\",\n \"name\": @@ -8022,17 +7887,1324 @@ interactions: \"author\"\n }\n ],\n \ \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alertsmanagement\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"alertsmanagement\",\n \"summary\": \"Microsoft Azure - Command-Line Tools AlertsManagementClient Extension\",\n \"version\": - \"0.2.3\"\n },\n \"sha256Digest\": \"b45a5752924ab1205ff5862f03a4a465eccb4dd8e79900023498d674aa68665b\"\n - \ }\n ],\n \"alias\": [\n {\n \"downloadUrl\": - \"https://azurecliprod.blob.core.windows.net/cli-extensions/alias-0.5.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"alias-0.5.2-py2.py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b1\"\n },\n + \ \"sha256Digest\": \"099ed6855de6571395b7c5531cfbed6537d98dfdc2570ec31acf8f5958f53956\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b2-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b2\"\n },\n + \ \"sha256Digest\": \"48ca4edfa81686a283930f58a43c459c3b18e7bd4dfc4782ab75659ec711f549\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b3-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b3-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b3\"\n },\n + \ \"sha256Digest\": \"59fdd960108b7dbbae8d0d417adaf29a764ddab19c0c34c710be13b063d77214\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b4-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b4-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b4\"\n },\n + \ \"sha256Digest\": \"1b5f13ef657dc05525ebcb1000340295a4453c6baeedbfca97ce5ba799486ff7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b5-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b5-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b5\"\n },\n + \ \"sha256Digest\": \"de0ff3c4929fe33f9a1be37bbc3718493c57606088cee0a7acc3165ecf4c286e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b6-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b6-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b6\"\n },\n + \ \"sha256Digest\": \"f99e03a78728eab8ee6fc6f3944d35719876baa4cce0d8642e6935bc6e127083\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b7-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b7-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.49.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b7\"\n },\n + \ \"sha256Digest\": \"aeffac4ded4de3f4f0673c90c407ece117138da1e470da54759aa838624a2fe4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-2.0.0b8-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-2.0.0b8-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"2.0.0b8\"\n },\n + \ \"sha256Digest\": \"a9896e58511fef1aa889316350c9a7b84176185fbdd7783bf43db401851096b4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b1\"\n },\n + \ \"sha256Digest\": \"2bec826c57c59f6b84e298118500006f2ec150d9c3d38b8f9fe3f7a75985a9ce\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b2-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b2\"\n },\n + \ \"sha256Digest\": \"4930d07a7d69a83867c57c7328f87750534d92e9f9e53afc3cd768108fa722c8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b3-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b3-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b3\"\n },\n + \ \"sha256Digest\": \"85c7f1a79fee3797933f6c18d89cb7f0e287b9678bc903c00db5f3456a04ef58\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b4-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b4-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b4\"\n },\n + \ \"sha256Digest\": \"5d04fb35d81280a56ee96083ea18a04378b51df0d2b0b37ad0b22c842020b2e6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b5-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b5-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b5\"\n },\n + \ \"sha256Digest\": \"6a91566e4fd41fa24805b4db78205923a5f36ac2e09b5eba773b648fcfafe879\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b6-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b6-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b6\"\n },\n + \ \"sha256Digest\": \"afd115977bc8b4a46661772f290eea84ecfeae7df8663b0798e57d278b676a83\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b7-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b7-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b7\"\n },\n + \ \"sha256Digest\": \"404cb196e85565eb99e79de72d608da60c1771db59ce3a3df4942625ea1d138b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b8-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b8-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b8\"\n },\n + \ \"sha256Digest\": \"ea2ee7cabcd6a02a3d457b18e55d8cd8e2ee00675101be376471850873b46236\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b9-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b9-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b9\"\n },\n + \ \"sha256Digest\": \"3d5e43cd1b92ef9abe959fd2aea3e3c66dbebe2cd22df6fdb8abcf7b6682bbd9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b10-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b10-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b10\"\n + \ },\n \"sha256Digest\": \"b5e406bb246012463c9d468f5ca7d9f16758a47d042dea9070ef397354f87beb\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b11-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b11-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b11\"\n + \ },\n \"sha256Digest\": \"143ce75380ca2defa2f1bf241802747e3509509a50580e328c3b07fb1cb1fc77\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b12-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b12-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b12\"\n + \ },\n \"sha256Digest\": \"22b2aab02d7dc90b57bf51008e087c84c4f22372e425c750e52116462cca200c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-3.0.0b13-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-3.0.0b13-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"3.0.0b13\"\n + \ },\n \"sha256Digest\": \"a3e8c70bd56e2b31fc174ec7c24cf36995eb5597fcdae2722c3281aab7fde044\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-4.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-4.0.0b1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"4.0.0b1\"\n },\n + \ \"sha256Digest\": \"27fdb9f6bf411cebc30281bdc578d12658db7c65055e5e598b88b58d3abb3ac7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-4.0.0b2-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-4.0.0b2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"4.0.0b2\"\n },\n + \ \"sha256Digest\": \"377d01c2e2099d60ec05a25b0458c41e97dfaa81adf3ada19207e78f572aaac4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-4.0.0b3-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-4.0.0b3-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"4.0.0b3\"\n },\n + \ \"sha256Digest\": \"ee79134d705d6ebe661653bab44870f1bd307e0a194dbe911b43975c2f4b8458\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-4.0.0b4-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-4.0.0b4-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developvalidate_nodepool_taintsers\",\n \"Intended + Audience :: System Administrators\",\n \"Programming + Language :: Python\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"4.0.0b4\"\n },\n + \ \"sha256Digest\": \"2f6a8ec56fd48237ebf9d48cc5a63507d7360492d72deeb42f62c8acd8527b6b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-4.0.0b5-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-4.0.0b5-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"4.0.0b5\"\n },\n + \ \"sha256Digest\": \"fff8b68a7a332789345947796cb5014ca2dd8781c38d49c7bdceaf9912490d10\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-5.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-5.0.0b1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"5.0.0b1\"\n },\n + \ \"sha256Digest\": \"2c0a6b1a952b30f10f36f744e214a03774016fe7834038b917b8bc0ef03ce0c9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-5.0.0b2-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-5.0.0b2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"5.0.0b2\"\n },\n + \ \"sha256Digest\": \"e110ba66f4375b28e7bca9e7a91e31288454907165274a84a62625a2a047c338\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-5.0.0b3-py2.py3-none-any.whl\",\n + \ \"filename\": \"aks_preview-5.0.0b3-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/aks-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"aks-preview\",\n \"summary\": \"Provides a preview for + upcoming AKS features\",\n \"version\": \"5.0.0b3\"\n },\n + \ \"sha256Digest\": \"ff3f4cb237c87040662306e3b46bfaabde9ea4e7d3c23be55f3a829baf8404d0\"\n + \ }\n ],\n \"aksarc\": [\n {\n \"downloadUrl\": + \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.0.0b1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"292e44e40560c00c13e9ac9e113e2526943aac58fde3cc13d8ec5e14a463f05c\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (>=3.3.1)\",\n \"paramiko>=3.3.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.0.0\"\n },\n + \ \"sha256Digest\": \"e214f2e51d336069bbfd97f7d2ee31f467669e60f1920cee5f73ae2098f12a08\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.2-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.0.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (>=3.3.1)\",\n \"paramiko>=3.3.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.0.2\"\n },\n + \ \"sha256Digest\": \"62c4ff20ce9d669ee4063a5bd4f03a7f7b591d2cf9fe74a3719b6be5586a937c\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.3-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.0.3-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (>=3.3.1)\",\n \"paramiko>=3.3.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.0.3\"\n },\n + \ \"sha256Digest\": \"192197cf011658d2ed9ff2c98dcc469a4d8119d7988e902437071e9b83d113bf\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.0.4-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.0.4-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.0.4\"\n },\n + \ \"sha256Digest\": \"3059bea235a1108cb9d22e9bd2f04d00293647abd53cacce454d3a23b4206887\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.1.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.1.0\"\n },\n + \ \"sha256Digest\": \"c81f724aa3e55a864b8952c77f8d7413c1df79ce29331d550be8a310c74a9181\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.1.1-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.1.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.1.1\"\n },\n + \ \"sha256Digest\": \"44151263f259c0b737319a355daef40fac9656342dfc1ea9a33a8c869f676fc5\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.1.2-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.1.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/aksarc\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.1.2\"\n },\n + \ \"sha256Digest\": \"3bdff388c2adc6df95b225d52b7af9197fa24ebfc02654451f127a6dbbc913ba\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.2.20-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.2.20-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://learn.microsoft.com/en-us/azure/aks/hybrid/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.2.20\"\n },\n + \ \"sha256Digest\": \"bf55c6a31c8c9eb876e5f65260b134dd1820ed76bd9f838ebb9c3e30635faa04\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/aksarc-1.2.23-py3-none-any.whl\",\n + \ \"filename\": \"aksarc-1.2.23-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.32.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://learn.microsoft.com/en-us/azure/aks/hybrid/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aksarc\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (>=24.0.0)\",\n \"kubernetes>=24.0.0\",\n + \ \"paramiko (<4.0.0,>=2.0.8)\",\n \"paramiko<4.0.0,>=2.0.8\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"1.2.23\"\n },\n + \ \"sha256Digest\": \"9a02fe5a42e135787b91feb950db74a318b6922d768b5c00327621951b9d6fdd\"\n + \ }\n ],\n \"akshybrid\": [\n {\n \"downloadUrl\": + \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/akshybrid-0.1.1-py3-none-any.whl\",\n + \ \"filename\": \"akshybrid-0.1.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": + \"2.32.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"Programming Language :: Python :: 3.9\",\n \"License + :: OSI Approved :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/akshybrid\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"akshybrid\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"kubernetes==11.0.0\",\n + \ \"pycryptodome (==3.12.0)\",\n \"pycryptodome==3.12.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools HybridContainerService + Extension\",\n \"version\": \"0.1.1\"\n },\n + \ \"sha256Digest\": \"2ec4c1150f24ff806dccb4ecefe2f96c736276a9aef725c6988abfcc0adb3546\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/HybridAKS/CLI/akshybrid-0.1.2-py3-none-any.whl\",\n + \ \"filename\": \"akshybrid-0.1.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": + \"2.32.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"Programming Language :: Python :: 3.9\",\n \"License + :: OSI Approved :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://dev.azure.com/msazure/msk8s/_git/hybridaks-utils/azcli/akshybrid\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"akshybrid\",\n \"summary\": \"Microsoft Azure Command-Line + Tools HybridContainerService Extension\",\n \"version\": + \"0.1.2\"\n },\n \"sha256Digest\": \"9767cda444c421573bc220e01cd58a67c30a36175cedba68b0454a3c6e983a8e\"\n + \ }\n ],\n \"alb\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/alb-0.2.0-py3-none-any.whl\",\n + \ \"filename\": \"alb-0.2.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alb\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alb\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ALB Extension.\",\n \"version\": \"0.2.0\"\n },\n + \ \"sha256Digest\": \"d88930eedb6164a3ac71ff42ab5f8e3b21edb5f95d01274f35fc7f91bbf70378\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alb-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"alb-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alb\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alb\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ALB Extension.\",\n \"version\": \"1.0.0\"\n },\n + \ \"sha256Digest\": \"b020cd8cd3da6299dc978499dae452768b7651c3ed8e05f2f0b321bd9b8354d4\"\n + \ }\n ],\n \"alertsmanagement\": [\n {\n + \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.1.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"alertsmanagement-0.1.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isExperimental\": + true,\n \"azext.minCliCoreVersion\": \"2.3.1\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"fey@microsoft.com\",\n \"name\": \"Github:qwordy\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alertsmanagement\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Alerts Extension\",\n \"version\": \"0.1.0\"\n + \ },\n \"sha256Digest\": \"80ab78574debff9d8a9106bac3929cb552adea1371ea24f06073669fef708fcd\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.1.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"alertsmanagement-0.1.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isExperimental\": + true,\n \"azext.minCliCoreVersion\": \"2.3.1\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"fey@microsoft.com\",\n \"name\": \"Github:qwordy\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/alertsmanagement\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alertsmanagement\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Alerts Extension\",\n \"version\": \"0.1.1\"\n + \ },\n \"sha256Digest\": \"319f2855f71de21b22b721b4b02d50faf858a71c04ced52a4f4c1e4e114dffa6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.0-py3-none-any.whl\",\n + \ \"filename\": \"alertsmanagement-0.2.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/alertsmanagement\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alertsmanagement\",\n \"summary\": \"Microsoft Azure + Command-Line Tools AlertsManagementClient Extension\",\n \"version\": + \"0.2.0\"\n },\n \"sha256Digest\": \"1881c770fca969d269840923f1a6332602ec0a031c7402aaefa3ac6babadf70c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.1-py3-none-any.whl\",\n + \ \"filename\": \"alertsmanagement-0.2.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/alertsmanagement\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alertsmanagement\",\n \"summary\": \"Microsoft Azure + Command-Line Tools AlertsManagementClient Extension\",\n \"version\": + \"0.2.1\"\n },\n \"sha256Digest\": \"4ad81bafbcf4d0cc813918d3a370eda0ff4d7e8d410cadb1adee353e300d58ef\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.2-py3-none-any.whl\",\n + \ \"filename\": \"alertsmanagement-0.2.2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alertsmanagement\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alertsmanagement\",\n \"summary\": \"Microsoft Azure + Command-Line Tools AlertsManagementClient Extension\",\n \"version\": + \"0.2.2\"\n },\n \"sha256Digest\": \"2221f34f874532e4c5324f821a40a49f6cecca70b72e594144e6baf60b08508e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/alertsmanagement-0.2.3-py3-none-any.whl\",\n + \ \"filename\": \"alertsmanagement-0.2.3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/alertsmanagement\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"alertsmanagement\",\n \"summary\": \"Microsoft Azure + Command-Line Tools AlertsManagementClient Extension\",\n \"version\": + \"0.2.3\"\n },\n \"sha256Digest\": \"b45a5752924ab1205ff5862f03a4a465eccb4dd8e79900023498d674aa68665b\"\n + \ }\n ],\n \"alias\": [\n {\n \"downloadUrl\": + \"https://azurecliprod.blob.core.windows.net/cli-extensions/alias-0.5.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"alias-0.5.2-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.0.50.dev0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n @@ -8585,6 +9757,196 @@ interactions: \"amg\",\n \"summary\": \"Microsoft Azure Command-Line Tools Azure Managed Grafana Extension\",\n \"version\": \"1.2.9\"\n },\n \"sha256Digest\": \"dbea8dd0e85dd2f30f30cb66f0dd7f9d0314a7ff9765a4d074622b75aeccad2f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.2.10-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.2.10-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"amg\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Azure Managed Grafana Extension\",\n \"version\": + \"1.2.10\"\n },\n \"sha256Digest\": \"a19d60a2e1d3562cf9434bb7817b85f8ccca1472c6622921b83db9e1a85a98b7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.3.0-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.3.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"amg\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-dashboard (>=1.1.0)\",\n \"azure-mgmt-dashboard>=1.1.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Azure + Managed Grafana Extension\",\n \"version\": \"1.3.0\"\n + \ },\n \"sha256Digest\": \"c644207517d21641677fe5a1644271d5f751f1493e0dc8e1cded6645ac096a91\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.3.1-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.3.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"amg\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-dashboard (>=1.1.0)\",\n \"azure-mgmt-dashboard>=1.1.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Azure + Managed Grafana Extension\",\n \"version\": \"1.3.1\"\n + \ },\n \"sha256Digest\": \"7c7f452e18b92934d4f4ccc23ef2984ac0078397ca85b60bb287bf4f89c925f5\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.3.2-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.3.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"amg\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Azure Managed Grafana Extension\",\n \"version\": + \"1.3.2\"\n },\n \"sha256Digest\": \"cf31e9336e8b8bf63b7a1362ea05871f65493cfd49fd4a2cb73c1cb63c81f91a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.3.3-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.3.3-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"amg\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Azure Managed Grafana Extension\",\n \"version\": + \"1.3.3\"\n },\n \"sha256Digest\": \"73914977612839d541cb356f3fccd0381d1126b20fdb6cab29a99fd81da974c0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.3.4-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.3.4-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"amg\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Azure Managed Grafana Extension\",\n \"version\": + \"1.3.4\"\n },\n \"sha256Digest\": \"cf665da8629edfef5189eb2dd57d849d458f841cff83d2cad2a1b61104febf22\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amg-1.3.5-py3-none-any.whl\",\n + \ \"filename\": \"amg-1.3.5-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.maxCliCoreVersion\": + \"2.99.0\",\n \"azext.minCliCoreVersion\": \"2.38.0\",\n + \ \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"ad4g@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/amg\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"amg\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Azure Managed Grafana Extension\",\n \"version\": + \"1.3.5\"\n },\n \"sha256Digest\": \"5eb4615d05dd85021d7d00311fdc25645535fe69e07cea1eca68d58cfb7bd44e\"\n \ }\n ],\n \"amlfs\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/amlfs-1.0.0-py3-none-any.whl\",\n \ \"filename\": \"amlfs-1.0.0-py3-none-any.whl\",\n \"metadata\": @@ -8704,6 +10066,38 @@ interactions: \ \"summary\": \"Microsoft Azure Command-Line Tools Aosm Extension\",\n \"version\": \"1.0.0b3\"\n },\n \ \"sha256Digest\": \"ae22e195764dac210d058b111a1bf96fe322f7dc09b2d00a19d85ce28ef9cd12\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/aosm-2.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"aosm-2.0.0b1-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.54.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/aosm\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"aosm\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"genson (>=1.2.2)\",\n \"genson>=1.2.2\",\n + \ \"jinja2 (>=3.1.4)\",\n \"jinja2>=3.1.4\",\n + \ \"oras (~=0.1.19)\",\n \"oras~=0.1.19\",\n + \ \"ruamel.yaml (>=0.17.4)\",\n \"ruamel.yaml>=0.17.4\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Aosm + Extension\",\n \"version\": \"2.0.0b1\"\n },\n + \ \"sha256Digest\": \"5c08be674f1aacdaeaef2ddc3561b3b2d09658c446afd33ba9d25ca3785181dc\"\n \ }\n ],\n \"apic-extension\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/apic_extension-1.0.0b1-py3-none-any.whl\",\n \ \"filename\": \"apic_extension-1.0.0b1-py3-none-any.whl\",\n @@ -8731,6 +10125,136 @@ interactions: \"apic-extension\",\n \"summary\": \"Microsoft Azure Command-Line Tools ApicExtension Extension.\",\n \"version\": \"1.0.0b1\"\n \ },\n \"sha256Digest\": \"03e8e9ec1ae46e6f4963ddf2fd3d8e7d642dd8b6403c0b19385aa4c4a3d06e7a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/apic_extension-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"apic_extension-1.0.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/apic-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"apic-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ApicExtension Extension.\",\n \"version\": \"1.0.0b2\"\n + \ },\n \"sha256Digest\": \"2147104b9118759826c2bf3e6289869c91c1baf5b10006f17731dea3716782ed\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/apic_extension-1.0.0b3-py3-none-any.whl\",\n + \ \"filename\": \"apic_extension-1.0.0b3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/apic-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"apic-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ApicExtension Extension.\",\n \"version\": \"1.0.0b3\"\n + \ },\n \"sha256Digest\": \"a102a46dafd78613c7225251bd8535003fbcd33a2dba93f98862821ee0b04298\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/apic_extension-1.0.0b4-py3-none-any.whl\",\n + \ \"filename\": \"apic_extension-1.0.0b4-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/apic-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"apic-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ApicExtension Extension.\",\n \"version\": \"1.0.0b4\"\n + \ },\n \"sha256Digest\": \"67294fd30190b66b339c8d550e58e1401117b313bea638fb0c126dec26249408\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/apic_extension-1.0.0b5-py3-none-any.whl\",\n + \ \"filename\": \"apic_extension-1.0.0b5-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/apic-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"apic-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ApicExtension Extension.\",\n \"version\": \"1.0.0b5\"\n + \ },\n \"sha256Digest\": \"fbca1f8446013142d676159b8292fd7c2d3175f39e1baeb5c4d13f9637003254\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/apic_extension-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"apic_extension-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/apic-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"apic-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ApicExtension Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"4bcaebfa5e9b112673f49fdee28c0690823e52a86e0ad4e5329634f4d195d425\"\n \ }\n ],\n \"application-insights\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/application_insights-0.1.3-py2.py3-none-any.whl\",\n \ \"filename\": \"application_insights-0.1.3-py2.py3-none-any.whl\",\n @@ -9253,7 +10777,67 @@ interactions: \ \"summary\": \"Support for managing Application Insights components and querying metrics, events, and logs from such components.\",\n \ \"version\": \"1.0.0\"\n },\n \"sha256Digest\": - \"f474e3ff345f026f9283077ef0a906c3c9e51746d6c3530d1e425f4e35d24227\"\n }\n + \"f474e3ff345f026f9283077ef0a906c3c9e51746d6c3530d1e425f4e35d24227\"\n },\n + \ {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/application_insights-1.2.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"application_insights-1.2.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"aleldeib@microsoft.com\",\n + \ \"name\": \"Ace Eldeib\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/application-insights\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"application-insights\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"isodate (~=0.6.0)\",\n \"isodate~=0.6.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Support for managing Application Insights + components and querying metrics, events, and logs from such components.\",\n + \ \"version\": \"1.2.0\"\n },\n \"sha256Digest\": + \"a58d0e878691601fc41f68881203d33c4bf28abd1f0c58c695080a35d6a988cb\"\n },\n + \ {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/application_insights-1.2.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"application_insights-1.2.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"aleldeib@microsoft.com\",\n + \ \"name\": \"Ace Eldeib\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/application-insights\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"application-insights\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"isodate (~=0.6.0)\",\n \"isodate~=0.6.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Support for managing Application Insights + components and querying metrics, events, and logs from such components.\",\n + \ \"version\": \"1.2.1\"\n },\n \"sha256Digest\": + \"e1fa824eb587e2bec7f4cb4d1c4ce1033ab3d3fac65af42dd6218f673b019cee\"\n }\n \ ],\n \"appservice-kube\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/appservice_kube-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"appservice_kube-0.1.0-py2.py3-none-any.whl\",\n @@ -9535,6 +11119,34 @@ interactions: \"appservice-kube\",\n \"summary\": \"Microsoft Azure Command-Line Tools App Service on Kubernetes Extension\",\n \"version\": \"0.1.9\"\n },\n \"sha256Digest\": \"9107762296c67ef4035256a9790b075040f263804116a3f9a6866227ff6019ed\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/appservice_kube-0.1.10-py2.py3-none-any.whl\",\n + \ \"filename\": \"appservice_kube-0.1.10-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.34.1\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/appservice-kube\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"appservice-kube\",\n \"summary\": \"Microsoft Azure Command-Line + Tools App Service on Kubernetes Extension\",\n \"version\": + \"0.1.10\"\n },\n \"sha256Digest\": \"7fd72d27e4b0eceda3b2b4f301c7a0c3068fea8b96d70f9fcaad142240de7d0d\"\n \ }\n ],\n \"arcappliance\": [\n {\n \"downloadUrl\": \"https://arcplatformcliextprod.blob.core.windows.net/arcappliance/arcappliance-1.0.0-py2.py3-none-any.whl\",\n \ \"filename\": \"arcappliance-1.0.0-py2.py3-none-any.whl\",\n @@ -9624,10 +11236,331 @@ interactions: \ \"jsonschema (==4.17.3)\",\n \"kubernetes (==28.1.0)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Arcappliance - Extension\",\n \"version\": \"1.0.2\"\n },\n - \ \"sha256Digest\": \"bc0b0e46b135ec874fa06debc3eb50ae9d27b3b296bcf0cdace815490827cfbf\"\n + Extension\",\n \"version\": \"1.0.2\"\n },\n + \ \"sha256Digest\": \"bc0b0e46b135ec874fa06debc3eb50ae9d27b3b296bcf0cdace815490827cfbf\"\n + \ },\n {\n \"downloadUrl\": \"https://arcplatformcliextprod.blob.core.windows.net/arcappliance/arcappliance-1.0.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcappliance-1.0.3-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"appliance@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://msazure.visualstudio.com/AzureArcPlatform/_git/arcappliance-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"arcappliance\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"jsonschema (==4.17.3)\",\n \"kubernetes + (==28.1.0)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Arcappliance + Extension\",\n \"version\": \"1.0.3\"\n },\n + \ \"sha256Digest\": \"15c83d845ee7bc580ee163786c38ba29958a37b11abeb5e7fd1503d07e030c09\"\n + \ },\n {\n \"downloadUrl\": \"https://arcplatformcliextprod.blob.core.windows.net/arcappliance/arcappliance-1.1.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcappliance-1.1.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"appliance@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://msazure.visualstudio.com/AzureArcPlatform/_git/arcappliance-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"arcappliance\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"jsonschema (==4.17.3)\",\n \"kubernetes + (==28.1.0)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Arcappliance + Extension\",\n \"version\": \"1.1.0\"\n },\n + \ \"sha256Digest\": \"fe7ac7344d9e6c4866d7d155a7167cd89e7c17618e18c4871222b04a31daa5cd\"\n + \ },\n {\n \"downloadUrl\": \"https://arcplatformcliextprod.blob.core.windows.net/arcappliance/arcappliance-1.1.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcappliance-1.1.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"appliance@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://msazure.visualstudio.com/AzureArcPlatform/_git/arcappliance-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"arcappliance\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"jsonschema (==4.17.3)\",\n \"kubernetes + (==28.1.0)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Arcappliance + Extension\",\n \"version\": \"1.1.1\"\n },\n + \ \"sha256Digest\": \"fc32b32be734782c31c54449a1658fe87845bb4aaa515a8ebb1db4c25cfc8658\"\n \ }\n ],\n \"arcdata\": [\n {\n \"downloadUrl\": - \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.8-py2.py3-none-any.whl\",\n + \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.16-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.16-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.16\"\n },\n + \ \"sha256Digest\": \"2055f3e9c504892c3d06c70cce5037e071f7feb27857925d4a21e1d549c168bc\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.15-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.15-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.15\"\n },\n + \ \"sha256Digest\": \"5ffc8b3a39abc34f0b0e209bcf6432e9834bf6144a0d842a7d5d2342bf378c4a\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.13-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.13-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.13\"\n },\n + \ \"sha256Digest\": \"c0d14a8d12c37907165d4acb4074d5d01cb03c6b5b8ac6a3a8885c04a8f92953\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.12-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.12-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.12\"\n },\n + \ \"sha256Digest\": \"b0b9eb43c720d22c35789dccd29358c5715d9c591d7e33d5c098e5cfe4561812\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.11-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.11-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.11\"\n },\n + \ \"sha256Digest\": \"e256260e003ae5953969aa9c36ed71ba69d235abd1762f7184f157b6e45e731a\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.10-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.10-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.10\"\n },\n + \ \"sha256Digest\": \"6bff67a0b183c42a2ecfe024dd1bfd1d28fca9d663bf5f9793f1be3289cb53e8\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.9-py2.py3-none-any.whl\",\n + \ \"filename\": \"arcdata-1.5.9-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": + \"2.3.1\",\n \"classifiers\": [\n \"Development + Status :: 1 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"dpgswdist@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/en-us/azure/azure-arc/data/\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"arcdata\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"colorama + (==0.4.4)\",\n \"jinja2 (==3.0.3)\",\n \"jsonpatch + (==1.24)\",\n \"jsonpath-ng (==1.4.3)\",\n + \ \"jsonschema (==3.2.0)\",\n \"kubernetes + (==23.3.0)\",\n \"ndjson (==0.3.1)\",\n \"pem + (==21.2.0)\",\n \"pydash (==7.0.6)\",\n \"regex + (==2023.10.3)\"\n ]\n }\n + \ ],\n \"summary\": \"Tools for managing + ArcData.\",\n \"version\": \"1.5.9\"\n },\n + \ \"sha256Digest\": \"106171524953a84d1d5ab7b49629746ca3bbccdcfa3b94974fd112e3e629cafd\"\n + \ },\n {\n \"downloadUrl\": \"https://azurearcdatacli.blob.core.windows.net/cli-extensions/arcdata-1.5.8-py2.py3-none-any.whl\",\n \ \"filename\": \"arcdata-1.5.8-py2.py3-none-any.whl\",\n \"metadata\": {\n \"azext.isExperimental\": false,\n \"azext.minCliCoreVersion\": \"2.3.1\",\n \"classifiers\": [\n \"Development @@ -10788,6 +12721,32 @@ interactions: \ }\n ],\n \"summary\": \"Tools for managing ArcData.\",\n \"version\": \"0.0.1\"\n \ },\n \"sha256Digest\": \"e727a7bf123aa15b406455f268be8a906907d6d32bd314d122b83d006767adc8\"\n + \ }\n ],\n \"astronomer\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/astronomer-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"astronomer-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/astronomer\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"astronomer\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Astronomer Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"b4ca41b5d9cb77aed2b462ded4a392ae3ce896ce8d9cb94a08671d0cb68176cd\"\n \ }\n ],\n \"attestation\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/attestation-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"attestation-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -11272,6 +13231,32 @@ interactions: \"automation\",\n \"summary\": \"Microsoft Azure Command-Line Tools AutomationClient Extension\",\n \"version\": \"0.2.2\"\n \ },\n \"sha256Digest\": \"1337a8bf90739df646231533801cce9050bad641c627382468c86af5f2f99d89\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/automation-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"automation-1.0.0b1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/automation\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"automation\",\n \"summary\": \"Microsoft Azure Command-Line + Tools AutomationClient Extension\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"d31fe0433fa30a6e009f7b9bee6c417a686ed87502dd987b9ac8ad113383915b\"\n \ }\n ],\n \"azure-batch-cli-extensions\": [\n {\n \ \"downloadUrl\": \"https://github.com/Azure/azure-batch-cli-extensions/releases/download/azure-batch-cli-extensions-2.5.3/azure_batch_cli_extensions-2.5.3-py2.py3-none-any.whl\",\n \ \"filename\": \"azure_batch_cli_extensions-2.5.3-py2.py3-none-any.whl\",\n @@ -11428,6 +13413,37 @@ interactions: \ }\n ],\n \"summary\": \"Additional commands for working with Azure Batch service\",\n \"version\": \"7.0.0\"\n },\n \"sha256Digest\": \"65dd7671262b1f0cf35b26970a816d7aea22d02c822c81f3ea4cf1028a7c2e16\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-batch-cli-extensions/releases/download/azure-batch-cli-extensions-7.0.1/azure_batch_cli_extensions-7.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"azure_batch_cli_extensions-7.0.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.30.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 2\",\n \"Programming Language + :: Python :: 2.7\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.4\",\n + \ \"Programming Language :: Python :: 3.5\",\n \"Programming + Language :: Python :: 3.6\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-batch-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"azure-batch-cli-extensions\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-batch-extensions (<9.1,>=9.0.0)\",\n + \ \"pycparser (==2.18)\"\n ]\n + \ }\n ],\n \"summary\": + \"Additional commands for working with Azure Batch service\",\n \"version\": + \"7.0.1\"\n },\n \"sha256Digest\": \"42ee1d2dadcfa353a6eee9010c50325e9353ee2817d688c1f804d301141901e3\"\n \ }\n ],\n \"azure-cli-ml\": [\n {\n \"downloadUrl\": \"https://azurecliext.blob.core.windows.net/release/azure_cli_ml-1.41.0-py3-none-any.whl\",\n \ \"filename\": \"azure_cli_ml-1.41.0-py3-none-any.whl\",\n @@ -11664,6 +13680,62 @@ interactions: \ }\n ],\n \"summary\": \"Tools for managing Azure DevOps.\",\n \"version\": \"0.26.0\"\n \ },\n \"sha256Digest\": \"565fc207f1740c26957f382fe2eefabec254011fb2d1b50c0e540f894f47dcbe\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-devops-cli-extension/releases/download/20240206.1/azure_devops-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"azure_devops-1.0.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.30.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"VSTS_Social@microsoft.com\",\n + \ \"name\": \"Microsoft\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Microsoft/azure-devops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"azure-devops\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"distro (==1.3.0)\",\n \"distro==1.3.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Tools for managing Azure DevOps.\",\n \"version\": + \"1.0.0\"\n },\n \"sha256Digest\": \"658a2854d8c80f874f9382d421fa45abf6a38d00334737dda006f8dec64cf70a\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-devops-cli-extension/releases/download/20240514.1/azure_devops-1.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"azure_devops-1.0.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.30.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"VSTS_Social@microsoft.com\",\n + \ \"name\": \"Microsoft\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Microsoft/azure-devops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"azure-devops\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"distro (==1.3.0)\",\n \"distro==1.3.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Tools for managing Azure DevOps.\",\n \"version\": + \"1.0.1\"\n },\n \"sha256Digest\": \"f300d0288f017148514ebe6f5912aef10c7a6f29bdc0c916b922edf1d75bc7db\"\n \ }\n ],\n \"azure-firewall\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/azure_firewall-0.1.3-py2.py3-none-any.whl\",\n \ \"filename\": \"azure_firewall-0.1.3-py2.py3-none-any.whl\",\n @@ -12439,6 +14511,32 @@ interactions: \"azure-firewall\",\n \"summary\": \"Manage Azure Firewall resources.\",\n \"version\": \"1.0.0\"\n },\n \ \"sha256Digest\": \"739f20463bf763ccfa08358f3535bfdbd1671fc16ef11c9428e8bade8154221b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/azure_firewall-1.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"azure_firewall-1.0.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 2\",\n \"Programming Language + :: Python :: 2.7\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.4\",\n + \ \"Programming Language :: Python :: 3.5\",\n \"Programming + Language :: Python :: 3.6\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"project_urls\": {\n \"Home\": + \"https://github.com/Azure/azure-cli-extensions/tree/main/src/azure-firewall\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-firewall\",\n \"summary\": \"Manage Azure Firewall + resources.\",\n \"version\": \"1.0.1\"\n },\n + \ \"sha256Digest\": \"920023c55ae72d7e85baa43d81d96683be0e8348228b6f8e89e479fd4092c0f8\"\n \ }\n ],\n \"azure-iot\": [\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-cli-extension/releases/download/v0.10.11/azure_iot-0.10.11-py3-none-any.whl\",\n \ \"filename\": \"azure_iot-0.10.11-py3-none-any.whl\",\n \"metadata\": @@ -13590,7 +15688,48 @@ interactions: (~=1.2)\"\n ]\n }\n ],\n \ \"summary\": \"The Azure IoT extension for Azure CLI.\",\n \ \"version\": \"0.23.1\"\n },\n \"sha256Digest\": - \"95ef8e340ce9a5309af9c3c8ffe67e1582baf199f21c60a74cdc7c987cf8c644\"\n }\n + \"95ef8e340ce9a5309af9c3c8ffe67e1582baf199f21c60a74cdc7c987cf8c644\"\n },\n + \ {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-cli-extension/releases/download/v0.24.0/azure_iot-0.24.0-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot-0.24.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [\n \"uamqp\"\n ],\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"license_file\": \"LICENSE\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"azure-iot\",\n \"requires_python\": + \">=3.8\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"azure-core + (<2.0.0,>=1.24.0)\",\n \"azure-identity (<2.0.0,>=1.6.1)\",\n + \ \"azure-iot-device (~=2.11)\",\n \"azure-mgmt-core + (<2.0.0,>=1.3.0)\",\n \"azure-storage-blob + (<13.0.0,>=12.14.0)\",\n \"jsonschema (~=3.2.0)\",\n + \ \"msrest (>=0.6.21)\",\n \"msrestazure + (<2.0.0,>=0.6.3)\",\n \"packaging\",\n \"tomli + (~=2.0)\",\n \"tomli-w (~=1.0)\",\n \"tqdm + (~=4.62)\",\n \"treelib (~=1.6)\"\n ]\n + \ },\n {\n \"extra\": + \"uamqp\",\n \"requires\": [\n \"uamqp + (~=1.2)\"\n ]\n }\n ],\n + \ \"summary\": \"The Azure IoT extension for Azure CLI.\",\n + \ \"version\": \"0.24.0\"\n },\n \"sha256Digest\": + \"a36e41f28904f2f29efd38ebebda6823c0a9101bed3c00e0af03cfffcd721da1\"\n }\n \ ],\n \"azure-iot-ops\": [\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.1.0b1/azure_iot_ops-0.1.0b1-py3-none-any.whl\",\n \ \"filename\": \"azure_iot_ops-0.1.0b1-py3-none-any.whl\",\n @@ -13657,12 +15796,182 @@ interactions: \ \"protobuf (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n }\n \ ],\n \"summary\": \"The Azure IoT Operations - extension for Azure CLI.\",\n \"version\": \"0.1.0b2\"\n - \ },\n \"sha256Digest\": \"dfe97525bb57cb65124c17916db4278f19e281220a5fedbd0d91486cadbb12bc\"\n - \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.2.0b1/azure_iot_ops-0.2.0b1-py3-none-any.whl\",\n - \ \"filename\": \"azure_iot_ops-0.2.0b1-py3-none-any.whl\",\n + extension for Azure CLI.\",\n \"version\": \"0.1.0b2\"\n + \ },\n \"sha256Digest\": \"dfe97525bb57cb65124c17916db4278f19e281220a5fedbd0d91486cadbb12bc\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.2.0b1/azure_iot_ops-0.2.0b1-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.2.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.42.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"protobuf (~=4.25.0)\",\n \"rich + (<14.0,>=13.6)\"\n ]\n }\n + \ ],\n \"summary\": \"The Azure IoT Operations + extension for Azure CLI.\",\n \"version\": \"0.2.0b1\"\n + \ },\n \"sha256Digest\": \"0e3bcc6cf3f2eeb80c96ee0d68eb3bad356837642296bed2c6edf7b9519b8320\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.2.0b2/azure_iot_ops-0.2.0b2-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.2.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.42.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"protobuf (~=4.25.0)\",\n \"rich + (<14.0,>=13.6)\"\n ]\n }\n + \ ],\n \"summary\": \"The Azure IoT Operations + extension for Azure CLI.\",\n \"version\": \"0.2.0b2\"\n + \ },\n \"sha256Digest\": \"eb0907428bfad9e0f974617663c2a73908887e99636ed9ec13954c767f7b741d\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.2.0b4/azure_iot_ops-0.2.0b4-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.2.0b4-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"protobuf (~=4.25.0)\",\n \"rich + (<14.0,>=13.6)\"\n ]\n }\n + \ ],\n \"summary\": \"The Azure IoT Operations + extension for Azure CLI.\",\n \"version\": \"0.2.0b4\"\n + \ },\n \"sha256Digest\": \"0c7b77c9b7dd39655ef1dc51d5bb7cc370062318d21bfeb1467ccb2fa2229ab4\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.3.0b1/azure_iot_ops-0.3.0b1-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.3.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"protobuf (~=4.25.0)\",\n \"rich + (<14.0,>=13.6)\"\n ]\n }\n + \ ],\n \"summary\": \"The Azure IoT Operations + extension for Azure CLI.\",\n \"version\": \"0.3.0b1\"\n + \ },\n \"sha256Digest\": \"31f2fd60a63f25f05d30288e79b56f051baad4698ef9d61d4bcae432a2924f43\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.3.0b2/azure_iot_ops-0.3.0b2-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.3.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"protobuf (~=4.25.0)\",\n \"rich + (<14.0,>=13.6)\"\n ]\n }\n + \ ],\n \"summary\": \"The Azure IoT Operations + extension for Azure CLI.\",\n \"version\": \"0.3.0b2\"\n + \ },\n \"sha256Digest\": \"1ddce07806ac2b529d4e98e7919aef58907d03174f33c5d96305cbfe590c13b1\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.3.0b3/azure_iot_ops-0.3.0b3-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.3.0b3-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.42.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -13688,15 +15997,15 @@ interactions: \ \"run_requires\": [\n {\n \"requires\": [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n - \ \"protobuf (~=4.25.0)\",\n \"rich - (<14.0,>=13.6)\"\n ]\n }\n - \ ],\n \"summary\": \"The Azure IoT Operations - extension for Azure CLI.\",\n \"version\": \"0.2.0b1\"\n - \ },\n \"sha256Digest\": \"0e3bcc6cf3f2eeb80c96ee0d68eb3bad356837642296bed2c6edf7b9519b8320\"\n - \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.2.0b2/azure_iot_ops-0.2.0b2-py3-none-any.whl\",\n - \ \"filename\": \"azure_iot_ops-0.2.0b2-py3-none-any.whl\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.3.0b3\"\n },\n \"sha256Digest\": \"ce5afd49b56a2647dd359d67534c86116211c38cbd83d68b73e15765c7b23b1e\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.4.0b1/azure_iot_ops-0.4.0b1-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.4.0b1-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.42.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -13722,13 +16031,287 @@ interactions: \ \"run_requires\": [\n {\n \"requires\": [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n - \ \"protobuf (~=4.25.0)\",\n \"rich - (<14.0,>=13.6)\"\n ]\n }\n - \ ],\n \"summary\": \"The Azure IoT Operations - extension for Azure CLI.\",\n \"version\": \"0.2.0b2\"\n - \ },\n \"sha256Digest\": \"eb0907428bfad9e0f974617663c2a73908887e99636ed9ec13954c767f7b741d\"\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.4.0b1\"\n },\n \"sha256Digest\": \"969d2e85305a58cd711ff7ab43a136c3ff12b7de3c07baa2f49a980dbbca7f44\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.4.0b2/azure_iot_ops-0.4.0b2-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.4.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.4.0b2\"\n },\n \"sha256Digest\": \"36898f0ebb07fc8197b62bf9d240f0067e186d306c7c52b8a01b2c4adf91bf90\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.4.0b3/azure_iot_ops-0.4.0b3-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.4.0b3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.4.0b3\"\n },\n \"sha256Digest\": \"a5cb90030bf3fe748d7f11285243f9e0c1207e5d409a320bd1f3e0e29f527de5\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.4.0b4/azure_iot_ops-0.4.0b4-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.4.0b4-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.4.0b4\"\n },\n \"sha256Digest\": \"0439ae5846b317449e427a985f4a9bf8ab91c622766c163af2f717ac024a30f5\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.5.0b1/azure_iot_ops-0.5.0b1-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.5.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.5.0b1\"\n },\n \"sha256Digest\": \"bae0b60c4a8c39689a164bddf5ffb2bd2da09fc87c9b03c2d22fc9936e10dcf4\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.5.0b2/azure_iot_ops-0.5.0b2-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.5.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.5.0b2\"\n },\n \"sha256Digest\": \"3b590acb85b946bc832244c7e6fd85bb19d5aa66dc30c8f72d37c0ea93a3d9b2\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-iot-ops-cli-extension/releases/download/v0.5.1b1/azure_iot_ops-0.5.1b1-py3-none-any.whl\",\n + \ \"filename\": \"azure_iot_ops-0.5.1b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3 :: + Only\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.8\",\n \"Programming + Language :: Python :: 3.9\",\n \"Programming Language + :: Python :: 3.10\",\n \"Programming Language :: Python + :: 3.11\"\n ],\n \"extensions\": {\n + \ \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"iotupx@microsoft.com\",\n \"name\": \"Microsoft\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-iot-ops-cli-extension\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-iot-ops\",\n \"requires_python\": \">=3.8\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-identity (<2.0,>=1.14.1)\",\n \"kubernetes + (<29.0,>=27.2)\",\n \"opentelemetry-proto (~=1.20.0)\",\n + \ \"packaging (>=23.2)\",\n \"protobuf + (~=4.25.0)\",\n \"rich (<14.0,>=13.6)\"\n ]\n + \ }\n ],\n \"summary\": + \"The Azure IoT Operations extension for Azure CLI.\",\n \"version\": + \"0.5.1b1\"\n },\n \"sha256Digest\": \"09a63dbd9dc976235fe295eb78083fa6141f52db6dde9c8c25975c23f1f79fe4\"\n \ }\n ],\n \"azure-sphere\": [\n {\n \"downloadUrl\": - \"https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66749/azure_sphere-0.1.4-py2.py3-none-any.whl\",\n + \"https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66751/azure_sphere-1.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"azure_sphere-1.0.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.45.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"Programming Language :: Python :: 3.9\",\n \"License + :: OSI Approved :: MIT License\"\n ],\n \"description_content_type\": + \"text/markdown\",\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"Microsoft Corporation \",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/azure-sphere\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-sphere\",\n \"requires_python\": \"<4,>=3.6\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-core (>=1.24.0)\",\n \"azure-core>=1.24.0\",\n + \ \"azure-mgmt-core (>=1.3.0)\",\n \"azure-mgmt-core>=1.3.0\",\n + \ \"azuresphere-device-api (>=1.1.0)\",\n \"azuresphere-device-api>=1.1.0\",\n + \ \"azuresphere-imagemetadata\",\n \"azuresphere-imagemetadata\",\n + \ \"semantic-version (==2.8.5)\",\n \"semantic_version==2.8.5\"\n + \ ]\n }\n ],\n + \ \"summary\": \"The Azure Sphere extension for Azure CLI.\",\n + \ \"version\": \"1.0.1\"\n },\n \"sha256Digest\": + \"9fcab107f8856e79943388501d148379ab782a1ffba1f997f7db3e667a7d5172\"\n },\n + \ {\n \"downloadUrl\": \"https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/azure_sphere-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"azure_sphere-1.0.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.45.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"Programming Language :: Python :: 3.9\",\n \"License + :: OSI Approved :: MIT License\"\n ],\n \"description_content_type\": + \"text/markdown\",\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"Microsoft Corporation \",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://docs.microsoft.com/azure-sphere\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"license_file\": + \"LICENSE\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azure-sphere\",\n \"requires_python\": \"<4,>=3.6\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"azure-core (>=1.24.0)\",\n \"azure-core>=1.24.0\",\n + \ \"azure-mgmt-core (>=1.3.0)\",\n \"azure-mgmt-core>=1.3.0\",\n + \ \"azuresphere-device-api (>=1.1.0)\",\n \"azuresphere-device-api>=1.1.0\",\n + \ \"azuresphere-imagemetadata\",\n \"azuresphere-imagemetadata\",\n + \ \"semantic-version (==2.8.5)\",\n \"semantic_version==2.8.5\"\n + \ ]\n }\n ],\n + \ \"summary\": \"The Azure Sphere extension for Azure CLI.\",\n + \ \"version\": \"1.0.0\"\n },\n \"sha256Digest\": + \"4baf489caaeada3feb08e5d1a3f890f2ee0dd4072a28a04c1eab7301b64293c5\"\n },\n + \ {\n \"downloadUrl\": \"https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66749/azure_sphere-0.1.4-py2.py3-none-any.whl\",\n \ \"filename\": \"azure_sphere-0.1.4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": @@ -13788,6 +16371,32 @@ interactions: \"azurelargeinstance\",\n \"summary\": \"Microsoft Azure Command-Line Tools Azurelargeinstance Extension.\",\n \"version\": \"1.0.0b1\"\n },\n \"sha256Digest\": \"a6e38c623cf14a9528df9f28aa98d9642c1e73c0a815becdce842e3a2f0f49ac\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/azurelargeinstance-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"azurelargeinstance-1.0.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/azurelargeinstance\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"azurelargeinstance\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Azurelargeinstance Extension.\",\n \"version\": + \"1.0.0b2\"\n },\n \"sha256Digest\": \"6948ac3306269ea6c8ff6d32d5673989dfd4dfa0a4e4c5d6d3991b364d5dc628\"\n \ }\n ],\n \"azurestackhci\": [\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/SelfServiceVM/CLI/azurestackhci-0.2.0-py3-none-any.whl\",\n \ \"filename\": \"azurestackhci-0.2.0-py3-none-any.whl\",\n @@ -14050,7 +16659,35 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"baremetal-infrastructure\",\n \"summary\": \"Additional commands for working with BareMetal instances.\",\n \"version\": - \"2.0.0\"\n },\n \"sha256Digest\": \"8672d29ce35b01141c2acfb9d2be5fedc78a9937d2abc9813e95ec061343264b\"\n + \"2.0.0\"\n },\n \"sha256Digest\": \"158c4e81eb6d773f523e76813f4cf6958fb0c53d08533c3dccc81edd73e593a0\"\n + \ },\n {\n \"downloadUrl\": \"https://github.com/Azure/azure-baremetalinfrastructure-cli-extension/releases/download/2.0.1/baremetal_infrastructure-2.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"baremetal_infrastructure-2.0.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.56.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 2\",\n \"Programming Language + :: Python :: 2.7\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.4\",\n + \ \"Programming Language :: Python :: 3.5\",\n \"Programming + Language :: Python :: 3.6\",\n \"Programming Language + :: Python :: 3.10\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-baremetalinfrastructure-cli-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"license_file\": \"LICENSE\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"baremetal-infrastructure\",\n \"summary\": + \"Additional commands for working with BareMetal instances.\",\n \"version\": + \"2.0.1\"\n },\n \"sha256Digest\": \"ea127d64603c8a45774cdf9aa80c4c8b5839a42719971b296beb96105fe5ef2d\"\n \ }\n ],\n \"bastion\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/bastion-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"bastion-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -14312,44 +16949,16 @@ interactions: \"bastion\",\n \"summary\": \"Microsoft Azure Command-Line Tools Bastion Extension.\",\n \"version\": \"0.3.0\"\n \ },\n \"sha256Digest\": \"c20d8e423acef3b6728c9abdfe90ad4a7020f2d122068983d7b59b9e3fef84c3\"\n - \ }\n ],\n \"billing-benefits\": [\n {\n - \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/billing_benefits-0.1.0-py3-none-any.whl\",\n - \ \"filename\": \"billing_benefits-0.1.0-py3-none-any.whl\",\n - \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.43.0\",\n \"classifiers\": - [\n \"Development Status :: 4 - Beta\",\n \"Intended - Audience :: Developers\",\n \"Intended Audience :: - System Administrators\",\n \"Programming Language :: - Python\",\n \"Programming Language :: Python :: 3\",\n - \ \"Programming Language :: Python :: 3.7\",\n \"Programming - Language :: Python :: 3.8\",\n \"Programming Language - :: Python :: 3.9\",\n \"License :: OSI Approved :: - MIT License\"\n ],\n \"extensions\": - {\n \"python.details\": {\n \"contacts\": - [\n {\n \"email\": - \"azpycli@microsoft.com\",\n \"name\": - \"Microsoft Corporation\",\n \"role\": - \"author\"\n }\n ],\n - \ \"document_names\": {\n \"description\": - \"DESCRIPTION.rst\"\n },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/billing-benefits\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"billing-benefits\",\n \"summary\": \"Microsoft Azure - Command-Line Tools BillingBenefits Extension.\",\n \"version\": - \"0.1.0\"\n },\n \"sha256Digest\": \"f71250d1c26690cc0e175cd5c9bcd59e76c7b701bb3a47c8273e4cf8bcca878e\"\n - \ }\n ],\n \"blockchain\": [\n {\n \"downloadUrl\": - \"https://azurecliprod.blob.core.windows.net/cli-extensions/blockchain-0.1.0-py3-none-any.whl\",\n - \ \"filename\": \"blockchain-0.1.0-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": - \"2.3.1\",\n \"classifiers\": [\n \"Development + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/bastion-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"bastion-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.43.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \ \"License :: OSI Approved :: MIT License\"\n ],\n \ \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n @@ -14359,23 +16968,23 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/bastion\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"blockchain\",\n \"summary\": \"Microsoft Azure Command-Line - Tools BlockchainManagementClient Extension\",\n \"version\": - \"0.1.0\"\n },\n \"sha256Digest\": \"ba0001dffaf39d133604c4281ed9c943f178a16a91d31f5889bf1587d9871049\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/blockchain-0.1.1-py3-none-any.whl\",\n - \ \"filename\": \"blockchain-0.1.1-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": - \"2.3.1\",\n \"classifiers\": [\n \"Development + \"bastion\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Bastion Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"39b1468f0741f640294e2b9f258bf9fd46541e061b913003c70756f5298fed42\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/bastion-1.0.1-py3-none-any.whl\",\n + \ \"filename\": \"bastion-1.0.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.43.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \ \"License :: OSI Approved :: MIT License\"\n ],\n \ \"extensions\": {\n \"python.details\": {\n \"contacts\": [\n {\n @@ -14385,13 +16994,40 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/blockchain\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/bastion\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"bastion\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Bastion Extension.\",\n \"version\": \"1.0.1\"\n + \ },\n \"sha256Digest\": \"dbeef63e7b5c45028b7362709f9b41b250fe8d611b21baa00b8839d86848dc3e\"\n + \ }\n ],\n \"billing-benefits\": [\n {\n + \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/billing_benefits-0.1.0-py3-none-any.whl\",\n + \ \"filename\": \"billing_benefits-0.1.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.43.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/billing-benefits\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"blockchain\",\n \"summary\": \"Microsoft Azure Command-Line - Tools BlockchainManagementClient Extension\",\n \"version\": - \"0.1.1\"\n },\n \"sha256Digest\": \"95a4788ab10052f6c1b4122db6ab140705db528e5cb3db3358580d703a2a7204\"\n + \"billing-benefits\",\n \"summary\": \"Microsoft Azure + Command-Line Tools BillingBenefits Extension.\",\n \"version\": + \"0.1.0\"\n },\n \"sha256Digest\": \"f71250d1c26690cc0e175cd5c9bcd59e76c7b701bb3a47c8273e4cf8bcca878e\"\n \ }\n ],\n \"blueprint\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/blueprint-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"blueprint-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -14741,9 +17377,39 @@ interactions: \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools ComputeManagementClient Extension\",\n \ \"version\": \"0.2.0\"\n },\n \"sha256Digest\": - \"ee7ca3a5eaa801ceea9173f2ff0a429600bff9e9339d504071c0283b56facec4\"\n }\n - \ ],\n \"command-change\": [\n {\n \"downloadUrl\": - \"https://azcliprod.blob.core.windows.net/cli-extensions/command_change-1.0.0b1-py3-none-any.whl\",\n + \"ee7ca3a5eaa801ceea9173f2ff0a429600bff9e9339d504071c0283b56facec4\"\n },\n + \ {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/cloud_service-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"cloud_service-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/cloudservice\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"cloud-service\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-compute (~=30.4.0)\",\n \"azure-mgmt-compute~=30.4.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools ComputeManagementClient + Extension\",\n \"version\": \"1.0.0\"\n },\n + \ \"sha256Digest\": \"4e2ee7e468b23bff594e99059b8b279485f28a2dbe9a99f82fdf9f48cce82f13\"\n + \ }\n ],\n \"command-change\": [\n {\n + \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/command_change-1.0.0b1-py3-none-any.whl\",\n \ \"filename\": \"command_change-1.0.0b1-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.19.0\",\n \"classifiers\": @@ -15385,6 +18051,225 @@ interactions: \ \"summary\": \"Microsoft Azure Command-Line Tools CommunicationServiceManagementClient Extension\",\n \"version\": \"1.8.0b1\"\n },\n \ \"sha256Digest\": \"abb0ef12397d598b82cb08493b3ffa656aa94fa1e172db43b07d013ecece1e39\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/communication-1.8.0b2-py3-none-any.whl\",\n + \ \"filename\": \"communication-1.8.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.55.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/communication\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"communication\",\n \"requires_python\": + \">=3.7\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"azure-communication-chat\",\n + \ \"azure-communication-chat\",\n \"azure-communication-email + (>=1.0.0)\",\n \"azure-communication-email>=1.0.0\",\n + \ \"azure-communication-identity (>=1.2.0)\",\n + \ \"azure-communication-identity>=1.2.0\",\n + \ \"azure-communication-phonenumbers\",\n \"azure-communication-phonenumbers\",\n + \ \"azure-communication-rooms (>=1.1.0b1)\",\n + \ \"azure-communication-rooms>=1.1.0b1\",\n + \ \"azure-communication-sms\",\n \"azure-communication-sms\",\n + \ \"azure-core\",\n \"azure-core\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools CommunicationServiceManagementClient + Extension\",\n \"version\": \"1.8.0b2\"\n },\n + \ \"sha256Digest\": \"55651fe9d1f21cc8d3b84b5c71b7cb0f6ab81296c44fac2c5942e42939805817\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/communication-1.9.0-py3-none-any.whl\",\n + \ \"filename\": \"communication-1.9.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/communication\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"communication\",\n \"requires_python\": + \">=3.7\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"azure-communication-chat\",\n + \ \"azure-communication-chat\",\n \"azure-communication-email + (>=1.0.0)\",\n \"azure-communication-email>=1.0.0\",\n + \ \"azure-communication-identity (>=1.2.0)\",\n + \ \"azure-communication-identity>=1.2.0\",\n + \ \"azure-communication-phonenumbers\",\n \"azure-communication-phonenumbers\",\n + \ \"azure-communication-rooms (>=1.1.0b1)\",\n + \ \"azure-communication-rooms>=1.1.0b1\",\n + \ \"azure-communication-sms\",\n \"azure-communication-sms\",\n + \ \"azure-core\",\n \"azure-core\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools CommunicationServiceManagementClient + Extension\",\n \"version\": \"1.9.0\"\n },\n + \ \"sha256Digest\": \"4aa39f0877ca36f28cd3106e3e774212cce1b82441ad0e7d3aba952cd4520e5b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/communication-1.9.1-py3-none-any.whl\",\n + \ \"filename\": \"communication-1.9.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/communication\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"communication\",\n \"requires_python\": + \">=3.7\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"azure-communication-chat\",\n + \ \"azure-communication-chat\",\n \"azure-communication-email + (>=1.0.0)\",\n \"azure-communication-email>=1.0.0\",\n + \ \"azure-communication-identity (>=1.2.0)\",\n + \ \"azure-communication-identity>=1.2.0\",\n + \ \"azure-communication-phonenumbers\",\n \"azure-communication-phonenumbers\",\n + \ \"azure-communication-rooms (>=1.1.0b1)\",\n + \ \"azure-communication-rooms>=1.1.0b1\",\n + \ \"azure-communication-sms\",\n \"azure-communication-sms\",\n + \ \"azure-core\",\n \"azure-core\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools CommunicationServiceManagementClient + Extension\",\n \"version\": \"1.9.1\"\n },\n + \ \"sha256Digest\": \"4a84fd19c598286dc1185e7c7b783fccef64f122bb13743a0483f026bf98a036\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/communication-1.9.2-py3-none-any.whl\",\n + \ \"filename\": \"communication-1.9.2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.59.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/communication\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"communication\",\n \"requires_python\": + \">=3.7\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"azure-communication-chat + (>=1.3.0)\",\n \"azure-communication-chat>=1.3.0\",\n + \ \"azure-communication-email (>=1.0.0)\",\n + \ \"azure-communication-email>=1.0.0\",\n \"azure-communication-identity + (>=1.2.0)\",\n \"azure-communication-identity>=1.2.0\",\n + \ \"azure-communication-phonenumbers (>=1.2.0b3)\",\n + \ \"azure-communication-phonenumbers>=1.2.0b3\",\n + \ \"azure-communication-rooms (>=1.1.0)\",\n + \ \"azure-communication-rooms>=1.1.0\",\n \"azure-communication-sms\",\n + \ \"azure-communication-sms\",\n \"azure-core\",\n + \ \"azure-core\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools CommunicationServiceManagementClient + Extension\",\n \"version\": \"1.9.2\"\n },\n + \ \"sha256Digest\": \"7d41e4841b3706e1f7145c1e496b6a26e269792fff400b225c695e6593f3376d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/communication-1.9.3-py3-none-any.whl\",\n + \ \"filename\": \"communication-1.9.3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.59.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/communication\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"communication\",\n \"requires_python\": + \">=3.7\",\n \"run_requires\": [\n {\n + \ \"requires\": [\n \"azure-communication-chat + (>=1.3.0)\",\n \"azure-communication-chat>=1.3.0\",\n + \ \"azure-communication-email (>=1.0.0)\",\n + \ \"azure-communication-email>=1.0.0\",\n \"azure-communication-identity + (>=1.2.0)\",\n \"azure-communication-identity>=1.2.0\",\n + \ \"azure-communication-phonenumbers (>=1.2.0b3)\",\n + \ \"azure-communication-phonenumbers>=1.2.0b3\",\n + \ \"azure-communication-rooms (>=1.1.0)\",\n + \ \"azure-communication-rooms>=1.1.0\",\n \"azure-communication-sms\",\n + \ \"azure-communication-sms\",\n \"azure-core\",\n + \ \"azure-core\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools CommunicationServiceManagementClient + Extension\",\n \"version\": \"1.9.3\"\n },\n + \ \"sha256Digest\": \"44cd8bee4797ccb20bf522e8a98bc5fc88ad326aabd10ac62d789738b672c92f\"\n + \ }\n ],\n \"compute-diagnostic-rp\": [\n {\n + \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/compute_diagnostic_rp-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"compute_diagnostic_rp-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/compute-diagnostic-rp\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"compute-diagnostic-rp\",\n \"summary\": \"Microsoft Azure + Command-Line Tools ComputeDiagnosticRp Extension.\",\n \"version\": + \"1.0.0b1\"\n },\n \"sha256Digest\": \"810e93ce00c7d03df6da9a0faf57b966fb6da582311f9cae74b2b7e1e3c41423\"\n \ }\n ],\n \"confcom\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.2.10-py3-none-any.whl\",\n \ \"filename\": \"confcom-0.2.10-py3-none-any.whl\",\n \"metadata\": @@ -15606,14 +18491,80 @@ interactions: \"2.0\",\n \"name\": \"confcom\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"deepdiff (==6.3.0)\",\n \"deepdiff==6.3.0\",\n - \ \"docker (==6.0.1)\",\n \"docker==6.0.1\",\n + \ \"docker (==6.0.1)\",\n \"docker==6.0.1\",\n + \ \"tqdm (==4.65.0)\",\n \"tqdm==4.65.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential + Container Security Policy Generator Extension\",\n \"version\": + \"0.2.17\"\n },\n \"sha256Digest\": \"46c3b0007c005bce38579b37e22e02e41b5a11139b5a9028dbefab116fe2c264\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.2.18-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.2.18-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"acccli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/confcom\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"confcom\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"deepdiff (==6.3.0)\",\n \"deepdiff==6.3.0\",\n + \ \"docker (>=6.1.0)\",\n \"docker>=6.1.0\",\n + \ \"tqdm (==4.65.0)\",\n \"tqdm==4.65.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential + Container Security Policy Generator Extension\",\n \"version\": + \"0.2.18\"\n },\n \"sha256Digest\": \"8a3dace12da4985a78fa2a765b7a3a69c28be45a3013a210f00f773ec70e5177\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.0-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.3.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"acccli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/confcom\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"confcom\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"deepdiff (==6.3.0)\",\n \"deepdiff==6.3.0\",\n + \ \"docker (>=6.1.0)\",\n \"docker>=6.1.0\",\n \ \"tqdm (==4.65.0)\",\n \"tqdm==4.65.0\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension\",\n \"version\": - \"0.2.17\"\n },\n \"sha256Digest\": \"46c3b0007c005bce38579b37e22e02e41b5a11139b5a9028dbefab116fe2c264\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.2.18-py3-none-any.whl\",\n - \ \"filename\": \"confcom-0.2.18-py3-none-any.whl\",\n \"metadata\": + \"0.3.0\"\n },\n \"sha256Digest\": \"9681fb1b05c1505dbd85333d475fc5d50c9144514ca1e4bf3ec041c2754249e4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.1-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.3.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -15644,9 +18595,9 @@ interactions: \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension\",\n \"version\": - \"0.2.18\"\n },\n \"sha256Digest\": \"8a3dace12da4985a78fa2a765b7a3a69c28be45a3013a210f00f773ec70e5177\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.0-py3-none-any.whl\",\n - \ \"filename\": \"confcom-0.3.0-py3-none-any.whl\",\n \"metadata\": + \"0.3.1\"\n },\n \"sha256Digest\": \"7625b50a59e91c96cdd3ab92a392ae1bae543bc284819690a3996dc041cf5668\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.2-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.3.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -15677,9 +18628,9 @@ interactions: \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension\",\n \"version\": - \"0.3.0\"\n },\n \"sha256Digest\": \"9681fb1b05c1505dbd85333d475fc5d50c9144514ca1e4bf3ec041c2754249e4\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.1-py3-none-any.whl\",\n - \ \"filename\": \"confcom-0.3.1-py3-none-any.whl\",\n \"metadata\": + \"0.3.2\"\n },\n \"sha256Digest\": \"e71178449eeab3cba46c3049dd09d56481e39dc0efa5252f3ccaccf65db4ab8b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.3-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.3.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -15710,9 +18661,9 @@ interactions: \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension\",\n \"version\": - \"0.3.1\"\n },\n \"sha256Digest\": \"7625b50a59e91c96cdd3ab92a392ae1bae543bc284819690a3996dc041cf5668\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.2-py3-none-any.whl\",\n - \ \"filename\": \"confcom-0.3.2-py3-none-any.whl\",\n \"metadata\": + \"0.3.3\"\n },\n \"sha256Digest\": \"473b131008a5af987dcaf2bc54ef183fb2568a43f874ef6ff26a908a82ec0d86\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.4-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.3.4-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -15743,9 +18694,9 @@ interactions: \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension\",\n \"version\": - \"0.3.2\"\n },\n \"sha256Digest\": \"e71178449eeab3cba46c3049dd09d56481e39dc0efa5252f3ccaccf65db4ab8b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.3-py3-none-any.whl\",\n - \ \"filename\": \"confcom-0.3.3-py3-none-any.whl\",\n \"metadata\": + \"0.3.4\"\n },\n \"sha256Digest\": \"3de7244ea8f1c93621e1aac801be0495cd346dfcb2011aa59632cd134be6c16c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confcom-0.3.5-py3-none-any.whl\",\n + \ \"filename\": \"confcom-0.3.5-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.26.2\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -15776,7 +18727,7 @@ interactions: \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension\",\n \"version\": - \"0.3.3\"\n },\n \"sha256Digest\": \"473b131008a5af987dcaf2bc54ef183fb2568a43f874ef6ff26a908a82ec0d86\"\n + \"0.3.5\"\n },\n \"sha256Digest\": \"b8f8dccd506a69c8a3470f17c864d079b55580cc2f4f5fbc96db2f45c61fb651\"\n \ }\n ],\n \"confidentialledger\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confidentialledger-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"confidentialledger-0.1.0-py3-none-any.whl\",\n @@ -15935,6 +18886,31 @@ interactions: \"confluent\",\n \"summary\": \"Microsoft Azure Command-Line Tools ConfluentManagementClient Extension\",\n \"version\": \"0.4.0\"\n },\n \"sha256Digest\": \"7b812940a77094bc916c745a61b7732966de4e7943a7541c0a402c0d912bc6af\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/confluent-0.6.0-py3-none-any.whl\",\n + \ \"filename\": \"confluent-0.6.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/confluent\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"confluent\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ConfluentManagementClient Extension\",\n \"version\": + \"0.6.0\"\n },\n \"sha256Digest\": \"7987d22e0e9cada28087a900bfa534865531941f2bbfe967eb46c90b2e0a12be\"\n \ }\n ],\n \"connectedk8s\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/connectedk8s-0.1.5-py3-none-any.whl\",\n \ \"filename\": \"connectedk8s-0.1.5-py3-none-any.whl\",\n \"metadata\": @@ -16775,14 +19751,225 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"kubernetes (==11.0.0)\",\n \"pycryptodome - (==3.9.8)\"\n ]\n }\n ],\n + (==3.9.8)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.5\"\n },\n + \ \"sha256Digest\": \"fd0bc6f534e5a9e72fe6585031eeb29655d05f2cac4f505804bc6052a52c5fcd\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.2.6-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.23.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.9.8)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.6\"\n },\n + \ \"sha256Digest\": \"473e31ada7636316304b2a39a76654722a0f5409bf8a2ffddf196ccc42df10a4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.7-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.2.7-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.16.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.9.8)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.7\"\n },\n + \ \"sha256Digest\": \"3f13d1b95c89865a8bdc0d40323956d599305892a54085e1115866b429ab2fa1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.8-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.2.8-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.16.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.8\"\n },\n + \ \"sha256Digest\": \"df97793b98a0f8e2e70f8a7942c6d65b9e581c54cf3f7632d4c48f01b2426a09\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.9-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.2.9-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.16.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.9\"\n },\n + \ \"sha256Digest\": \"06cb4e2aa841abeb712b9e564748c28b14cc49cc30cd65b05730f633120c7666\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.10-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.2.10-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.16.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.10\"\n },\n + \ \"sha256Digest\": \"f470e60e651201635e358411d9e07f0a9519fa059ca33f5543a9bff2982d8998\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.11-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.2.11-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.16.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.2.11\"\n },\n + \ \"sha256Digest\": \"0cc9fb7514b040ec8deb4269282c16a1d382c95a3b3a7def04ed6e795f85d62d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.30.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n + \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.5\"\n },\n - \ \"sha256Digest\": \"fd0bc6f534e5a9e72fe6585031eeb29655d05f2cac4f505804bc6052a52c5fcd\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.6-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.2.6-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.1\"\n },\n + \ \"sha256Digest\": \"b728b34c4c3edf32744d092cd915f62f4d4898e959214014905807c136518e94\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.23.0\",\n \"classifiers\": [\n \"Development + \"2.30.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16804,15 +19991,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n \ \"kubernetes (==11.0.0)\",\n \"pycryptodome - (==3.9.8)\"\n ]\n }\n ],\n + (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.6\"\n },\n - \ \"sha256Digest\": \"473e31ada7636316304b2a39a76654722a0f5409bf8a2ffddf196ccc42df10a4\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.7-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.2.7-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.2\"\n },\n + \ \"sha256Digest\": \"e392698b2f1f7a545f0f0c40cca2c17ba74cdd47db2299b7eaea1d3e0b6595a9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.16.0\",\n \"classifiers\": [\n \"Development + \"2.30.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16834,15 +20022,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n \ \"kubernetes (==11.0.0)\",\n \"pycryptodome - (==3.9.8)\"\n ]\n }\n ],\n + (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.7\"\n },\n - \ \"sha256Digest\": \"3f13d1b95c89865a8bdc0d40323956d599305892a54085e1115866b429ab2fa1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.8-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.2.8-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.3\"\n },\n + \ \"sha256Digest\": \"1a42dd74a1c4d8552ed57112314da641a8e78acc1ba7ec763ebecc390b5aaf9c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.4-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.16.0\",\n \"classifiers\": [\n \"Development + \"2.30.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16864,15 +20053,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n \ \"kubernetes (==11.0.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.8\"\n },\n - \ \"sha256Digest\": \"df97793b98a0f8e2e70f8a7942c6d65b9e581c54cf3f7632d4c48f01b2426a09\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.9-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.2.9-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.4\"\n },\n + \ \"sha256Digest\": \"83ed63bb821ae47b944b6d2e4894229bfc76e9b0cefec8b73a0c74f9ea44e833\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.5-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.5-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.16.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16894,15 +20084,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.9\"\n },\n - \ \"sha256Digest\": \"06cb4e2aa841abeb712b9e564748c28b14cc49cc30cd65b05730f633120c7666\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.10-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.2.10-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.5\"\n },\n + \ \"sha256Digest\": \"17ba7dd032c87e7ff4b9cce298dd81171e6e75bcfe2912f7c2f3cd1f55c00d11\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.6-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.16.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16924,15 +20115,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.10\"\n },\n - \ \"sha256Digest\": \"f470e60e651201635e358411d9e07f0a9519fa059ca33f5543a9bff2982d8998\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.2.11-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.2.11-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.6\"\n },\n + \ \"sha256Digest\": \"5c0c55940802239372608d9c7faf1c76e4f2f2fef5ebbd36be7011ae854a7563\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.7-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.7-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.16.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16954,15 +20146,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.2.11\"\n },\n - \ \"sha256Digest\": \"0cc9fb7514b040ec8deb4269282c16a1d382c95a3b3a7def04ed6e795f85d62d\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.1-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.7\"\n },\n + \ \"sha256Digest\": \"5a62c4c4e6e27e0e9f5522b12118ce5dcb227fd42f2ac03495cafd8fd9a3bcba\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.8-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.8-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.30.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -16985,15 +20178,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.1\"\n },\n - \ \"sha256Digest\": \"b728b34c4c3edf32744d092cd915f62f4d4898e959214014905807c136518e94\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.2-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.8\"\n },\n + \ \"sha256Digest\": \"a2ca94688926fb98cece7b8624c5dd7cf9e6ae69eeb1bc9f1dd525ae1abdc95e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.9-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.9-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.30.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -17016,15 +20209,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.2\"\n },\n - \ \"sha256Digest\": \"e392698b2f1f7a545f0f0c40cca2c17ba74cdd47db2299b7eaea1d3e0b6595a9\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.3-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.3-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.9\"\n },\n + \ \"sha256Digest\": \"ad770af71a013785229d287705580e6b9815cafb7e10fb09c07b917baba813a0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.10-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.10-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.30.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -17047,15 +20240,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.3\"\n },\n - \ \"sha256Digest\": \"1a42dd74a1c4d8552ed57112314da641a8e78acc1ba7ec763ebecc390b5aaf9c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.4-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.4-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.10\"\n },\n + \ \"sha256Digest\": \"e2c5055b87d3529d90574e67988e7cf7efabf8ce3515bb2e1017ae613bcc89a1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.11-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.11-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.30.0\",\n \"classifiers\": [\n \"Development + \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -17078,13 +20271,13 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==11.0.0)\",\n \"pycryptodome + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.4\"\n },\n - \ \"sha256Digest\": \"83ed63bb821ae47b944b6d2e4894229bfc76e9b0cefec8b73a0c74f9ea44e833\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.5-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.5-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.11\"\n },\n + \ \"sha256Digest\": \"1587e042d7e37ca66d7cdff96f06f334e388e01689efdbf1622daff5d56182e1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.12-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.12-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17112,10 +20305,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.5\"\n },\n - \ \"sha256Digest\": \"17ba7dd032c87e7ff4b9cce298dd81171e6e75bcfe2912f7c2f3cd1f55c00d11\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.6-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.6-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.12\"\n },\n + \ \"sha256Digest\": \"1b2613fe1d4a12eb5cdcf3d57189d4a3213d572fdf0c67146d8d7cd5910190ac\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.13-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.13-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17143,10 +20336,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.6\"\n },\n - \ \"sha256Digest\": \"5c0c55940802239372608d9c7faf1c76e4f2f2fef5ebbd36be7011ae854a7563\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.7-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.7-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.13\"\n },\n + \ \"sha256Digest\": \"6e145db641dd77cd5d73271562f74f70d9bc4171bec05449b7722d54eb1e0ba2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.14-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.14-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17174,10 +20367,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.7\"\n },\n - \ \"sha256Digest\": \"5a62c4c4e6e27e0e9f5522b12118ce5dcb227fd42f2ac03495cafd8fd9a3bcba\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.8-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.8-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.14\"\n },\n + \ \"sha256Digest\": \"06f3da32b2bb7f9b967da242824bceb89ed98ccde37ef18d5e33a17d5158d6b9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.15-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.15-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17205,10 +20398,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.8\"\n },\n - \ \"sha256Digest\": \"a2ca94688926fb98cece7b8624c5dd7cf9e6ae69eeb1bc9f1dd525ae1abdc95e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.9-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.9-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.15\"\n },\n + \ \"sha256Digest\": \"719aa6e73bd25309ab1275ec06cce036cb650204e306606bee741e2488b0a1d2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.16-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.16-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17236,10 +20429,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.9\"\n },\n - \ \"sha256Digest\": \"ad770af71a013785229d287705580e6b9815cafb7e10fb09c07b917baba813a0\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.10-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.10-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.16\"\n },\n + \ \"sha256Digest\": \"614823c043de311a609cd257176cf611e56ddec8f6f3855ed444d77519dc50e6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.17-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.17-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17267,10 +20460,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.10\"\n },\n - \ \"sha256Digest\": \"e2c5055b87d3529d90574e67988e7cf7efabf8ce3515bb2e1017ae613bcc89a1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.11-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.11-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.17\"\n },\n + \ \"sha256Digest\": \"3be716e8862c6c67da236e17f0a88e369da5ac41e6d5cb350e40166eed7953e2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.18-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.18-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17298,10 +20491,10 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.11\"\n },\n - \ \"sha256Digest\": \"1587e042d7e37ca66d7cdff96f06f334e388e01689efdbf1622daff5d56182e1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.12-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.12-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.18\"\n },\n + \ \"sha256Digest\": \"69b91412f1df60a38bac3b5965dc438537f6dd66176e561cc0f145be4f1c6ef3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.19-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.19-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17329,10 +20522,72 @@ interactions: \ \"kubernetes (==24.2.0)\",\n \"pycryptodome (==3.14.1)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.12\"\n },\n - \ \"sha256Digest\": \"1b2613fe1d4a12eb5cdcf3d57189d4a3213d572fdf0c67146d8d7cd5910190ac\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.13-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.13-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.3.19\"\n },\n + \ \"sha256Digest\": \"c7a8bde1873739b3a97ccf6d343d483fe18e475f19e601e29a607b299503c3bd\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.20-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.3.20-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.3.20\"\n },\n + \ \"sha256Digest\": \"3d09e173ad23cbaaa45736b699dc48f7704ac31eadb14eec72b89ec101d674f1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.4.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.4.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/markdown\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"k8connect@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedk8s\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n + \ \"kubernetes (==24.2.0)\",\n \"pycryptodome + (==3.14.1)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s + Extension\",\n \"version\": \"1.4.0\"\n },\n + \ \"sha256Digest\": \"f7685ff5b3e92480db3317cf5cdea31c5a5e8c4527356455df106c644c752c57\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.4.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.4.1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17357,13 +20612,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.13\"\n },\n - \ \"sha256Digest\": \"6e145db641dd77cd5d73271562f74f70d9bc4171bec05449b7722d54eb1e0ba2\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.14-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.14-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.4.1\"\n },\n + \ \"sha256Digest\": \"3d4346bc58d8a0973a49af816a8e5538d52f99c4a3392af067cf50d5a58647a9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.4.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.4.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17388,13 +20645,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.14\"\n },\n - \ \"sha256Digest\": \"06f3da32b2bb7f9b967da242824bceb89ed98ccde37ef18d5e33a17d5158d6b9\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.15-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.15-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.4.2\"\n },\n + \ \"sha256Digest\": \"1e23c1da9442b6adcef2422c20ee5395bfc6c2cd3e56d412b82731d2b795fc45\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.5.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17419,13 +20678,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.15\"\n },\n - \ \"sha256Digest\": \"719aa6e73bd25309ab1275ec06cce036cb650204e306606bee741e2488b0a1d2\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.16-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.16-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.5.2\"\n },\n + \ \"sha256Digest\": \"754b410778653117b3a0f36039f00b610f8137e0274fd0070cb45eefd5eef6b8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.5.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17450,13 +20711,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.16\"\n },\n - \ \"sha256Digest\": \"614823c043de311a609cd257176cf611e56ddec8f6f3855ed444d77519dc50e6\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.17-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.17-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.5.3\"\n },\n + \ \"sha256Digest\": \"3eb8986e7298f36a586d5d63a0a2581f378df974b972e66553d38ce1bab39fd2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.4-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.5.4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17481,13 +20744,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.17\"\n },\n - \ \"sha256Digest\": \"3be716e8862c6c67da236e17f0a88e369da5ac41e6d5cb350e40166eed7953e2\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.18-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.18-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.5.4\"\n },\n + \ \"sha256Digest\": \"6b0725e0873af82a9f503bc3911ab5bef2c34db21b9a64eb8489769055a7a1dc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.5.6-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17512,13 +20777,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.18\"\n },\n - \ \"sha256Digest\": \"69b91412f1df60a38bac3b5965dc438537f6dd66176e561cc0f145be4f1c6ef3\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.19-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.19-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.5.6\"\n },\n + \ \"sha256Digest\": \"2b40520407824ce59cecd0977e31af5a16c0695e9c68b383e388472b059fd82c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.0-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17543,13 +20810,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.19\"\n },\n - \ \"sha256Digest\": \"c7a8bde1873739b3a97ccf6d343d483fe18e475f19e601e29a607b299503c3bd\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.3.20-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.3.20-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.0\"\n },\n + \ \"sha256Digest\": \"945e3ede6eefa3c66a3b4104f9d7609e10dcadd989544bcd5984d0fa161185bf\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17574,13 +20843,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.3.20\"\n },\n - \ \"sha256Digest\": \"3d09e173ad23cbaaa45736b699dc48f7704ac31eadb14eec72b89ec101d674f1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.4.0-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.4.0-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.1\"\n },\n + \ \"sha256Digest\": \"ba81e9fa53a7a5059fa67a81b5a2c1b7ff460adcc5dbb560ba1802afafc13619\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17605,13 +20876,15 @@ interactions: \"2.0\",\n \"name\": \"connectedk8s\",\n \"run_requires\": [\n {\n \"requires\": [\n \ \"azure-mgmt-hybridcompute (==7.0.0)\",\n - \ \"kubernetes (==24.2.0)\",\n \"pycryptodome - (==3.14.1)\"\n ]\n }\n ],\n + \ \"azure-mgmt-hybridcompute==7.0.0\",\n \"kubernetes + (==24.2.0)\",\n \"kubernetes==24.2.0\",\n \"pycryptodome + (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.4.0\"\n },\n - \ \"sha256Digest\": \"f7685ff5b3e92480db3317cf5cdea31c5a5e8c4527356455df106c644c752c57\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.4.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.4.1-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.2\"\n },\n + \ \"sha256Digest\": \"a189a6b8cab490ca921efb085e5dde42605a817051d615f9ed43a127955bae5a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17641,10 +20914,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.4.1\"\n },\n - \ \"sha256Digest\": \"3d4346bc58d8a0973a49af816a8e5538d52f99c4a3392af067cf50d5a58647a9\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.4.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.4.2-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.3\"\n },\n + \ \"sha256Digest\": \"04609310d99babb5b07bb6159a6f5c2c6ea58f758505af95a206f88ae33f7701\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.5-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.5-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17674,10 +20947,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.4.2\"\n },\n - \ \"sha256Digest\": \"1e23c1da9442b6adcef2422c20ee5395bfc6c2cd3e56d412b82731d2b795fc45\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.5.2-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.5\"\n },\n + \ \"sha256Digest\": \"c180bdaa2caed3a613f5775ece064b68c12e9073aa19c88bbd96169a48506eb7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.6-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17707,10 +20980,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.5.2\"\n },\n - \ \"sha256Digest\": \"754b410778653117b3a0f36039f00b610f8137e0274fd0070cb45eefd5eef6b8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.3-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.5.3-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.6\"\n },\n + \ \"sha256Digest\": \"285f5c379fcdf1ff1467f1f2f95d2b1f40dc824104f2df294a86f9823617b22e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.7-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.7-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17740,10 +21013,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.5.3\"\n },\n - \ \"sha256Digest\": \"3eb8986e7298f36a586d5d63a0a2581f378df974b972e66553d38ce1bab39fd2\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.4-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.5.4-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.7\"\n },\n + \ \"sha256Digest\": \"e9729cfadfb96f6842e880df2fc784800f5b6c65f2252c69c6167290f0862a2d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.8-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.6.8-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17773,10 +21046,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.5.4\"\n },\n - \ \"sha256Digest\": \"6b0725e0873af82a9f503bc3911ab5bef2c34db21b9a64eb8489769055a7a1dc\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.5.6-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.5.6-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.6.8\"\n },\n + \ \"sha256Digest\": \"4acaa0c9e22f6d4ecf97af1ae623972e2e76ed2b2f0ced0999a83a4de5ebecb9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.7.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.7.0-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17806,10 +21079,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.5.6\"\n },\n - \ \"sha256Digest\": \"2b40520407824ce59cecd0977e31af5a16c0695e9c68b383e388472b059fd82c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.0-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.6.0-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.7.0\"\n },\n + \ \"sha256Digest\": \"27494835cb177bd230126a21ebdc4efb0a33389832073d3fcab1a75661943804\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.7.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.7.1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17839,10 +21112,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.6.0\"\n },\n - \ \"sha256Digest\": \"945e3ede6eefa3c66a3b4104f9d7609e10dcadd989544bcd5984d0fa161185bf\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.6.1-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.7.1\"\n },\n + \ \"sha256Digest\": \"56428abd1dc513cdb2602a1c23fc4d566d854597f52b0d7dbe865be29d308806\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.7.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.7.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17872,10 +21145,10 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.6.1\"\n },\n - \ \"sha256Digest\": \"ba81e9fa53a7a5059fa67a81b5a2c1b7ff460adcc5dbb560ba1802afafc13619\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.6.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedk8s-1.6.2-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"1.7.2\"\n },\n + \ \"sha256Digest\": \"049e559a8db6fa28b444d3ec6478157da18e8abe69f3500f31783535cd30bddc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.7.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedk8s-1.7.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -17905,8 +21178,8 @@ interactions: (==3.14.1)\",\n \"pycryptodome==3.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Connectedk8s - Extension\",\n \"version\": \"1.6.2\"\n },\n - \ \"sha256Digest\": \"a189a6b8cab490ca921efb085e5dde42605a817051d615f9ed43a127955bae5a\"\n + Extension\",\n \"version\": \"1.7.3\"\n },\n + \ \"sha256Digest\": \"66a5ac7202ac385340423c5a62a8e53dc27a2e670fbc0e336e2d70265c5a5d6e\"\n \ }\n ],\n \"connectedmachine\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/connectedmachine-0.1.1-py2.py3-none-any.whl\",\n \ \"filename\": \"connectedmachine-0.1.1-py2.py3-none-any.whl\",\n @@ -18134,6 +21407,32 @@ interactions: \"connectedmachine\",\n \"summary\": \"Microsoft Azure Command-Line Tools ConnectedMachine Extension\",\n \"version\": \"0.7.0\"\n },\n \"sha256Digest\": \"792975ebf0260767481b2ffab0aa3154509c55a9ab60c7f987c3fdead726cd82\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedmachine-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"connectedmachine-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedmachine\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"connectedmachine\",\n \"summary\": \"Microsoft Azure + Command-Line Tools ConnectedMachine Extension\",\n \"version\": + \"1.0.0b1\"\n },\n \"sha256Digest\": \"f829b171bc489bd1bffea518040acc74608581dae798f4b23bedfe8bf7445383\"\n \ }\n ],\n \"connectedvmware\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.1.2-py2.py3-none-any.whl\",\n \ \"filename\": \"connectedvmware-0.1.2-py2.py3-none-any.whl\",\n @@ -18439,10 +21738,91 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Connectedvmware Extension\",\n \"version\": \"0.1.12\"\n - \ },\n \"sha256Digest\": \"cd36eaa8d02f7fd4e0645884a31e8636630d49e1d1205461f0816edbd03ed4ad\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.0-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedvmware-0.2.0-py2.py3-none-any.whl\",\n + Tools Connectedvmware Extension\",\n \"version\": \"0.1.12\"\n + \ },\n \"sha256Digest\": \"cd36eaa8d02f7fd4e0645884a31e8636630d49e1d1205461f0816edbd03ed4ad\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-0.2.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": + \"2.0.67\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"arcprivatecloudsfte@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Connectedvmware Extension\",\n \"version\": \"0.2.0\"\n + \ },\n \"sha256Digest\": \"1b28904817cc5115f69a9d312c6ce6f829ba2dd20e6aeecf3965cfccb43d063d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-0.2.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": + \"2.0.67\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"arcprivatecloudsfte@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Connectedvmware Extension\",\n \"version\": \"0.2.1\"\n + \ },\n \"sha256Digest\": \"bfb72a51e7163f946caa4ed1dbf04e92a64ffdd7bcc508d4054a01cceb985aa2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-0.2.2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": + \"2.0.67\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"arcprivatecloudsfte@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Connectedvmware Extension\",\n \"version\": \"0.2.2\"\n + \ },\n \"sha256Digest\": \"61310e9f170f35d21ed4fed7bbe263aafd31c5aa71a4d3818d0fe5ddb3c2669e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-0.2.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development @@ -18466,10 +21846,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Connectedvmware Extension\",\n \"version\": \"0.2.0\"\n - \ },\n \"sha256Digest\": \"1b28904817cc5115f69a9d312c6ce6f829ba2dd20e6aeecf3965cfccb43d063d\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedvmware-0.2.1-py2.py3-none-any.whl\",\n + Tools Connectedvmware Extension\",\n \"version\": \"0.2.3\"\n + \ },\n \"sha256Digest\": \"a3ad2f74e951b682b8070b9a793fd6679229320697f4ee9e6d9f6f00737f130c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.4-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-0.2.4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development @@ -18493,12 +21873,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Connectedvmware Extension\",\n \"version\": \"0.2.1\"\n - \ },\n \"sha256Digest\": \"bfb72a51e7163f946caa4ed1dbf04e92a64ffdd7bcc508d4054a01cceb985aa2\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedvmware-0.2.2-py2.py3-none-any.whl\",\n + Tools Connectedvmware Extension\",\n \"version\": \"0.2.4\"\n + \ },\n \"sha256Digest\": \"8a96c790317dfee523d548c28a51191746ff3b45ede4fee56e804d195de437f6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-1.0.0-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": + false,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n @@ -18520,35 +21900,86 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Connectedvmware Extension\",\n \"version\": \"0.2.2\"\n - \ },\n \"sha256Digest\": \"61310e9f170f35d21ed4fed7bbe263aafd31c5aa71a4d3818d0fe5ddb3c2669e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-0.2.3-py2.py3-none-any.whl\",\n - \ \"filename\": \"connectedvmware-0.2.3-py2.py3-none-any.whl\",\n + Tools Connectedvmware Extension\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"089072ad61652bd825002baba46f072f27b181d5e21b52407907a333176901cf\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-1.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-1.0.1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.maxCliCoreVersion\": \"4.0.0\",\n \"azext.minCliCoreVersion\": - \"2.0.67\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n - \ \"License :: OSI Approved :: MIT License\"\n ],\n - \ \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"arcprivatecloudsfte@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"arcprivatecloudsfte@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Connectedvmware Extension\",\n \"version\": \"0.2.3\"\n - \ },\n \"sha256Digest\": \"a3ad2f74e951b682b8070b9a793fd6679229320697f4ee9e6d9f6f00737f130c\"\n + Tools Connectedvmware Extension\",\n \"version\": \"1.0.1\"\n + \ },\n \"sha256Digest\": \"92bcb19c2d19f7e5cf3e8527894324937380b831de19845cf4d382092c5dff39\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-1.1.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-1.1.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"arcprivatecloudsfte@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Connectedvmware Extension\",\n \"version\": \"1.1.0\"\n + \ },\n \"sha256Digest\": \"d2122c64426853a4b3b766160f6291f29aed66d9aa266585c73d63305ed4d22b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/connectedvmware-1.1.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"connectedvmware-1.1.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"arcprivatecloudsfte@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"connectedvmware\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Connectedvmware Extension\",\n \"version\": \"1.1.1\"\n + \ },\n \"sha256Digest\": \"28ef4a31c805d52aa16e749ec1382591b3089e970d8741deaf401a86c4e5e6ad\"\n \ }\n ],\n \"connection-monitor-preview\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/connection_monitor_preview-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"connection_monitor_preview-0.1.0-py2.py3-none-any.whl\",\n @@ -18969,12 +22400,171 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.11\"\n },\n \"sha256Digest\": \"d04b9087ac480c3d7cbea6bef7ae5f98d50fcf6fe35ed0c358bb27564cefca9b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.12-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.12-py2.py3-none-any.whl\",\n + \ \"azure-cli-core\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.11\"\n },\n \"sha256Digest\": \"d04b9087ac480c3d7cbea6bef7ae5f98d50fcf6fe35ed0c358bb27564cefca9b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.12-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.12-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-cli-core\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.12\"\n },\n \"sha256Digest\": \"fa278cee406a63a4131f48980715c6962cf2f8d0f14f92b3c6c846c59091aa8a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.13-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.13-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-cli-core\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.13\"\n },\n + \ \"sha256Digest\": \"b79460358c83ff69dd942ed9bb5194f03d42062426a471194d9e1fc9f4121346\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.14-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.14-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-cli-core\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.14\"\n },\n + \ \"sha256Digest\": \"61ed509c783ecd07e6f94557c090150a818962b148def5e15cc30603f9bca196\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.15-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.15-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-cli-core\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.15\"\n },\n + \ \"sha256Digest\": \"fab4b6bbed951ad7e94b50af4e169ece562379b91a7ca3fae1987ebed01470e4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.16-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.16-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-cli-core\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.16\"\n },\n + \ \"sha256Digest\": \"de6bddcca942bbb447c680148c22ce12f7f0279b6437c839f9ad82db3e3062fe\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.17-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.17-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19000,12 +22590,13 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.12\"\n },\n \"sha256Digest\": \"fa278cee406a63a4131f48980715c6962cf2f8d0f14f92b3c6c846c59091aa8a\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.13-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.13-py2.py3-none-any.whl\",\n + \ \"azure-cli-core\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.17\"\n },\n + \ \"sha256Digest\": \"08afc8c17a73d4a910d210a8863a7822de732e2a763d5ef7c2971fc1a9bbf9e8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.18-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.18-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19034,10 +22625,10 @@ interactions: \ \"azure-cli-core\",\n \"pycomposefile (>=0.0.29)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.13\"\n },\n - \ \"sha256Digest\": \"b79460358c83ff69dd942ed9bb5194f03d42062426a471194d9e1fc9f4121346\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.14-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.14-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.18\"\n },\n + \ \"sha256Digest\": \"2f86a9d6eae01dd16801576febf29f42dbb5c1b11ce6a4d461df1804c735f386\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.19-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.19-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19066,10 +22657,10 @@ interactions: \ \"azure-cli-core\",\n \"pycomposefile (>=0.0.29)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.14\"\n },\n - \ \"sha256Digest\": \"61ed509c783ecd07e6f94557c090150a818962b148def5e15cc30603f9bca196\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.15-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.15-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.19\"\n },\n + \ \"sha256Digest\": \"191040f708d6f49ab908f364fc653e5398cd28d1bbd4f0c172e541d71c5ba0f3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.20-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.20-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19098,10 +22689,10 @@ interactions: \ \"azure-cli-core\",\n \"pycomposefile (>=0.0.29)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.15\"\n },\n - \ \"sha256Digest\": \"fab4b6bbed951ad7e94b50af4e169ece562379b91a7ca3fae1987ebed01470e4\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.16-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.16-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.20\"\n },\n + \ \"sha256Digest\": \"6c8affb758834439b76edaa724ecf7bc77a6f1d08979dad0a8178f9434406b15\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.21-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.21-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19130,10 +22721,10 @@ interactions: \ \"azure-cli-core\",\n \"pycomposefile (>=0.0.29)\"\n ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.16\"\n },\n - \ \"sha256Digest\": \"de6bddcca942bbb447c680148c22ce12f7f0279b6437c839f9ad82db3e3062fe\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.17-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.17-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.21\"\n },\n + \ \"sha256Digest\": \"d63c2004502f698da946ebf552b748b0a7fc166a1f6599f6c1dd3a46309d1994\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.23-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.23-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19159,15 +22750,14 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.17\"\n },\n - \ \"sha256Digest\": \"08afc8c17a73d4a910d210a8863a7822de732e2a763d5ef7c2971fc1a9bbf9e8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.18-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.18-py2.py3-none-any.whl\",\n + \ \"pycomposefile (>=0.0.29)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.23\"\n },\n \"sha256Digest\": \"192601c40b3570606161657d5ac719df246721763296e57251eb2cddfa45235a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.24-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.24-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19191,15 +22781,14 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.18\"\n },\n - \ \"sha256Digest\": \"2f86a9d6eae01dd16801576febf29f42dbb5c1b11ce6a4d461df1804c735f386\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.19-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.19-py2.py3-none-any.whl\",\n + \ \"pycomposefile (>=0.0.29)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.24\"\n },\n \"sha256Digest\": \"512343a595e7bd5b49fbe3708e2251b3b6d3d951849fad180979466b57ec6a08\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.25-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.25-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19223,15 +22812,14 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.19\"\n },\n - \ \"sha256Digest\": \"191040f708d6f49ab908f364fc653e5398cd28d1bbd4f0c172e541d71c5ba0f3\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.20-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.20-py2.py3-none-any.whl\",\n + \ \"pycomposefile (>=0.0.29)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.25\"\n },\n \"sha256Digest\": \"7202c98ff5a6bdb549cf5f87226c76f8dab8b830076a8492099daac4871ef682\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.26-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.26-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19255,15 +22843,14 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.20\"\n },\n - \ \"sha256Digest\": \"6c8affb758834439b76edaa724ecf7bc77a6f1d08979dad0a8178f9434406b15\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.21-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.21-py2.py3-none-any.whl\",\n + \ \"pycomposefile (>=0.0.29)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.26\"\n },\n \"sha256Digest\": \"d1dc15399cd9ec15f0c44d7f08bc6ba2e7d95665e3e26da97795fcbb70e763df\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.27-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.27-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19287,15 +22874,14 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-cli-core\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n - \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.21\"\n },\n - \ \"sha256Digest\": \"d63c2004502f698da946ebf552b748b0a7fc166a1f6599f6c1dd3a46309d1994\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.23-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.23-py2.py3-none-any.whl\",\n + \ \"pycomposefile (>=0.0.29)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": + \"0.3.27\"\n },\n \"sha256Digest\": \"dd74e5182921a7d38bfa2a29ba22bc8cb2308695b2ffdc8a1054d7ff7712205f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.28-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.28-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.37.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19322,9 +22908,9 @@ interactions: \ \"pycomposefile (>=0.0.29)\"\n ]\n \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.23\"\n },\n \"sha256Digest\": \"192601c40b3570606161657d5ac719df246721763296e57251eb2cddfa45235a\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.24-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.24-py2.py3-none-any.whl\",\n + \"0.3.28\"\n },\n \"sha256Digest\": \"150df41ec23a399240ab9cac6600d570d7c0c4354744e258cc8507935304ebd5\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.29-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.29-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19353,9 +22939,9 @@ interactions: \ \"pycomposefile (>=0.0.29)\"\n ]\n \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.24\"\n },\n \"sha256Digest\": \"512343a595e7bd5b49fbe3708e2251b3b6d3d951849fad180979466b57ec6a08\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.25-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.25-py2.py3-none-any.whl\",\n + \"0.3.29\"\n },\n \"sha256Digest\": \"be031f59aed530e28d3c3988bb3ebfe87b278894890bbde4cd6e7ecafb724e12\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.30-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.30-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19384,9 +22970,9 @@ interactions: \ \"pycomposefile (>=0.0.29)\"\n ]\n \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.25\"\n },\n \"sha256Digest\": \"7202c98ff5a6bdb549cf5f87226c76f8dab8b830076a8492099daac4871ef682\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.26-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.26-py2.py3-none-any.whl\",\n + \"0.3.30\"\n },\n \"sha256Digest\": \"1d36c948a9974cf4ddac58739c87e4c83dcd9b12a377ef1232091cb1539ffb04\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.31-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.31-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19415,9 +23001,9 @@ interactions: \ \"pycomposefile (>=0.0.29)\"\n ]\n \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.26\"\n },\n \"sha256Digest\": \"d1dc15399cd9ec15f0c44d7f08bc6ba2e7d95665e3e26da97795fcbb70e763df\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.27-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.27-py2.py3-none-any.whl\",\n + \"0.3.31\"\n },\n \"sha256Digest\": \"c32a6bcf2318889ca0096e428f5d612ec32a00871219c03e200bcbe109238e19\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.32-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.32-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19446,9 +23032,9 @@ interactions: \ \"pycomposefile (>=0.0.29)\"\n ]\n \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.27\"\n },\n \"sha256Digest\": \"dd74e5182921a7d38bfa2a29ba22bc8cb2308695b2ffdc8a1054d7ff7712205f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.28-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.28-py2.py3-none-any.whl\",\n + \"0.3.32\"\n },\n \"sha256Digest\": \"21ca6a15900e60b7fb6c586f9ae9661ee2a5245661dd265016b0ef214bd3fb90\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.33-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.33-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19477,9 +23063,9 @@ interactions: \ \"pycomposefile (>=0.0.29)\"\n ]\n \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.28\"\n },\n \"sha256Digest\": \"150df41ec23a399240ab9cac6600d570d7c0c4354744e258cc8507935304ebd5\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.29-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.29-py2.py3-none-any.whl\",\n + \"0.3.33\"\n },\n \"sha256Digest\": \"8385c13f0f938930faaeed4dad67c1cc03b601bfb626e86e29bf87a310270166\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.34-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.34-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19505,12 +23091,13 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"pycomposefile (>=0.0.29)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.29\"\n },\n \"sha256Digest\": \"be031f59aed530e28d3c3988bb3ebfe87b278894890bbde4cd6e7ecafb724e12\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.30-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.30-py2.py3-none-any.whl\",\n + \ \"docker\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.34\"\n },\n + \ \"sha256Digest\": \"fee4dbe509a581c8a72f269baeaa50fbf8459d1b13391446c74300283d23919f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.35-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.35-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19536,12 +23123,77 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"pycomposefile (>=0.0.29)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.30\"\n },\n \"sha256Digest\": \"1d36c948a9974cf4ddac58739c87e4c83dcd9b12a377ef1232091cb1539ffb04\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.31-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.31-py2.py3-none-any.whl\",\n + \ \"docker\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.35\"\n },\n + \ \"sha256Digest\": \"980914fb40826959f0bd2e8e89a7671c977cc179d7728e43a602cff9f1ff193e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.36-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.36-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"docker\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.36\"\n },\n + \ \"sha256Digest\": \"233c449a1dd754fe559fbbc4b2cb1ce148d791fdc28b4b15fdc0349b40df13a3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.37-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.37-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"docker\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.37\"\n },\n + \ \"sha256Digest\": \"2c0f948ff21826d8895c0049bb76e3945644c149f066cfc6ecf22e001d312d9f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.38-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.38-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19567,12 +23219,13 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"pycomposefile (>=0.0.29)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.31\"\n },\n \"sha256Digest\": \"c32a6bcf2318889ca0096e428f5d612ec32a00871219c03e200bcbe109238e19\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.32-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.32-py2.py3-none-any.whl\",\n + \ \"docker\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.38\"\n },\n + \ \"sha256Digest\": \"b896c8f0d4946af5fea9831d2f3c10831add4a25fdb94f23401ed73a79e778de\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.39-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.39-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19592,18 +23245,19 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"pycomposefile (>=0.0.29)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.32\"\n },\n \"sha256Digest\": \"21ca6a15900e60b7fb6c586f9ae9661ee2a5245661dd265016b0ef214bd3fb90\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.33-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.33-py2.py3-none-any.whl\",\n + \ \"docker\",\n \"pycomposefile + (>=0.0.29)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.39\"\n },\n + \ \"sha256Digest\": \"03812ad93bb642de2f4abb75445785d9b8b5a88ae9f6efeef2a3a670244390ec\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.40-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.40-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19623,18 +23277,20 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"pycomposefile (>=0.0.29)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Containerapp Extension\",\n \"version\": - \"0.3.33\"\n },\n \"sha256Digest\": \"8385c13f0f938930faaeed4dad67c1cc03b601bfb626e86e29bf87a310270166\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.34-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.34-py2.py3-none-any.whl\",\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp + Extension\",\n \"version\": \"0.3.40\"\n },\n + \ \"sha256Digest\": \"a142df84576d2e676e648b95134012f19182d1ac50867406eb9c41fd604e8eaf\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.41-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.41-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19654,19 +23310,20 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"docker\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.34\"\n },\n - \ \"sha256Digest\": \"fee4dbe509a581c8a72f269baeaa50fbf8459d1b13391446c74300283d23919f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.35-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.35-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.41\"\n },\n + \ \"sha256Digest\": \"071eaf5d68423948b0745d9b763ac06ce3414fb015ff19cfcd3f62acf181cfde\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.42-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19686,21 +23343,22 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"docker\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.35\"\n },\n - \ \"sha256Digest\": \"980914fb40826959f0bd2e8e89a7671c977cc179d7728e43a602cff9f1ff193e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.36-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.36-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.42\"\n },\n + \ \"sha256Digest\": \"15d05517859e65c80c8aa3dd5a4b339b1113f4b0be449a726c8f12204d5e0b8f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.43-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.43-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19718,21 +23376,22 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"docker\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.36\"\n },\n - \ \"sha256Digest\": \"233c449a1dd754fe559fbbc4b2cb1ce148d791fdc28b4b15fdc0349b40df13a3\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.37-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.37-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.43\"\n },\n + \ \"sha256Digest\": \"ae86a2831a5fbc3046cdbeb684590cbf4d9d21f7840a94fe54824d899f37205d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.44-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.44-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19750,21 +23409,22 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"docker\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.37\"\n },\n - \ \"sha256Digest\": \"2c0f948ff21826d8895c0049bb76e3945644c149f066cfc6ecf22e001d312d9f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.38-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.38-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.44\"\n },\n + \ \"sha256Digest\": \"d7e136b4c9e9221c12abc53a243638aad571c36243ef582b7db91c6b419a3a52\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.45-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.45-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19782,21 +23442,22 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/containerapp\"\n \ }\n }\n },\n \ \"extras\": [],\n \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"docker\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.38\"\n },\n - \ \"sha256Digest\": \"b896c8f0d4946af5fea9831d2f3c10831add4a25fdb94f23401ed73a79e778de\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.39-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.39-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.45\"\n },\n + \ \"sha256Digest\": \"440016e65a14183896278ad83ec8161feff21fb7f432ececa5891db778770b2c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.46-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.46-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19820,15 +23481,16 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"containerapp\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"docker\",\n \"pycomposefile - (>=0.0.29)\"\n ]\n }\n ],\n + \ \"docker\",\n \"docker\",\n + \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.39\"\n },\n - \ \"sha256Digest\": \"03812ad93bb642de2f4abb75445785d9b8b5a88ae9f6efeef2a3a670244390ec\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.40-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.40-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.46\"\n },\n + \ \"sha256Digest\": \"29b5a105839e893b51ae5cb3ea77e3df1e6827ad6660f3d31f0598a107415138\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.47-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.47-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19856,12 +23518,12 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.40\"\n },\n - \ \"sha256Digest\": \"a142df84576d2e676e648b95134012f19182d1ac50867406eb9c41fd604e8eaf\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.41-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.41-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.47\"\n },\n + \ \"sha256Digest\": \"d13c72a0c98a03417661dd8c502df88b1344efe7c0ef009ae5ea2131a755ae1d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.48-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.48-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19889,12 +23551,12 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.41\"\n },\n - \ \"sha256Digest\": \"071eaf5d68423948b0745d9b763ac06ce3414fb015ff19cfcd3f62acf181cfde\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.42-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.48\"\n },\n + \ \"sha256Digest\": \"bcdc3a88797996d2171bbf336e26662bea19990e2adfdcdb1199796326e40496\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.49-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.49-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -19922,10 +23584,10 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.42\"\n },\n - \ \"sha256Digest\": \"15d05517859e65c80c8aa3dd5a4b339b1113f4b0be449a726c8f12204d5e0b8f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.43-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.43-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.49\"\n },\n + \ \"sha256Digest\": \"73e5d4282b505f0b0797101e15e184907767fe9e8b854dc66a21c1abc1f807f7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.50-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.50-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19955,10 +23617,10 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.43\"\n },\n - \ \"sha256Digest\": \"ae86a2831a5fbc3046cdbeb684590cbf4d9d21f7840a94fe54824d899f37205d\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.44-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.44-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.50\"\n },\n + \ \"sha256Digest\": \"847139ab567ffed02e7844a9a4c6c2f2032e650c673343234674e0e7ab53c58d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.51-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.51-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -19988,10 +23650,10 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.44\"\n },\n - \ \"sha256Digest\": \"d7e136b4c9e9221c12abc53a243638aad571c36243ef582b7db91c6b419a3a52\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.45-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.45-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.51\"\n },\n + \ \"sha256Digest\": \"963cea12deec4b900936225d5cab1e8c5667b35cf9651b5f2e59fff107a13f82\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.52-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.52-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -20021,10 +23683,10 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.45\"\n },\n - \ \"sha256Digest\": \"440016e65a14183896278ad83ec8161feff21fb7f432ececa5891db778770b2c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.46-py2.py3-none-any.whl\",\n - \ \"filename\": \"containerapp-0.3.46-py2.py3-none-any.whl\",\n + Extension\",\n \"version\": \"0.3.52\"\n },\n + \ \"sha256Digest\": \"04edd05ecfe1b2ae5d1485efb32a2536a97021b6265ecd3ab6b0b635aa8cc510\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/containerapp-0.3.53-py2.py3-none-any.whl\",\n + \ \"filename\": \"containerapp-0.3.53-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -20054,8 +23716,8 @@ interactions: \ \"pycomposefile (>=0.0.29)\",\n \"pycomposefile>=0.0.29\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Containerapp - Extension\",\n \"version\": \"0.3.46\"\n },\n - \ \"sha256Digest\": \"29b5a105839e893b51ae5cb3ea77e3df1e6827ad6660f3d31f0598a107415138\"\n + Extension\",\n \"version\": \"0.3.53\"\n },\n + \ \"sha256Digest\": \"f9b4f3928469efcc1bfbc98cd906d9d92e72617e5c21cf3ade8b37651607c3e1\"\n \ }\n ],\n \"cosmosdb-preview\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/cosmosdb_preview-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"cosmosdb_preview-0.1.0-py2.py3-none-any.whl\",\n @@ -20785,6 +24447,58 @@ interactions: \"cosmosdb-preview\",\n \"summary\": \"Microsoft Azure Command-Line Tools Cosmosdb-preview Extension\",\n \"version\": \"0.26.0\"\n },\n \"sha256Digest\": \"c761a022fa8e849534d51bb51c6b6a7c01b541a5f018532f7fe312f74f689b06\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/cosmosdb_preview-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"cosmosdb_preview-1.0.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.17.1\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"kakhandr@microsoft.com\",\n \"name\": + \"Kalyan khandrika\",\n \"role\": \"author\"\n + \ }\n ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/cosmosdb-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"cosmosdb-preview\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Cosmosdb-preview Extension\",\n \"version\": + \"1.0.0\"\n },\n \"sha256Digest\": \"3a5910873138adf747ba8baed7be180981a74569c86c927ea6f1ae39d3de53bf\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/cosmosdb_preview-1.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"cosmosdb_preview-1.0.1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.17.1\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"kakhandr@microsoft.com\",\n \"name\": + \"Kalyan khandrika\",\n \"role\": \"author\"\n + \ }\n ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/cosmosdb-preview\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"cosmosdb-preview\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Cosmosdb-preview Extension\",\n \"version\": + \"1.0.1\"\n },\n \"sha256Digest\": \"c540018bc5da1252ec3e3e564552650d6af08f349f3ff339be398a7983caf2a9\"\n \ }\n ],\n \"costmanagement\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/costmanagement-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"costmanagement-0.1.0-py3-none-any.whl\",\n @@ -20864,6 +24578,32 @@ interactions: \"costmanagement\",\n \"summary\": \"Microsoft Azure Command-Line Tools CostManagementClient Extension\",\n \"version\": \"0.2.1\"\n },\n \"sha256Digest\": \"c6ca26bcffe2b897fc35b560f6fbf620ee563daf2396dc1bae67c8e4bd0e64c3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/costmanagement-0.3.0-py3-none-any.whl\",\n + \ \"filename\": \"costmanagement-0.3.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/costmanagement\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"costmanagement\",\n \"summary\": \"Microsoft Azure Command-Line + Tools CostManagementClient Extension\",\n \"version\": + \"0.3.0\"\n },\n \"sha256Digest\": \"5661a2082ecca000b0c764dc92585e2aa601ccd5eeeb296397533cf4da814cf6\"\n \ }\n ],\n \"csvmware\": [\n {\n \"downloadUrl\": \"https://github.com/Azure/az-csvmware-cli/releases/download/0.3.0/csvmware-0.3.0-py2.py3-none-any.whl\",\n \ \"filename\": \"csvmware-0.3.0-py2.py3-none-any.whl\",\n \"metadata\": @@ -21617,6 +25357,31 @@ interactions: \"databricks\",\n \"summary\": \"Microsoft Azure Command-Line Tools DatabricksClient Extension\",\n \"version\": \"0.10.2\"\n \ },\n \"sha256Digest\": \"7db0b97b497512671343c472fad2ca7a0987ac2cddc0ae0ceab227e3d017718f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/databricks-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"databricks-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/databricks\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"databricks\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DatabricksClient Extension\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"a23ded367e80240eea828a3234801d4d989539ae4a5ecf246bfc6acb054a2544\"\n \ }\n ],\n \"datadog\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/datadog-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"datadog-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -21975,6 +25740,31 @@ interactions: \"datafactory\",\n \"summary\": \"Microsoft Azure Command-Line Tools DataFactoryManagementClient Extension\",\n \"version\": \"1.0.0\"\n },\n \"sha256Digest\": \"30941f7e2c093f040c958db024367b750068a5181554b23f7403f4522375c41e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/datafactory-1.0.2-py3-none-any.whl\",\n + \ \"filename\": \"datafactory-1.0.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/datafactory\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"datafactory\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataFactoryManagementClient Extension\",\n \"version\": + \"1.0.2\"\n },\n \"sha256Digest\": \"ea134e2963b7cdf2bcbd50244a6f1a411da77bd4db7e42c8c8f9651638c82ac7\"\n \ }\n ],\n \"datamigration\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/datamigration-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"datamigration-0.1.0-py3-none-any.whl\",\n @@ -22210,6 +26000,32 @@ interactions: \"datamigration\",\n \"summary\": \"Microsoft Azure Command-Line Tools DataMigrationManagementClient Extension\",\n \"version\": \"0.6.1\"\n },\n \"sha256Digest\": \"4a07a5272762f8f53f9fe61b295a800e63c0ea2900a29a526df2eabbe732bca7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/datamigration-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"datamigration-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/datamigration\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"datamigration\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataMigrationManagementClient Extension\",\n \"version\": + \"1.0.0b1\"\n },\n \"sha256Digest\": \"9d1ac8c7046e23387696561747be2e8f62e879a4a305f8b20ccd19460a29db0d\"\n \ }\n ],\n \"dataprotection\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"dataprotection-0.1.0-py3-none-any.whl\",\n @@ -22583,9 +26399,35 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line Tools DataProtectionClient Extension\",\n \"version\": - \"0.10.0\"\n },\n \"sha256Digest\": \"b148cf256388f2e1551994bc48e2067d150bf7d3b43fa5c865d48c069029518f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.11.0-py3-none-any.whl\",\n - \ \"filename\": \"dataprotection-0.11.0-py3-none-any.whl\",\n + \"0.10.0\"\n },\n \"sha256Digest\": \"b148cf256388f2e1551994bc48e2067d150bf7d3b43fa5c865d48c069029518f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.11.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-0.11.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isExperimental\": + true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"0.11.0\"\n },\n \"sha256Digest\": \"0917171bede4c3742736994a70beca0de11294a03504f969fab961bba25ae841\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.11.1-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-0.11.1-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -22609,9 +26451,9 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line Tools DataProtectionClient Extension\",\n \"version\": - \"0.11.0\"\n },\n \"sha256Digest\": \"0917171bede4c3742736994a70beca0de11294a03504f969fab961bba25ae841\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.11.1-py3-none-any.whl\",\n - \ \"filename\": \"dataprotection-0.11.1-py3-none-any.whl\",\n + \"0.11.1\"\n },\n \"sha256Digest\": \"1348e62ae2ef912de6384bf94159c3c5d85b4bfa14740c7b9c9d194f5f94280e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.11.2-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-0.11.2-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -22635,9 +26477,9 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line Tools DataProtectionClient Extension\",\n \"version\": - \"0.11.1\"\n },\n \"sha256Digest\": \"1348e62ae2ef912de6384bf94159c3c5d85b4bfa14740c7b9c9d194f5f94280e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-0.11.2-py3-none-any.whl\",\n - \ \"filename\": \"dataprotection-0.11.2-py3-none-any.whl\",\n + \"0.11.2\"\n },\n \"sha256Digest\": \"ce31a7bb0c939d6eb6d71971f89441abaee172a3ba5b74dae0ebe88e4a8f5300\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.0.0-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -22661,7 +26503,163 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line Tools DataProtectionClient Extension\",\n \"version\": - \"0.11.2\"\n },\n \"sha256Digest\": \"ce31a7bb0c939d6eb6d71971f89441abaee172a3ba5b74dae0ebe88e4a8f5300\"\n + \"1.0.0\"\n },\n \"sha256Digest\": \"e24770e07716e909216db6e1cf0bf869263b7472949757327acf97dbe7b1e6f5\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.1.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"1.1.0\"\n },\n \"sha256Digest\": \"bb3774425d586d03b4e26ffa0021c0024b79227963ec003430e9cd6beaa2cac7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.2.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.2.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"1.2.0\"\n },\n \"sha256Digest\": \"2a51a94a99cf4d1be1c873afb82196a72477fe159462f013aec8426ddf7eedcc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.3.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.3.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"1.3.0\"\n },\n \"sha256Digest\": \"b782fc885b1d8983507c2597bbac44bf065fbfdf15a6e176929ecd565866be07\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.4.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.4.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"1.4.0\"\n },\n \"sha256Digest\": \"231c8b8219ed2100d55bbcc4b2dcca7271e36c6715715e1eeca58327ec3ae5b6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.5.0-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.5.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"1.5.0\"\n },\n \"sha256Digest\": \"5d756d16607364bb98325d2f63580f115a9f8a6bf9c9a74d55c2af2d9a485833\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/dataprotection-1.5.1-py3-none-any.whl\",\n + \ \"filename\": \"dataprotection-1.5.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/dataprotection\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"dataprotection\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DataProtectionClient Extension\",\n \"version\": + \"1.5.1\"\n },\n \"sha256Digest\": \"2089e0c5ce213e0d79148cc2724c28679d93dc70a1e7290ee2ec99e5e0eed513\"\n \ }\n ],\n \"datashare\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/datashare-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"datashare-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -23146,6 +27144,39 @@ interactions: \ }\n ],\n \"summary\": \"Additional commands to simplify Azure Database workflows.\",\n \"version\": \"0.2.9\"\n },\n \"sha256Digest\": \"f700b75e4a127d6111134e7af5068a6d6c379c8e6ce591a1e20ae31adc766c36\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/db_up-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"db_up-1.0.0b1-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.0.46\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/db-up\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"db-up\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"Cython (==0.29.17)\",\n \"Cython==0.29.17\",\n + \ \"mysql-connector-python (==8.0.14)\",\n \"mysql-connector-python==8.0.14\",\n + \ \"psycopg2-binary (~=2.9.6)\",\n \"psycopg2-binary~=2.9.6\",\n + \ \"pymssql (==2.2.7)\",\n \"pymssql==2.2.7\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Additional commands to simplify Azure Database + workflows.\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"162a88040f8361c787a84698b4eb3850c3b4262dd9053f8dfb6bf4636a870e46\"\n \ }\n ],\n \"deploy-to-azure\": [\n {\n \ \"downloadUrl\": \"https://github.com/Azure/deploy-to-azure-cli-extension/releases/download/20200318.1/deploy_to_azure-0.2.0-py2.py3-none-any.whl\",\n \ \"filename\": \"deploy_to_azure-0.2.0-py2.py3-none-any.whl\",\n @@ -23253,6 +27284,32 @@ interactions: \"desktopvirtualization\",\n \"summary\": \"Microsoft Azure Command-Line Tools DesktopVirtualizationAPIClient Extension\",\n \"version\": \"0.2.0\"\n },\n \"sha256Digest\": \"6de28d6be58dd65ad8f25a9fa084676c54684f00f9938f5db7d0392282783e04\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/desktopvirtualization-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"desktopvirtualization-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/desktopvirtualization\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"desktopvirtualization\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Desktopvirtualization Extension.\",\n \"version\": + \"1.0.0\"\n },\n \"sha256Digest\": \"3a1e7a8f0e579fa21fed770859b21c23bec8b8489d834a61411695a9a90c7cd4\"\n \ }\n ],\n \"dev-spaces\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/dev_spaces-1.0.6-py2.py3-none-any.whl\",\n \ \"filename\": \"dev_spaces-1.0.6-py2.py3-none-any.whl\",\n @@ -23558,6 +27615,81 @@ interactions: \"devcenter\",\n \"summary\": \"Microsoft Azure Command-Line Tools DevCenter Extension\",\n \"version\": \"5.0.0\"\n \ },\n \"sha256Digest\": \"873ce4ec274710a361ba2a6bf93d8820949d955bf4386881d9a37ed87bb0d054\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/devcenter-5.0.1-py3-none-any.whl\",\n + \ \"filename\": \"devcenter-5.0.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"Programming Language :: Python + :: 3.10\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"tm-azurefidalgo@microsoft.com\",\n + \ \"name\": \"DevCenter\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/devcenter\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"devcenter\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DevCenter Extension\",\n \"version\": \"5.0.1\"\n + \ },\n \"sha256Digest\": \"f90caa530ef9a11d0e4706b94a860edca419205d4a528dab72859dd6d7870b9c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/devcenter-6.0.0-py3-none-any.whl\",\n + \ \"filename\": \"devcenter-6.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"Programming Language :: Python + :: 3.10\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"tm-azurefidalgo@microsoft.com\",\n + \ \"name\": \"DevCenter\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/devcenter\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"devcenter\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DevCenter Extension\",\n \"version\": \"6.0.0\"\n + \ },\n \"sha256Digest\": \"1331bb5b734b235112663719512170e141f93ad990a4c09503839c707f117493\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/devcenter-6.0.1-py3-none-any.whl\",\n + \ \"filename\": \"devcenter-6.0.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"Programming Language :: Python + :: 3.10\",\n \"License :: OSI Approved :: MIT License\"\n + \ ],\n \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"tm-azurefidalgo@microsoft.com\",\n + \ \"name\": \"DevCenter\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/devcenter\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"devcenter\",\n \"summary\": \"Microsoft Azure Command-Line + Tools DevCenter Extension\",\n \"version\": \"6.0.1\"\n + \ },\n \"sha256Digest\": \"25e3dcdc9cb83243ceb2ed6a6dedc227953c06cb610ba95c84ddec0f7503224f\"\n \ }\n ],\n \"diskpool\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/diskpool-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"diskpool-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -24062,6 +28194,33 @@ interactions: \"edgeorder\",\n \"summary\": \"Microsoft Azure Command-Line Tools EdgeOrderManagementClient Extension\",\n \"version\": \"0.1.0\"\n },\n \"sha256Digest\": \"186a06d0f8603f7e0faeed5296ecc73bf1096e0d681acea42d5ebccc1670357b\"\n + \ }\n ],\n \"edgezones\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/edgezones-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"edgezones-1.0.0b1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/edgezones\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"edgezones\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Edgezones Extension.\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"98f1b962dcbb078cfb8cd12d40a58d01bcc37db441570f84e293ba0ba52c6c08\"\n \ }\n ],\n \"elastic\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/elastic-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"elastic-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -24220,6 +28379,32 @@ interactions: \"elastic-san\",\n \"summary\": \"Microsoft Azure Command-Line Tools ElasticSan Extension.\",\n \"version\": \"1.0.0b2\"\n \ },\n \"sha256Digest\": \"6d2f1247ae78e431d4834989df581cd21241d16b97071bf672fb8b71ee3ad702\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/elastic_san-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"elastic_san-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/elastic-san\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"elastic-san\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ElasticSan Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"f7665c05f0e14785d15b199cd798f3f91b55bc974d5f438957dd7b36690da6c2\"\n \ }\n ],\n \"eventgrid\": [\n {\n \"downloadUrl\": \"https://eventgridcliextension.blob.core.windows.net/cli/eventgrid-0.4.4-py2.py3-none-any.whl\",\n \ \"filename\": \"eventgrid-0.4.4-py2.py3-none-any.whl\",\n @@ -24412,7 +28597,34 @@ interactions: customer ExpressRoute circuits using an ExpressRoute cross-connection.\",\n \ \"version\": \"0.1.1\"\n },\n \"sha256Digest\": \"b83f723baae0ea04557a87f358fa2131baf15d45cd3aba7a9ab42d14ec80df38\"\n }\n - \ ],\n \"fleet\": [\n {\n \"downloadUrl\": + \ ],\n \"firmwareanalysis\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/firmwareanalysis-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"firmwareanalysis-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.55.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/firmwareanalysis\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"firmwareanalysis\",\n \"summary\": \"Microsoft Azure + Command-Line Tools Firmwareanalysis Extension.\",\n \"version\": + \"1.0.0\"\n },\n \"sha256Digest\": \"1c3df1441de76edb08bed05ac279dd2b02bd6fab68a0b9a495dfd7ecce3e92cb\"\n + \ }\n ],\n \"fleet\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"fleet-0.1.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": @@ -24749,6 +28961,188 @@ interactions: \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line Tools Fleet Extension\",\n \"version\": \"1.0.2\"\n },\n \ \"sha256Digest\": \"ed2594f6deb93be770f9d0ae9379260795ae4e3da323d300ad88f1be0764f70b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.0.3-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.0.3-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.0.3\"\n },\n + \ \"sha256Digest\": \"cd93b819d0a8c1ab50f4aec00b31623fd01040362c4cd633a89ba03fc894eb73\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.0.4-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.0.4-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.0.4\"\n },\n + \ \"sha256Digest\": \"2aac868e3dd298759f38bb941105b031fa6a5d6d9c2b72d0c1467045115e2c41\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.0.5-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.0.5-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.0.5\"\n },\n + \ \"sha256Digest\": \"dca1261a36ae06aa4d6a61b2c070f56c0a2bedff6023e2063bad8b678456cb26\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.1.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.1.0\"\n },\n + \ \"sha256Digest\": \"aef2ad74e99cdd5c0adacffc2470b5807c2e8ffb6405709f41a07dc8ea53c850\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.1.1-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.1.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.1.1\"\n },\n + \ \"sha256Digest\": \"36b85eba90e306593595955c8663426f0c9e377719d179b0a2118b97403c3651\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.1.2-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.1.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.48.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.1.2\"\n },\n + \ \"sha256Digest\": \"d0d2cf188da6a2f72ebc335d1ff82827c84a4965e23188e3408c85b90e2131dc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fleet-1.2.0-py3-none-any.whl\",\n + \ \"filename\": \"fleet-1.2.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.61.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/fleet\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"fleet\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Fleet Extension\",\n \"version\": \"1.2.0\"\n },\n + \ \"sha256Digest\": \"6e9504f22893636a14990955bfb731e77a2f681b100f2cb20cc2455ce15a2b8b\"\n \ }\n ],\n \"fluid-relay\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/fluid_relay-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"fluid_relay-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -25210,6 +29604,81 @@ interactions: \"front-door\",\n \"summary\": \"Manage networking Front Doors.\",\n \"version\": \"1.0.17\"\n },\n \ \"sha256Digest\": \"20996a4d864963451572b71fecf4906f3e7fe8f403a651a1d1e98363df63d095\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/front_door-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"front_door-1.1.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/front-door\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"front-door\",\n \"summary\": \"Manage networking Front + Doors.\",\n \"version\": \"1.1.0\"\n },\n + \ \"sha256Digest\": \"9772792c3aac8738592bafa04965a27bc1131512d06f1023fdf663154070a3e7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/front_door-1.1.1-py3-none-any.whl\",\n + \ \"filename\": \"front_door-1.1.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/front-door\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"front-door\",\n \"summary\": \"Manage networking Front + Doors.\",\n \"version\": \"1.1.1\"\n },\n + \ \"sha256Digest\": \"3f3dd05dd0fce357dd0c7c6ba886a7f1bb37096a0d2d5dc0decf057431819ea4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/front_door-1.2.0-py3-none-any.whl\",\n + \ \"filename\": \"front_door-1.2.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/front-door\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"front-door\",\n \"summary\": \"Manage networking Front + Doors.\",\n \"version\": \"1.2.0\"\n },\n + \ \"sha256Digest\": \"232ba7b2cd24240d4e86d820e5fa78a11143b3a624ed953a3451210500edfbe0\"\n \ }\n ],\n \"functionapp\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/functionapp-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"functionapp-0.1.0-py2.py3-none-any.whl\",\n @@ -25298,6 +29767,33 @@ interactions: \"fzf\",\n \"summary\": \"Microsoft Azure Command-Line Tools fzf Extension\",\n \"version\": \"1.0.2\"\n },\n \ \"sha256Digest\": \"84abeed03b4bbfa7b8c0be08d9366ff3040e2160df4f5a539f0e1c9e0a1c359c\"\n + \ }\n ],\n \"gallery-service-artifact\": [\n {\n + \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/gallery_service_artifact-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"gallery_service_artifact-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"team-josrom@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/gallery-service-artifact\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"gallery-service-artifact\",\n \"summary\": \"Microsoft + Azure Command-Line Tools GalleryServiceArtifact Extension.\",\n \"version\": + \"1.0.0b1\"\n },\n \"sha256Digest\": \"3f30e3e8e7e678fd9ab91b2261fb918a303cd382626509d3f00e86f1967750c6\"\n \ }\n ],\n \"graphservices\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/graphservices-1.0.0b1-py3-none-any.whl\",\n \ \"filename\": \"graphservices-1.0.0b1-py3-none-any.whl\",\n @@ -25489,6 +29985,32 @@ interactions: \"hdinsightonaks\",\n \"summary\": \"Microsoft Azure Command-Line Tools Hdinsightonaks Extension.\",\n \"version\": \"1.0.0b1\"\n \ },\n \"sha256Digest\": \"566c30d67d6b524ac25f77342121e0e7a6ed4ab0af561fcc6e94b0629a03f40c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/hdinsightonaks-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"hdinsightonaks-1.0.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/hdinsightonaks\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"hdinsightonaks\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Hdinsightonaks Extension.\",\n \"version\": \"1.0.0b2\"\n + \ },\n \"sha256Digest\": \"c323291952f9ec6014af5f760b26860bd8029aa04cc226fd5996f20726641c59\"\n \ }\n ],\n \"healthbot\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/healthbot-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"healthbot-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -26469,6 +30991,33 @@ interactions: \"import-export\",\n \"summary\": \"Microsoft Azure Command-Line Tools StorageImportExport Extension\",\n \"version\": \"0.1.1\"\n \ },\n \"sha256Digest\": \"0680948362e12138c9582e68e471533482749bd660bfe3c8c2a4d856e90927b0\"\n + \ }\n ],\n \"informatica\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/informatica-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"informatica-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.61.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/informatica\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"informatica\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Informatica Extension.\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"6166ae91c78e74c01af3bd1ead2d62832707e176ea0f7d5d30a5dd485f482462\"\n \ }\n ],\n \"init\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/init-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"init-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -27166,6 +31715,37 @@ interactions: \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools K8s-configuration Extension\",\n \"version\": \"1.7.0\"\n },\n \"sha256Digest\": \"66c3bda7d25cae39d1d5ab9076f8fa64fdc955910ada7a8032a1756ab1f549e4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_configuration-2.0.0-py3-none-any.whl\",\n + \ \"filename\": \"k8s_configuration-2.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.15.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"Programming Language :: Python :: 3.9\",\n \"Programming + Language :: Python :: 3.10\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-configuration\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"k8s-configuration\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"pycryptodome (~=3.14.1)\",\n \"pycryptodome~=3.14.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools K8s-configuration + Extension\",\n \"version\": \"2.0.0\"\n },\n + \ \"sha256Digest\": \"1abb112abe603757a324c6eb0aaa602692aca07bb7470d6237111eaea4a0faec\"\n \ }\n ],\n \"k8s-extension\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_extension-0.2.0-py3-none-any.whl\",\n \ \"filename\": \"k8s_extension-0.2.0-py3-none-any.whl\",\n @@ -28340,6 +32920,219 @@ interactions: \"k8s-extension\",\n \"summary\": \"Microsoft Azure Command-Line Tools K8s-extension Extension\",\n \"version\": \"1.5.3\"\n \ },\n \"sha256Digest\": \"a1ada1ffe739e8ac33a4f600495d4f9fca4ded04ffb315d419b3c22551196eeb\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_extension-1.6.0-py3-none-any.whl\",\n + \ \"filename\": \"k8s_extension-1.6.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"k8s-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools K8s-extension Extension\",\n \"version\": \"1.6.0\"\n + \ },\n \"sha256Digest\": \"27a9996a9ace11856f37719ae697f0ac98d368dde6eb8648d111aafc136599a7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_extension-1.6.1-py3-none-any.whl\",\n + \ \"filename\": \"k8s_extension-1.6.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.51.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-extension\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"k8s-extension\",\n \"summary\": \"Microsoft Azure Command-Line + Tools K8s-extension Extension\",\n \"version\": \"1.6.1\"\n + \ },\n \"sha256Digest\": \"41861d65b9d86e0b622986a4984ce7a611f87b92da578db8c0527ec74334f32c\"\n + \ }\n ],\n \"k8s-runtime\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_runtime-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"k8s_runtime-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.55.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-runtime\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"k8s-runtime\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-kubernetesconfiguration (>=3.1.0)\",\n + \ \"azure-mgmt-kubernetesconfiguration>=3.1.0\",\n + \ \"azure-mgmt-resourcegraph (>=8.0.0)\",\n + \ \"azure-mgmt-resourcegraph>=8.0.0\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools K8sRuntime Extension.\",\n \"version\": + \"1.0.0b1\"\n },\n \"sha256Digest\": \"05ac43e50cdfbafc5175f058189552644328667025c84dbea08243dceede4d4f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_runtime-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"k8s_runtime-1.0.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-runtime\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"k8s-runtime\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-kubernetesconfiguration (>=3.1.0)\",\n + \ \"azure-mgmt-kubernetesconfiguration>=3.1.0\",\n + \ \"azure-mgmt-resourcegraph (>=8.0.0)\",\n + \ \"azure-mgmt-resourcegraph>=8.0.0\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools K8sRuntime Extension.\",\n \"version\": + \"1.0.0b2\"\n },\n \"sha256Digest\": \"ac2dcca538ea94685f40be31bb34a52f710db47b122541b07a0b96efde818385\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_runtime-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"k8s_runtime-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-runtime\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"k8s-runtime\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-kubernetesconfiguration (>=3.1.0)\",\n + \ \"azure-mgmt-kubernetesconfiguration>=3.1.0\",\n + \ \"azure-mgmt-resourcegraph (>=8.0.0)\",\n + \ \"azure-mgmt-resourcegraph>=8.0.0\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools K8sRuntime Extension.\",\n \"version\": + \"1.0.0\"\n },\n \"sha256Digest\": \"8a9725621b7e174a2f64247cf6d2d99b30650e90de5b2df71c495eb10838a3c6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_runtime-1.0.1-py3-none-any.whl\",\n + \ \"filename\": \"k8s_runtime-1.0.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-runtime\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"k8s-runtime\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-kubernetesconfiguration (>=3.1.0)\",\n + \ \"azure-mgmt-kubernetesconfiguration>=3.1.0\",\n + \ \"azure-mgmt-resourcegraph (>=8.0.0)\",\n + \ \"azure-mgmt-resourcegraph>=8.0.0\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools K8sRuntime Extension.\",\n \"version\": + \"1.0.1\"\n },\n \"sha256Digest\": \"74fa84a581ce488aec95d36a08ed846918a0b084fc6c29eecf0e0b1660a1c4ff\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/k8s_runtime-1.0.2-py3-none-any.whl\",\n + \ \"filename\": \"k8s_runtime-1.0.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/k8s-runtime\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"k8s-runtime\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-mgmt-kubernetesconfiguration (>=3.1.0)\",\n + \ \"azure-mgmt-kubernetesconfiguration>=3.1.0\",\n + \ \"azure-mgmt-resourcegraph (>=8.0.0)\",\n + \ \"azure-mgmt-resourcegraph>=8.0.0\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools K8sRuntime Extension.\",\n \"version\": + \"1.0.2\"\n },\n \"sha256Digest\": \"7b3987f2fae83099f32f123f1e712fea7824f2041b5743db7e2dd62927de5629\"\n \ }\n ],\n \"k8sconfiguration\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/k8sconfiguration-0.1.7-py2.py3-none-any.whl\",\n \ \"filename\": \"k8sconfiguration-0.1.7-py2.py3-none-any.whl\",\n @@ -28768,10 +33561,39 @@ interactions: \ \"azure-core\",\n \"pyyaml\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Load - Extension.\",\n \"version\": \"0.3.0\"\n },\n - \ \"sha256Digest\": \"cb64e149679d6c537a29bfb07ef5785c622cf18c12099ee49b0afa36cbec3f82\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-0.3.1-py3-none-any.whl\",\n - \ \"filename\": \"load-0.3.1-py3-none-any.whl\",\n \"metadata\": + Extension.\",\n \"version\": \"0.3.0\"\n },\n + \ \"sha256Digest\": \"cb64e149679d6c537a29bfb07ef5785c622cf18c12099ee49b0afa36cbec3f82\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-0.3.1-py3-none-any.whl\",\n + \ \"filename\": \"load-0.3.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/load\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"load\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-core\",\n \"pyyaml\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Load + Testing Extension.\",\n \"version\": \"0.3.1\"\n },\n + \ \"sha256Digest\": \"f8d518332a80b94cdf7b07fa03cf65881760b077e0c36ec7d06f9df6749e2238\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-0.3.2-py3-none-any.whl\",\n + \ \"filename\": \"load-0.3.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -28794,13 +33616,14 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"load\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-core\",\n \"pyyaml\"\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"pyyaml\",\n \"pyyaml\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Load - Testing Extension.\",\n \"version\": \"0.3.1\"\n },\n - \ \"sha256Digest\": \"f8d518332a80b94cdf7b07fa03cf65881760b077e0c36ec7d06f9df6749e2238\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-0.3.2-py3-none-any.whl\",\n - \ \"filename\": \"load-0.3.2-py3-none-any.whl\",\n \"metadata\": + Testing Extension.\",\n \"version\": \"0.3.2\"\n },\n + \ \"sha256Digest\": \"1aaef361b473946e4a5fda5d7fe961078b09ae17ee535c971a48423bb4080977\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-0.3.3-py3-none-any.whl\",\n + \ \"filename\": \"load-0.3.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: @@ -28827,8 +33650,98 @@ interactions: \ \"pyyaml\",\n \"pyyaml\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Load - Testing Extension.\",\n \"version\": \"0.3.2\"\n },\n - \ \"sha256Digest\": \"1aaef361b473946e4a5fda5d7fe961078b09ae17ee535c971a48423bb4080977\"\n + Testing Extension.\",\n \"version\": \"0.3.3\"\n },\n + \ \"sha256Digest\": \"7b533580b6a2906a0e405a277e2a392f4367b3118ce4dd7dc80ea0609c6017ae\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-0.3.4-py3-none-any.whl\",\n + \ \"filename\": \"load-0.3.4-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/load\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"load\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"pyyaml\",\n \"pyyaml\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Load + Testing Extension.\",\n \"version\": \"0.3.4\"\n },\n + \ \"sha256Digest\": \"0763cfd4f7b3022e1f4540f1b15c970c0d678028753e35b3367fa8d5deac0831\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"load-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/load\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"load\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"pyyaml\",\n \"pyyaml\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Load + Testing Extension.\",\n \"version\": \"1.0.0\"\n },\n + \ \"sha256Digest\": \"3c967ddc01b613358dd6fc86c33fa96614ffe835fb4bc348c32f5a831353c040\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/load-1.0.1-py3-none-any.whl\",\n + \ \"filename\": \"load-1.0.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/load\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"load\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"pyyaml\",\n \"pyyaml\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Load + Testing Extension.\",\n \"version\": \"1.0.1\"\n },\n + \ \"sha256Digest\": \"9ad6242dbd681e9db5e2f145a4422af764361e22b4c041cef68ccd19f844f4b6\"\n \ }\n ],\n \"log-analytics\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/log_analytics-0.1.4-py2.py3-none-any.whl\",\n \ \"filename\": \"log_analytics-0.1.4-py2.py3-none-any.whl\",\n @@ -29266,6 +34179,31 @@ interactions: \"logic\",\n \"summary\": \"Microsoft Azure Command-Line Tools Logic Extension.\",\n \"version\": \"1.0.1\"\n },\n \ \"sha256Digest\": \"449289677a0af032b88feb18edc48fc0994fb0b50a0cfccdf4907a4fadac732c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/logic-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"logic-1.1.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.55.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/logic\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"logic\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Logic Extension.\",\n \"version\": \"1.1.0\"\n },\n + \ \"sha256Digest\": \"14c18768c02ee9c370ac7eed0f23206eee7d344a10382a3083b17b5e1848cfcd\"\n \ }\n ],\n \"logz\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/logz-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"logz-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -29475,6 +34413,32 @@ interactions: \"maintenance\",\n \"summary\": \"Microsoft Azure Command-Line Tools MaintenanceManagementClient Extension\",\n \"version\": \"1.5.0\"\n },\n \"sha256Digest\": \"4f1336fed4fa2cbea640627676a6cab4399c1b29ae23cb21fe73c9bea0d80a7f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/maintenance-1.6.0-py3-none-any.whl\",\n + \ \"filename\": \"maintenance-1.6.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\": + \"2.56.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/maintenance\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"maintenance\",\n \"summary\": \"Microsoft Azure Command-Line + Tools MaintenanceManagementClient Extension\",\n \"version\": + \"1.6.0\"\n },\n \"sha256Digest\": \"3ab6a2dac48ba71b28bc8ee05d254daa72b62f84dda953749fa621a80ca39ae5\"\n \ }\n ],\n \"managedccfs\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managedccfs-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"managedccfs-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -29712,7 +34676,189 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"managednetworkfabric\",\n \"summary\": \"Support for managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": - \"4.2.0\"\n },\n \"sha256Digest\": \"f80f528a099862fa8e792f770943a832dbb958b503cc5cc8cb6f58766056d857\"\n + \"4.2.0\"\n },\n \"sha256Digest\": \"f80f528a099862fa8e792f770943a832dbb958b503cc5cc8cb6f58766056d857\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-5.0.0-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-5.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"5.0.0\"\n },\n \"sha256Digest\": \"eedba7ca67f0a05cdc5122a1e414626e2bac3e894167c97881bfa97d4ae8478a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-5.2.0-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-5.2.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"5.2.0\"\n },\n \"sha256Digest\": \"3e8ccf3ae6cda948834ed04bb07ea969b199088e224e9a658efa96017ba481dc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-5.2.1-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-5.2.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"5.2.1\"\n },\n \"sha256Digest\": \"adbb1546e9f9eb958b016f1ba9af9f5bb61d13e098eae63687e1272fedad66b4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-5.2.4-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-5.2.4-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"5.2.4\"\n },\n \"sha256Digest\": \"e42a0b991f5cde4b9ea7be218330c29b735400432d10727c1a0e3da174f5ea1a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-6.0.0-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-6.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"6.0.0\"\n },\n \"sha256Digest\": \"340483c69484865bb4e2cadc97aa5f6b258ee894920f4df0dd74ac412a8b2d59\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-6.1.0-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-6.1.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"6.1.0\"\n },\n \"sha256Digest\": \"be68c90c27c0c7800fb71aee0e4320b5c07d2907dbe3672bde4198dca92aa2fd\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/managednetworkfabric-6.2.0-py3-none-any.whl\",\n + \ \"filename\": \"managednetworkfabric-6.2.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.49.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/managednetworkfabric\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"managednetworkfabric\",\n \"summary\": \"Support for + managednetworkfabric commands based on 2023-06-15 API version.\",\n \"version\": + \"6.2.0\"\n },\n \"sha256Digest\": \"3761e2319e0a6bccde79d59e2ab2d508f00e601562c0b7e4bf290ff9d9b14479\"\n \ }\n ],\n \"managementpartner\": [\n {\n \ \"downloadUrl\": \"https://files.pythonhosted.org/packages/28/08/0fde582cf50eaf1ef304b35674b9b22f6731d95b2e41339eba4d35583b18/managementpartner-0.1.2-py2.py3-none-any.whl\",\n \ \"filename\": \"managementpartner-0.1.2-py2.py3-none-any.whl\",\n @@ -29767,6 +34913,59 @@ interactions: \"managementpartner\",\n \"summary\": \"Support for Management Partner preview\",\n \"version\": \"0.1.3\"\n },\n \ \"sha256Digest\": \"22ddf4b1cdc77e99262cb6089c4d96040065828a1d38a2709fdb945d3c851839\"\n + \ }\n ],\n \"mdp\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/mdp-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"mdp-1.0.0b1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/mdp\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"mdp\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Mdp Extension.\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"7875607d84eaf835afe73b9eee9280a5169c5b0b1dd1b66a6eff593fe292a4de\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/mdp-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"mdp-1.0.0b2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/mdp\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"mdp\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Mdp Extension.\",\n \"version\": \"1.0.0b2\"\n },\n + \ \"sha256Digest\": \"062ad026d9eaf791b5928c4fb793148d40c6c297cee32f175cd3a155eb24d93f\"\n \ }\n ],\n \"mesh\": [\n {\n \"downloadUrl\": \"https://meshcli.blob.core.windows.net/cli/mesh-0.10.6-py2.py3-none-any.whl\",\n \ \"filename\": \"mesh-0.10.6-py2.py3-none-any.whl\",\n \"metadata\": @@ -31523,17 +36722,229 @@ interactions: (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n - \ \"pydash (<6.0.0)\",\n \"pydash<6.0.0\",\n + \ \"pydash (<6.0.0)\",\n \"pydash<6.0.0\",\n + \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n + \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n + \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n + \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.20.0\"\n },\n + \ \"sha256Digest\": \"dab4fa8889574743328aafd4cccf06eb22ec21ca7407c8397238ce75c00b39c4\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.21.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.21.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (<2.0.0,>=1.1)\",\n \"azure-common<2.0.0,>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (<13.0.0,>=12.10.0)\",\n + \ \"azure-storage-blob<13.0.0,>=12.10.0\",\n + \ \"azure-storage-file-datalake (<13.0.0)\",\n + \ \"azure-storage-file-datalake<13.0.0\",\n + \ \"azure-storage-file-share (<13.0.0)\",\n + \ \"azure-storage-file-share<13.0.0\",\n \"colorama + (<0.5.0)\",\n \"colorama<0.5.0\",\n \"cryptography\",\n + \ \"cryptography\",\n \"docker\",\n + \ \"docker\",\n \"isodate\",\n + \ \"isodate\",\n \"jsonschema + (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n + \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n + \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n + \ \"pydash (<6.0.0)\",\n \"pydash<6.0.0\",\n + \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n + \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n + \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n + \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.21.0\"\n },\n + \ \"sha256Digest\": \"28b393126e7dd4ad2c885688293f4c2ef4fc3af686ab44dd6d84fe1e61fe3c0a\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.21.1-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.21.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (<2.0.0,>=1.1)\",\n \"azure-common<2.0.0,>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (<13.0.0,>=12.10.0)\",\n + \ \"azure-storage-blob<13.0.0,>=12.10.0\",\n + \ \"azure-storage-file-datalake (<13.0.0)\",\n + \ \"azure-storage-file-datalake<13.0.0\",\n + \ \"azure-storage-file-share (<13.0.0)\",\n + \ \"azure-storage-file-share<13.0.0\",\n \"colorama + (<0.5.0)\",\n \"colorama<0.5.0\",\n \"cryptography\",\n + \ \"cryptography\",\n \"docker\",\n + \ \"docker\",\n \"isodate\",\n + \ \"isodate\",\n \"jsonschema + (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n + \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n + \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n + \ \"pydash (<7.0.6,>=6.0.0)\",\n \"pydash<7.0.6,>=6.0.0\",\n + \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n + \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n + \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n + \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.21.1\"\n },\n + \ \"sha256Digest\": \"74d26f61ec61654eea8002e33e6c7d2c412522f9dc12d9c46feb4a7dbc3dbf7a\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.22.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.22.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (<2.0.0,>=1.1)\",\n \"azure-common<2.0.0,>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (<13.0.0,>=12.10.0)\",\n + \ \"azure-storage-blob<13.0.0,>=12.10.0\",\n + \ \"azure-storage-file-datalake (<13.0.0)\",\n + \ \"azure-storage-file-datalake<13.0.0\",\n + \ \"azure-storage-file-share (<13.0.0)\",\n + \ \"azure-storage-file-share<13.0.0\",\n \"colorama + (<0.5.0)\",\n \"colorama<0.5.0\",\n \"cryptography\",\n + \ \"cryptography\",\n \"docker\",\n + \ \"docker\",\n \"isodate\",\n + \ \"isodate\",\n \"jsonschema + (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n + \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n + \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n + \ \"pydash (<7.0.6,>=6.0.0)\",\n \"pydash<7.0.6,>=6.0.0\",\n + \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n + \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n + \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n + \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.22.0\"\n },\n + \ \"sha256Digest\": \"f333b3149c72d8b9230d3e82f77cbbe4af159ba65de8acfb7ef4190797d6fa8a\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.23.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.23.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (<2.0.0,>=1.1)\",\n \"azure-common<2.0.0,>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (<13.0.0,>=12.10.0)\",\n + \ \"azure-storage-blob<13.0.0,>=12.10.0\",\n + \ \"azure-storage-file-datalake (<13.0.0)\",\n + \ \"azure-storage-file-datalake<13.0.0\",\n + \ \"azure-storage-file-share (<13.0.0)\",\n + \ \"azure-storage-file-share<13.0.0\",\n \"colorama + (<0.5.0)\",\n \"colorama<0.5.0\",\n \"cryptography\",\n + \ \"cryptography\",\n \"docker\",\n + \ \"docker\",\n \"isodate\",\n + \ \"isodate\",\n \"jsonschema + (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n + \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n + \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n + \ \"pydash (<7.0.6,>=6.0.0)\",\n \"pydash<7.0.6,>=6.0.0\",\n \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces - Extension\",\n \"version\": \"2.20.0\"\n },\n - \ \"sha256Digest\": \"dab4fa8889574743328aafd4cccf06eb22ec21ca7407c8397238ce75c00b39c4\"\n - \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.21.0-py3-none-any.whl\",\n - \ \"filename\": \"ml-2.21.0-py3-none-any.whl\",\n \"metadata\": + Extension\",\n \"version\": \"2.23.0\"\n },\n + \ \"sha256Digest\": \"c4cffb5dd82c8146d11c93330b6952933bbe6755cdf77e954cdf910717e65323\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.24.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.24.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": [\n \"Development Status :: 5 - Production/Stable\",\n \ \"Intended Audience :: Developers\",\n \"Intended @@ -31568,25 +36979,27 @@ interactions: \ \"azure-storage-file-datalake (<13.0.0)\",\n \ \"azure-storage-file-datalake<13.0.0\",\n \ \"azure-storage-file-share (<13.0.0)\",\n - \ \"azure-storage-file-share<13.0.0\",\n \"colorama - (<0.5.0)\",\n \"colorama<0.5.0\",\n \"cryptography\",\n - \ \"cryptography\",\n \"docker\",\n - \ \"docker\",\n \"isodate\",\n - \ \"isodate\",\n \"jsonschema - (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n + \ \"azure-storage-file-share<13.0.0\",\n \"azureml-dataprep-rslex + (>=2.22.0)\",\n \"azureml-dataprep-rslex>=2.22.0\",\n + \ \"colorama (<0.5.0)\",\n \"colorama<0.5.0\",\n + \ \"cryptography\",\n \"cryptography\",\n + \ \"docker\",\n \"docker\",\n + \ \"isodate\",\n \"isodate\",\n + \ \"jsonschema (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n - \ \"pydash (<6.0.0)\",\n \"pydash<6.0.0\",\n + \ \"opencensus-ext-logging (<=0.1.1)\",\n \"opencensus-ext-logging<=0.1.1\",\n + \ \"pydash (>=6.0.0)\",\n \"pydash>=6.0.0\",\n \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces - Extension\",\n \"version\": \"2.21.0\"\n },\n - \ \"sha256Digest\": \"28b393126e7dd4ad2c885688293f4c2ef4fc3af686ab44dd6d84fe1e61fe3c0a\"\n - \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.21.1-py3-none-any.whl\",\n - \ \"filename\": \"ml-2.21.1-py3-none-any.whl\",\n \"metadata\": + Extension\",\n \"version\": \"2.24.0\"\n },\n + \ \"sha256Digest\": \"a2ea8f8e04a65d810e95150de1cfd388d7e2d76a2614580be42970c8dc1f4014\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.25.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.25.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": [\n \"Development Status :: 5 - Production/Stable\",\n \ \"Intended Audience :: Developers\",\n \"Intended @@ -31621,25 +37034,27 @@ interactions: \ \"azure-storage-file-datalake (<13.0.0)\",\n \ \"azure-storage-file-datalake<13.0.0\",\n \ \"azure-storage-file-share (<13.0.0)\",\n - \ \"azure-storage-file-share<13.0.0\",\n \"colorama - (<0.5.0)\",\n \"colorama<0.5.0\",\n \"cryptography\",\n - \ \"cryptography\",\n \"docker\",\n - \ \"docker\",\n \"isodate\",\n - \ \"isodate\",\n \"jsonschema - (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n + \ \"azure-storage-file-share<13.0.0\",\n \"azureml-dataprep-rslex + (>=2.22.0)\",\n \"azureml-dataprep-rslex>=2.22.0\",\n + \ \"colorama (<0.5.0)\",\n \"colorama<0.5.0\",\n + \ \"cryptography\",\n \"cryptography\",\n + \ \"docker\",\n \"docker\",\n + \ \"isodate\",\n \"isodate\",\n + \ \"jsonschema (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n - \ \"pydash (<7.0.6,>=6.0.0)\",\n \"pydash<7.0.6,>=6.0.0\",\n + \ \"opencensus-ext-logging (<=0.1.1)\",\n \"opencensus-ext-logging<=0.1.1\",\n + \ \"pydash (>=6.0.0)\",\n \"pydash>=6.0.0\",\n \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces - Extension\",\n \"version\": \"2.21.1\"\n },\n - \ \"sha256Digest\": \"74d26f61ec61654eea8002e33e6c7d2c412522f9dc12d9c46feb4a7dbc3dbf7a\"\n - \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.22.0-py3-none-any.whl\",\n - \ \"filename\": \"ml-2.22.0-py3-none-any.whl\",\n \"metadata\": + Extension\",\n \"version\": \"2.25.0\"\n },\n + \ \"sha256Digest\": \"6df57410a255c610627192c3527ac2b15f492409800070623cd1ecb433fb750d\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.25.1-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.25.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": [\n \"Development Status :: 5 - Production/Stable\",\n \ \"Intended Audience :: Developers\",\n \"Intended @@ -31682,15 +37097,172 @@ interactions: (<5.0.0,>=4.0.0)\",\n \"jsonschema<5.0.0,>=4.0.0\",\n \ \"marshmallow (<4.0.0,>=3.5)\",\n \"marshmallow<4.0.0,>=3.5\",\n \ \"opencensus-ext-azure (<2.0.0)\",\n \"opencensus-ext-azure<2.0.0\",\n - \ \"pydash (<7.0.6,>=6.0.0)\",\n \"pydash<7.0.6,>=6.0.0\",\n + \ \"opencensus-ext-logging (<=0.1.1)\",\n \"opencensus-ext-logging<=0.1.1\",\n + \ \"pydash (>=6.0.0)\",\n \"pydash>=6.0.0\",\n \ \"pyjwt (<3.0.0)\",\n \"pyjwt<3.0.0\",\n \ \"strictyaml (<2.0.0)\",\n \"strictyaml<2.0.0\",\n \ \"tqdm (<5.0.0)\",\n \"tqdm<5.0.0\",\n \ \"typing-extensions (<5.0.0)\",\n \"typing-extensions<5.0.0\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces - Extension\",\n \"version\": \"2.22.0\"\n },\n - \ \"sha256Digest\": \"f333b3149c72d8b9230d3e82f77cbbe4af159ba65de8acfb7ef4190797d6fa8a\"\n + Extension\",\n \"version\": \"2.25.1\"\n },\n + \ \"sha256Digest\": \"cf20d42f40871ccff101adc9da22ea1f3f61e2f941c777a7f21976e041a7daef\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.26.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.26.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (>=1.1)\",\n \"azure-common>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (>=12.10.0)\",\n \"azure-storage-blob>=12.10.0\",\n + \ \"azure-storage-file-datalake (>=12.2.0)\",\n + \ \"azure-storage-file-datalake>=12.2.0\",\n + \ \"azure-storage-file-share\",\n \"azure-storage-file-share\",\n + \ \"colorama\",\n \"colorama\",\n + \ \"cryptography\",\n \"cryptography\",\n + \ \"docker\",\n \"docker\",\n + \ \"isodate\",\n \"isodate\",\n + \ \"jsonschema (>=4.0.0)\",\n \"jsonschema>=4.0.0\",\n + \ \"marshmallow (>=3.5)\",\n \"marshmallow>=3.5\",\n + \ \"opencensus-ext-azure\",\n \"opencensus-ext-azure\",\n + \ \"opencensus-ext-logging\",\n \"opencensus-ext-logging\",\n + \ \"pydash (>=6.0.0)\",\n \"pydash>=6.0.0\",\n + \ \"pyjwt\",\n \"pyjwt\",\n + \ \"strictyaml\",\n \"strictyaml\",\n + \ \"tqdm\",\n \"tqdm\",\n + \ \"typing-extensions\",\n \"typing-extensions\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.26.0\"\n },\n + \ \"sha256Digest\": \"63762ebec712d9d9aefdb95dd22f0720ca31c34b4ded0e16b701987e33fce506\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.26.1-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.26.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (>=1.1)\",\n \"azure-common>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (>=12.10.0)\",\n \"azure-storage-blob>=12.10.0\",\n + \ \"azure-storage-file-datalake (>=12.2.0)\",\n + \ \"azure-storage-file-datalake>=12.2.0\",\n + \ \"azure-storage-file-share\",\n \"azure-storage-file-share\",\n + \ \"colorama\",\n \"colorama\",\n + \ \"cryptography\",\n \"cryptography\",\n + \ \"docker\",\n \"docker\",\n + \ \"isodate\",\n \"isodate\",\n + \ \"jsonschema (>=4.0.0)\",\n \"jsonschema>=4.0.0\",\n + \ \"marshmallow (>=3.5)\",\n \"marshmallow>=3.5\",\n + \ \"opencensus-ext-azure\",\n \"opencensus-ext-azure\",\n + \ \"opencensus-ext-logging\",\n \"opencensus-ext-logging\",\n + \ \"pydash (>=6.0.0)\",\n \"pydash>=6.0.0\",\n + \ \"pyjwt\",\n \"pyjwt\",\n + \ \"strictyaml\",\n \"strictyaml\",\n + \ \"tqdm\",\n \"tqdm\",\n + \ \"typing-extensions\",\n \"typing-extensions\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.26.1\"\n },\n + \ \"sha256Digest\": \"caac6f58f9f181cb94e4673f0e0affa10d8986ac84b30b6aa547a2d28901090e\"\n + \ },\n {\n \"downloadUrl\": \"https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.27.0-py3-none-any.whl\",\n + \ \"filename\": \"ml-2.27.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 5 - Production/Stable\",\n + \ \"Intended Audience :: Developers\",\n \"Intended + Audience :: System Administrators\",\n \"Environment + :: Console\",\n \"Programming Language :: Python\",\n + \ \"Programming Language :: Python :: 3\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"Programming Language :: Python + :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"description_content_type\": \"text/x-rst\",\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azuremlsdk@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azureml-examples\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ml\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-common (>=1.1)\",\n \"azure-common>=1.1\",\n + \ \"azure-mgmt-resource (<23.0.0,>=3.0.0)\",\n + \ \"azure-mgmt-resource<23.0.0,>=3.0.0\",\n + \ \"azure-mgmt-resourcegraph (<9.0.0,>=2.0.0)\",\n + \ \"azure-mgmt-resourcegraph<9.0.0,>=2.0.0\",\n + \ \"azure-storage-blob (>=12.10.0)\",\n \"azure-storage-blob>=12.10.0\",\n + \ \"azure-storage-file-datalake (>=12.2.0)\",\n + \ \"azure-storage-file-datalake>=12.2.0\",\n + \ \"azure-storage-file-share\",\n \"azure-storage-file-share\",\n + \ \"colorama\",\n \"colorama\",\n + \ \"cryptography\",\n \"cryptography\",\n + \ \"docker\",\n \"docker\",\n + \ \"isodate\",\n \"isodate\",\n + \ \"jsonschema (>=4.0.0)\",\n \"jsonschema>=4.0.0\",\n + \ \"marshmallow (>=3.5)\",\n \"marshmallow>=3.5\",\n + \ \"opencensus-ext-azure\",\n \"opencensus-ext-azure\",\n + \ \"opencensus-ext-logging\",\n \"opencensus-ext-logging\",\n + \ \"pydash (>=6.0.0)\",\n \"pydash>=6.0.0\",\n + \ \"pyjwt\",\n \"pyjwt\",\n + \ \"strictyaml\",\n \"strictyaml\",\n + \ \"tqdm\",\n \"tqdm\",\n + \ \"typing-extensions\",\n \"typing-extensions\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces + Extension\",\n \"version\": \"2.27.0\"\n },\n + \ \"sha256Digest\": \"21d076e34544770fcdc9a7c0eec0de45087b5d47b2756029fecf66e18877fba1\"\n \ }\n ],\n \"mobile-network\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/mobile_network-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"mobile_network-0.1.0-py3-none-any.whl\",\n @@ -31796,6 +37368,32 @@ interactions: \"mobile-network\",\n \"summary\": \"Microsoft Azure Command-Line Tools MobileNetwork Extension.\",\n \"version\": \"0.2.1\"\n \ },\n \"sha256Digest\": \"66bd39f687c2ac030ab6bd44b8746ec8d64c4804b44592c0bb1ffda837dce22b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/mobile_network-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"mobile_network-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/mobile-network\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"mobile-network\",\n \"summary\": \"Microsoft Azure Command-Line + Tools MobileNetwork Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"2d9572a4ed706df8f626c62036ad22f46a15b113273f8ff9b06313a380a27f56\"\n \ }\n ],\n \"monitor-control-service\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/monitor_control_service-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"monitor_control_service-0.1.0-py3-none-any.whl\",\n @@ -31979,6 +37577,58 @@ interactions: \"monitor-control-service\",\n \"summary\": \"Microsoft Azure Command-Line Tools MonitorClient Extension\",\n \"version\": \"1.0.1\"\n },\n \"sha256Digest\": \"66475eb79c577ea566c74f986b9ef6af936580beb02dde622701370323d430a3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/monitor_control_service-1.0.2-py3-none-any.whl\",\n + \ \"filename\": \"monitor_control_service-1.0.2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/monitor-control-service\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"monitor-control-service\",\n \"summary\": \"Microsoft + Azure Command-Line Tools MonitorClient Extension\",\n \"version\": + \"1.0.2\"\n },\n \"sha256Digest\": \"e0a271c65997120e0022baf51e63c2feec4df3235258a6243a60ff069315b84a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/monitor_control_service-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"monitor_control_service-1.1.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.61.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/monitor-control-service\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"monitor-control-service\",\n \"summary\": \"Microsoft + Azure Command-Line Tools MonitorClient Extension\",\n \"version\": + \"1.1.0\"\n },\n \"sha256Digest\": \"d155c671cd3ba0799c7ecba590804c557e832f3714f7ce247fc1e34fa61f2225\"\n \ }\n ],\n \"netappfiles-preview\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/netappfiles_preview-0.3.2-py2.py3-none-any.whl\",\n \ \"filename\": \"netappfiles_preview-0.3.2-py2.py3-none-any.whl\",\n @@ -32310,6 +37960,31 @@ interactions: \"new-relic\",\n \"summary\": \"Microsoft Azure Command-Line Tools NewRelic Extension.\",\n \"version\": \"1.0.0b1\"\n \ },\n \"sha256Digest\": \"9ce69f1684cea14acba0f2fdb473e47e0a06745e383bb5144954c5e85e416199\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/new_relic-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"new_relic-1.0.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/new-relic\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"new-relic\",\n \"summary\": \"Microsoft Azure Command-Line + Tools NewRelic Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"3105310aec2321d429f068e74dfe16b0b64c7100aa51eaef2c11765971ea6f5a\"\n \ }\n ],\n \"next\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/next-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"next-0.1.0-py2.py3-none-any.whl\",\n \"metadata\": @@ -32415,6 +38090,38 @@ interactions: \"next\",\n \"summary\": \"Microsoft Azure Command-Line Tools Next Extension\",\n \"version\": \"0.1.3\"\n },\n \ \"sha256Digest\": \"83c4e03427f190203e094c14e4f7e79cec989f1277e16b9256bb9fe688aa5e07\"\n + \ }\n ],\n \"nexusidentity\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/nexusidentity-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"nexusidentity-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.59.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/nexusidentity\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"nexusidentity\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-identity\",\n \"azure-identity\",\n + \ \"msgraph-sdk\",\n \"msgraph-sdk\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Nexusidentity + Extension\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"56beac87256cef8a0815f106e57e968ca20d5ee3bdf3ecdef3fa706758622417\"\n \ }\n ],\n \"nginx\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"nginx-0.1.0-py2.py3-none-any.whl\",\n \"metadata\": @@ -32439,11 +38146,36 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Nginx Extension\",\n \"version\": \"0.1.0\"\n },\n - \ \"sha256Digest\": \"a5b017c415c4a030b2c63b2145e6476f789f860a0cb0385b6e336e7572bef73b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-0.1.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"nginx-0.1.1-py2.py3-none-any.whl\",\n \"metadata\": - {\n \"azext.minCliCoreVersion\": \"2.40.0\",\n \"classifiers\": + Tools Nginx Extension\",\n \"version\": \"0.1.0\"\n },\n + \ \"sha256Digest\": \"a5b017c415c4a030b2c63b2145e6476f789f860a0cb0385b6e336e7572bef73b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-0.1.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-0.1.1-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.40.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nginx Extension\",\n \"version\": \"0.1.1\"\n },\n + \ \"sha256Digest\": \"3234129a26043a68e80ee1ae31c36e7ef8b2691a096cd6fc557e3a46fea8170e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-1.0.0-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.55.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -32464,8 +38196,138 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Nginx Extension\",\n \"version\": \"0.1.1\"\n },\n - \ \"sha256Digest\": \"3234129a26043a68e80ee1ae31c36e7ef8b2691a096cd6fc557e3a46fea8170e\"\n + Tools Nginx Extension\",\n \"version\": \"1.0.0\"\n },\n + \ \"sha256Digest\": \"af877e67f99d7b147efdd4d4c566a13834692823d47d6fdfc5d107c20bb8ba7a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-2.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-2.0.0b1-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.58.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nginx Extension\",\n \"version\": \"2.0.0b1\"\n },\n + \ \"sha256Digest\": \"496a898173f71aafe056dfcd036f8c4b9f72215d06f3c31bad9a484ab99f8602\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-2.0.0b2-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-2.0.0b2-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.58.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nginx Extension\",\n \"version\": \"2.0.0b2\"\n },\n + \ \"sha256Digest\": \"7f26070f348d7af3132974f4393fb993eba5293ae18494af6a868e85aa34103c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-2.0.0b3-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-2.0.0b3-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.60.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nginx Extension\",\n \"version\": \"2.0.0b3\"\n },\n + \ \"sha256Digest\": \"1cabdd210d0d7d0ecad435c161a1bcc499deea2002946a7879079b726ea9946e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-2.0.0b4-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-2.0.0b4-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.60.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nginx Extension\",\n \"version\": \"2.0.0b4\"\n },\n + \ \"sha256Digest\": \"5327d108083910acbc066b46b8aaf7cb9355bc6e82b4857c706e9990074b512c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nginx-2.0.0b5-py2.py3-none-any.whl\",\n + \ \"filename\": \"nginx-2.0.0b5-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.61.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nginx\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nginx Extension\",\n \"version\": \"2.0.0b5\"\n },\n + \ \"sha256Digest\": \"92e0b817bb863173da129abd3c326e058df3afce0fbb9851e6ff8ccea3c04773\"\n \ }\n ],\n \"notification-hub\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/notification_hub-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"notification_hub-0.1.0-py2.py3-none-any.whl\",\n @@ -32642,6 +38504,32 @@ interactions: \"nsp\",\n \"summary\": \"Microsoft Azure Command-Line Tools Nsp Extension.\",\n \"version\": \"0.3.0\"\n },\n \ \"sha256Digest\": \"3e53051a70693a5da8c563118d0f695efc8465eab769ca64416fc8a16ba6e72a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/nsp-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"nsp-1.0.0b2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.61.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/nsp\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"nsp\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Nsp Extension.\",\n \"version\": \"1.0.0b2\"\n },\n + \ \"sha256Digest\": \"febfce38fc449daa67c7ad8410e7fa250f7f39afb5f870496ce045bb74935bcd\"\n \ }\n ],\n \"offazure\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/offazure-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"offazure-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -33163,6 +39051,34 @@ interactions: \"powerbidedicated\",\n \"summary\": \"Microsoft Azure Command-Line Tools PowerBIDedicated Extension\",\n \"version\": \"0.2.2\"\n },\n \"sha256Digest\": \"2f87e7006a1670a8c7ec9cce7aa90adaa55871f183e7fedc44509eaea40546fa\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/powerbidedicated-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"powerbidedicated-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.56.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/powerbidedicated\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"powerbidedicated\",\n \"summary\": \"Microsoft Azure + Command-Line Tools PowerBIDedicated Extension\",\n \"version\": + \"1.0.0b1\"\n },\n \"sha256Digest\": \"e1e58bb6f57edde4793f4c66a0c10a2776f842172878162385f2b1d21539de6e\"\n \ }\n ],\n \"providerhub\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/providerhub-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"providerhub-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -33216,6 +39132,32 @@ interactions: \"providerhub\",\n \"summary\": \"Microsoft Azure Command-Line Tools ProviderHub Extension\",\n \"version\": \"0.2.0\"\n \ },\n \"sha256Digest\": \"9cda8fed546254987e5c5f872b4119105796c89de8d65d385638dac155bdf01e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/providerhub-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"providerhub-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/providerhub\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"providerhub\",\n \"summary\": \"Microsoft Azure Command-Line + Tools ProviderHub Extension\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"7b93cb7ecb1fa3a520909d45e6e6597c8ba7daac4fbc1a26c3de66043678dd0d\"\n \ }\n ],\n \"purview\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/purview-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"purview-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -33450,10 +39392,88 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.7.0\"\n },\n - \ \"sha256Digest\": \"e3658e4549ce96f262d60c3ae357c3c057b8678cd01060a6eea0cd715a6d2e45\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.8.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.8.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.7.0\"\n },\n + \ \"sha256Digest\": \"e3658e4549ce96f262d60c3ae357c3c057b8678cd01060a6eea0cd715a6d2e45\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.8.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.8.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.23.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"que-contacts@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation, Quantum + Team\",\n \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Quantum Extension\",\n \"version\": \"0.8.0\"\n },\n + \ \"sha256Digest\": \"cab7430782efaf49e865f6c217b911e27b3868ec5df53e70614aa256b3ba91ca\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.9.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.9.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.23.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"que-contacts@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation, Quantum + Team\",\n \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Quantum Extension\",\n \"version\": \"0.9.0\"\n },\n + \ \"sha256Digest\": \"214d6303c3381a8a328a15ca3bb8f77f68c36cf71d83cdaa41be87b2af6e28fe\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.10.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.10.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.23.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"que-contacts@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation, Quantum + Team\",\n \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Quantum Extension\",\n \"version\": \"0.10.0\"\n + \ },\n \"sha256Digest\": \"c280a1eda5a9eee853239cac1ac2c610d159d59be5ac29fa7d5a4a1a3d7cbbde\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.11.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.11.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33476,10 +39496,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.8.0\"\n },\n - \ \"sha256Digest\": \"cab7430782efaf49e865f6c217b911e27b3868ec5df53e70614aa256b3ba91ca\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.9.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.9.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.11.0\"\n + \ },\n \"sha256Digest\": \"96d85f1c7675e4d8a42384de348cad66e80343b6ae26142ebdb19d753c45fc2e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.12.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.12.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33502,10 +39522,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.9.0\"\n },\n - \ \"sha256Digest\": \"214d6303c3381a8a328a15ca3bb8f77f68c36cf71d83cdaa41be87b2af6e28fe\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.10.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.10.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.12.0\"\n + \ },\n \"sha256Digest\": \"ffc62c0663843522a3439acf4c682f9287849d5b3efcf2c4fd721266bfecfe96\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.13.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.13.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33523,15 +39543,15 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.10.0\"\n - \ },\n \"sha256Digest\": \"c280a1eda5a9eee853239cac1ac2c610d159d59be5ac29fa7d5a4a1a3d7cbbde\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.11.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.11.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.13.0\"\n + \ },\n \"sha256Digest\": \"d37a85117a1b0989c1ceba8bbb571c777b626eabf9ce14161617837dbfeb067e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.14.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.14.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33549,15 +39569,15 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.11.0\"\n - \ },\n \"sha256Digest\": \"96d85f1c7675e4d8a42384de348cad66e80343b6ae26142ebdb19d753c45fc2e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.12.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.12.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.14.0\"\n + \ },\n \"sha256Digest\": \"bad894820d83dceabf1805498ad98d1dc196fe8e1c6907136d60cbea30fee816\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.15.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.15.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33575,15 +39595,15 @@ interactions: \ ],\n \"document_names\": {\n \"description\": \"DESCRIPTION.rst\"\n \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions\"\n + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum\"\n \ }\n }\n },\n \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.12.0\"\n - \ },\n \"sha256Digest\": \"ffc62c0663843522a3439acf4c682f9287849d5b3efcf2c4fd721266bfecfe96\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.13.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.13.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.15.0\"\n + \ },\n \"sha256Digest\": \"4ca37f0e8b7b1b9b32ed35b127600f5b1ea2390b5dfc5901c7dbce5fef631278\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.16.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.16.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33606,10 +39626,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.13.0\"\n - \ },\n \"sha256Digest\": \"d37a85117a1b0989c1ceba8bbb571c777b626eabf9ce14161617837dbfeb067e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.14.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.14.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.16.0\"\n + \ },\n \"sha256Digest\": \"d8d4650f5f4b385c7612598301db487ffd2a09b59119453760ca9ab1319f1363\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.17.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.17.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.23.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33632,12 +39652,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.14.0\"\n - \ },\n \"sha256Digest\": \"bad894820d83dceabf1805498ad98d1dc196fe8e1c6907136d60cbea30fee816\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.15.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.15.0-py3-none-any.whl\",\n \"metadata\": + Tools Quantum Extension\",\n \"version\": \"0.17.0\"\n + \ },\n \"sha256Digest\": \"219065a730c5caa44b07979d56211e24e498a4cfb2d1d50e2d86239254b4d945\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.18.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.18.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": - \"2.23.0\",\n \"classifiers\": [\n \"Development + \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -33655,15 +39675,18 @@ interactions: \ },\n \"project_urls\": {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum\"\n \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.15.0\"\n - \ },\n \"sha256Digest\": \"4ca37f0e8b7b1b9b32ed35b127600f5b1ea2390b5dfc5901c7dbce5fef631278\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.16.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.16.0-py3-none-any.whl\",\n \"metadata\": + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"quantum\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-storage-blob (~=12.14.1)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Quantum Extension\",\n \"version\": + \"0.18.0\"\n },\n \"sha256Digest\": \"7eddef419f89623b2f4d168be9c60c2ead8ede385fbff1c23671823260fd8569\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.19.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.19.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": - \"2.23.0\",\n \"classifiers\": [\n \"Development + \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -33681,15 +39704,18 @@ interactions: \ },\n \"project_urls\": {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum\"\n \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.16.0\"\n - \ },\n \"sha256Digest\": \"d8d4650f5f4b385c7612598301db487ffd2a09b59119453760ca9ab1319f1363\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.17.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.17.0-py3-none-any.whl\",\n \"metadata\": + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"quantum\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-storage-blob (~=12.14.1)\"\n ]\n + \ }\n ],\n \"summary\": + \"Microsoft Azure Command-Line Tools Quantum Extension\",\n \"version\": + \"0.19.0\"\n },\n \"sha256Digest\": \"96c60aff31dc8153e2c8a2f72ac5a8a4b1e0810b37a1f0b0fdd3d79c4263517e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.20.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.20.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": - \"2.23.0\",\n \"classifiers\": [\n \"Development + \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -33707,13 +39733,17 @@ interactions: \ },\n \"project_urls\": {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum\"\n \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"quantum\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Quantum Extension\",\n \"version\": \"0.17.0\"\n - \ },\n \"sha256Digest\": \"219065a730c5caa44b07979d56211e24e498a4cfb2d1d50e2d86239254b4d945\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.18.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.18.0-py3-none-any.whl\",\n \"metadata\": + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"quantum\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-storage-blob (~=12.14.1)\",\n \"azure-storage-blob~=12.14.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Quantum + Extension\",\n \"version\": \"0.20.0\"\n },\n + \ \"sha256Digest\": \"9b9fdd106ff324bfa88188c287675e2fa72cdcb20a0107003dba9d17ea67fb34\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.21.0-py3-none-any.whl\",\n + \ \"filename\": \"quantum-0.21.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33737,12 +39767,13 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-storage-blob (~=12.14.1)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Quantum Extension\",\n \"version\": - \"0.18.0\"\n },\n \"sha256Digest\": \"7eddef419f89623b2f4d168be9c60c2ead8ede385fbff1c23671823260fd8569\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.19.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.19.0-py3-none-any.whl\",\n \"metadata\": + \ \"azure-storage-blob (~=12.14.1)\",\n \"azure-storage-blob~=12.14.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Quantum + Extension\",\n \"version\": \"0.21.0\"\n },\n + \ \"sha256Digest\": \"ea4262c017aa585c82dcda0204cf33bac3898a12512adb91a37912b77c06f93e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"quantum-1.0.0b1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33766,12 +39797,13 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"quantum\",\n \"run_requires\": [\n {\n \"requires\": [\n - \ \"azure-storage-blob (~=12.14.1)\"\n ]\n - \ }\n ],\n \"summary\": - \"Microsoft Azure Command-Line Tools Quantum Extension\",\n \"version\": - \"0.19.0\"\n },\n \"sha256Digest\": \"96c60aff31dc8153e2c8a2f72ac5a8a4b1e0810b37a1f0b0fdd3d79c4263517e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.20.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.20.0-py3-none-any.whl\",\n \"metadata\": + \ \"azure-storage-blob (~=12.14.1)\",\n \"azure-storage-blob~=12.14.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Quantum + Extension\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"25f4fb67c5e0b8d041b73e6944c533b1e0009ef80563d0cd3e9506f4c17d1fcf\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"quantum-1.0.0b2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33798,10 +39830,10 @@ interactions: \ \"azure-storage-blob (~=12.14.1)\",\n \"azure-storage-blob~=12.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Quantum - Extension\",\n \"version\": \"0.20.0\"\n },\n - \ \"sha256Digest\": \"9b9fdd106ff324bfa88188c287675e2fa72cdcb20a0107003dba9d17ea67fb34\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-0.21.0-py3-none-any.whl\",\n - \ \"filename\": \"quantum-0.21.0-py3-none-any.whl\",\n \"metadata\": + Extension\",\n \"version\": \"1.0.0b2\"\n },\n + \ \"sha256Digest\": \"e22d0d25828fd064570e3e7cbe54420fccf97357b7c786c3d80f6a2a00712c34\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/quantum-1.0.0b3-py3-none-any.whl\",\n + \ \"filename\": \"quantum-1.0.0b3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.41.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -33828,8 +39860,8 @@ interactions: \ \"azure-storage-blob (~=12.14.1)\",\n \"azure-storage-blob~=12.14.1\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Quantum - Extension\",\n \"version\": \"0.21.0\"\n },\n - \ \"sha256Digest\": \"ea4262c017aa585c82dcda0204cf33bac3898a12512adb91a37912b77c06f93e\"\n + Extension\",\n \"version\": \"1.0.0b3\"\n },\n + \ \"sha256Digest\": \"3301f40b76afe377bda1d08a35b8892b38b7fc1eddb5707a8a190c15bbf782b2\"\n \ }\n ],\n \"qumulo\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/qumulo-1.0.0-py3-none-any.whl\",\n \ \"filename\": \"qumulo-1.0.0-py3-none-any.whl\",\n \"metadata\": @@ -34219,6 +40251,74 @@ interactions: \ \"summary\": \"Support for testing connection to Azure Database for MySQL & PostgreSQL servers.\",\n \"version\": \"1.0.4\"\n },\n \"sha256Digest\": \"8dc15a70881c71f21ba000854960b1be851a057b403dc8de156b73883efb543d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/rdbms_connect-1.0.5-py2.py3-none-any.whl\",\n + \ \"filename\": \"rdbms_connect-1.0.5-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.19.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/rdbms-connect\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"rdbms-connect\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"mycli (~=1.27.0)\",\n \"mycli~=1.27.0\",\n + \ \"pgcli (==4.0.1)\",\n \"pgcli==4.0.1\",\n + \ \"psycopg2 (==2.9.3)\",\n \"psycopg2==2.9.3\",\n + \ \"setproctitle (~=1.3.3)\",\n \"setproctitle~=1.3.3\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Support for testing connection to Azure + Database for MySQL & PostgreSQL servers.\",\n \"version\": + \"1.0.5\"\n },\n \"sha256Digest\": \"4684fe51f6d77f8ab1aced59dbbf27ed3324fc8d351e9e98e8dcc2b30493018b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/rdbms_connect-1.0.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"rdbms_connect-1.0.6-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.19.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"Programming Language :: Python :: 3.9\",\n \"Programming + Language :: Python :: 3.10\",\n \"Programming Language + :: Python :: 3.11\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/rdbms-connect\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"rdbms-connect\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"mycli (~=1.27.0)\",\n \"mycli~=1.27.0\",\n + \ \"pgcli (==4.0.1)\",\n \"pgcli==4.0.1\",\n + \ \"psycopg2 (~=2.9.3)\",\n \"psycopg2~=2.9.3\",\n + \ \"setproctitle (~=1.3.3)\",\n \"setproctitle~=1.3.3\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Support for testing connection to Azure + Database for MySQL & PostgreSQL servers.\",\n \"version\": + \"1.0.6\"\n },\n \"sha256Digest\": \"49cbe8d9b7ea07a8974a29ad90247e864ed798bed5f28d0e3a57a4b37f5939e7\"\n \ }\n ],\n \"redisenterprise\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/redisenterprise-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"redisenterprise-0.1.0-py3-none-any.whl\",\n @@ -34350,6 +40450,32 @@ interactions: \"redisenterprise\",\n \"summary\": \"Microsoft Azure Command-Line Tools RedisEnterprise Extension.\",\n \"version\": \"0.1.4\"\n \ },\n \"sha256Digest\": \"cb59ab44eb12b51ecc62f8a5b6302d166be5d6388cf8ff21bc49f2829128d031\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/redisenterprise-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"redisenterprise-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.45.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/redisenterprise\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"redisenterprise\",\n \"summary\": \"Microsoft Azure Command-Line + Tools RedisEnterprise Extension.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"e43737fefbb1205970254f369b0f0c33fbfd5b82d64eb2025228eb3a07bed3e7\"\n \ }\n ],\n \"reservation\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/reservation-0.2.0-py3-none-any.whl\",\n \ \"filename\": \"reservation-0.2.0-py3-none-any.whl\",\n \"metadata\": @@ -34909,12 +41035,38 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"scheduled-query\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Scheduled_query Extension\",\n \"version\": \"0.5.1\"\n - \ },\n \"sha256Digest\": \"34b68f6a3edbcd703c17f5d384e50e1dee71bc2f05e8aa80862d46afef8c570c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/scheduled_query-0.5.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"scheduled_query-0.5.2-py2.py3-none-any.whl\",\n + Tools Scheduled_query Extension\",\n \"version\": \"0.5.1\"\n + \ },\n \"sha256Digest\": \"34b68f6a3edbcd703c17f5d384e50e1dee71bc2f05e8aa80862d46afef8c570c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/scheduled_query-0.5.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"scheduled_query-0.5.2-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/scheduled-query\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"scheduled-query\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Scheduled_query Extension\",\n \"version\": \"0.5.2\"\n + \ },\n \"sha256Digest\": \"b393b38bf6dd80918778460b4f4e50643900ffab5dada7af1216c415d25fb706\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/scheduled_query-0.5.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"scheduled_query-0.5.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.54.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -34935,10 +41087,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"scheduled-query\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Scheduled_query Extension\",\n \"version\": \"0.5.2\"\n - \ },\n \"sha256Digest\": \"b393b38bf6dd80918778460b4f4e50643900ffab5dada7af1216c415d25fb706\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/scheduled_query-0.5.3-py2.py3-none-any.whl\",\n - \ \"filename\": \"scheduled_query-0.5.3-py2.py3-none-any.whl\",\n + Tools Scheduled_query Extension\",\n \"version\": \"0.5.3\"\n + \ },\n \"sha256Digest\": \"b141ce4ff7678484561e9f3c842d8249112a465b7a0da07a6da49856920f8534\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/scheduled_query-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"scheduled_query-1.0.0b1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": \"2.54.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -34961,8 +41113,8 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"scheduled-query\",\n \"summary\": \"Microsoft Azure Command-Line - Tools Scheduled_query Extension\",\n \"version\": \"0.5.3\"\n - \ },\n \"sha256Digest\": \"b141ce4ff7678484561e9f3c842d8249112a465b7a0da07a6da49856920f8534\"\n + Tools Scheduled_query Extension\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"fd5e69d0438b8089dbe197d5ba4c41776aed906941cac374755a4c9044c4af04\"\n \ }\n ],\n \"scvmm\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/scvmm-0.1.4-py2.py3-none-any.whl\",\n \ \"filename\": \"scvmm-0.1.4-py2.py3-none-any.whl\",\n \"metadata\": @@ -35201,6 +41353,58 @@ interactions: \"self-help\",\n \"summary\": \"Microsoft Azure Command-Line Tools SelfHelp Extension.\",\n \"version\": \"0.2.0\"\n \ },\n \"sha256Digest\": \"a57d629f75443666af570188716eaf2b9182da41f6d2f958f6d53d79b830b23e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/self_help-0.3.0-py3-none-any.whl\",\n + \ \"filename\": \"self_help-0.3.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/self-help\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"self-help\",\n \"summary\": \"Microsoft Azure Command-Line + Tools SelfHelp Extension.\",\n \"version\": \"0.3.0\"\n + \ },\n \"sha256Digest\": \"0545610ee482069ad89c3fcc342e3d94f72b4d5eb139312c778501c843e8216d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/self_help-0.4.0-py3-none-any.whl\",\n + \ \"filename\": \"self_help-0.4.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/self-help\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"self-help\",\n \"summary\": \"Microsoft Azure Command-Line + Tools SelfHelp Extension.\",\n \"version\": \"0.4.0\"\n + \ },\n \"sha256Digest\": \"8c903aaf10d6cb61e6455f6010deeeb496d1e23d6876662089266a49403586b6\"\n \ }\n ],\n \"sentinel\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/sentinel-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"sentinel-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -35508,6 +41712,96 @@ interactions: \ }\n ],\n \"summary\": \"Microsoft Azure Command-Line Tools for Serial Console Extension\",\n \"version\": \"0.1.6\"\n },\n \"sha256Digest\": \"2b20fce597a655c1016ab4d3b2f569267adf1536ed34481063e56c22f407381a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serial_console-0.1.7-py3-none-any.whl\",\n + \ \"filename\": \"serial_console-0.1.7-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/serial-console\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serial-console\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"websocket-client (==1.3.1)\",\n \"websocket-client==1.3.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools for + Serial Console Extension\",\n \"version\": \"0.1.7\"\n + \ },\n \"sha256Digest\": \"5a67a26b525a8f28fe3189024b02763bd9a0d8dc4c641fb62317475cd11ec51c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serial_console-0.1.8-py3-none-any.whl\",\n + \ \"filename\": \"serial_console-0.1.8-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/serial-console\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serial-console\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"websocket-client (==1.3.1)\",\n \"websocket-client==1.3.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools for + Serial Console Extension\",\n \"version\": \"0.1.8\"\n + \ },\n \"sha256Digest\": \"d4deb023672e1b17e5045dd4cf206b7a518c1bfceeb081f73f43fd4fe9b99777\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serial_console-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"serial_console-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/serial-console\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serial-console\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"websocket-client (==1.3.1)\",\n \"websocket-client==1.3.1\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools for + Serial Console Extension\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"c6f9d04ba068ff966dd1f522521ca7142e15deaf5bfa732805f2cd139332cbfd\"\n \ }\n ],\n \"serviceconnector-passwordless\": [\n \ {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.0-py3-none-any.whl\",\n \ \"filename\": \"serviceconnector_passwordless-0.3.0-py3-none-any.whl\",\n @@ -35736,7 +42030,319 @@ interactions: \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.8-py3-none-any.whl\",\n \ \"filename\": \"serviceconnector_passwordless-0.3.8-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"psycopg2-binary (==2.9.5)\",\n \"pyodbc + (==4.0.35)\"\n ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"0.3.8\"\n },\n + \ \"sha256Digest\": \"546af88e93fb857552183869a12001020897f7b724cc1f350936971635302ef4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.9-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-0.3.9-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"0.3.9\"\n },\n + \ \"sha256Digest\": \"48e3b58838945f62f6aecac7579b00f3a71d6d4db7f8f34af39d6308a26bd445\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.11-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-0.3.11-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"0.3.11\"\n },\n + \ \"sha256Digest\": \"bb8d273e2b221c439fb5d418ddf2d8591e3382f2efba85ce384e6dcb93488a38\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.12-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-0.3.12-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"0.3.12\"\n },\n + \ \"sha256Digest\": \"7d3fadef5e1dddc362f043c8b0a802668c24187c68fdf8e33797250f5276ee2f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.13-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-0.3.13-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"0.3.13\"\n },\n + \ \"sha256Digest\": \"0948c4b5cb9ef84ad4470b3947d67034aef0531fba24d97782f48e0aacb2801a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-1.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"1.0.0\"\n },\n + \ \"sha256Digest\": \"cb065e4ca01b71023bd7c6c242f20123eeb8ff90c2178b035e8de58552740488\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-1.0.1-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-1.0.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"1.0.1\"\n },\n + \ \"sha256Digest\": \"04e4cc595ee68484f28159ba010c3feda561ee68cd0f386ab1b72045f2d19272\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-1.0.2-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-1.0.2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"1.0.2\"\n },\n + \ \"sha256Digest\": \"ce27bafbeb27a848c0294e085f95c81778b64d67537e7efbc6a5ce09b0ede902\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-1.0.3-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-1.0.3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/serviceconnector-passwordless\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n + \ \"run_requires\": [\n {\n \"requires\": + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless + Extension\",\n \"version\": \"1.0.3\"\n },\n + \ \"sha256Digest\": \"066ed68dcfc4b6991ea38579874ce1967d8d9636838023d4a03910026467d348\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-2.0.0-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-2.0.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.60.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -35758,17 +42364,20 @@ interactions: (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"serviceconnector-passwordless\",\n \ \"run_requires\": [\n {\n \"requires\": - [\n \"PyMySQL (==1.0.2)\",\n \"azure-core\",\n - \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n - \ \"psycopg2-binary (==2.9.5)\",\n \"pyodbc - (==4.0.35)\"\n ]\n }\n ],\n + [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n + \ \"azure-core\",\n \"azure-core\",\n + \ \"azure-mgmt-servicelinker (==1.2.0b2)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b2\",\n \"psycopg2-binary + (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n + \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n + \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless - Extension\",\n \"version\": \"0.3.8\"\n },\n - \ \"sha256Digest\": \"546af88e93fb857552183869a12001020897f7b724cc1f350936971635302ef4\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.9-py3-none-any.whl\",\n - \ \"filename\": \"serviceconnector_passwordless-0.3.9-py3-none-any.whl\",\n + Extension\",\n \"version\": \"2.0.0\"\n },\n + \ \"sha256Digest\": \"2da75d871e2f4ba0585d6609978beaa17511ba7ffbc298aaf10d2c58b8310cb1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-2.0.1-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-2.0.1-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + false,\n \"azext.minCliCoreVersion\": \"2.60.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -35792,18 +42401,18 @@ interactions: \ \"run_requires\": [\n {\n \"requires\": [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n \ \"azure-core\",\n \"azure-core\",\n - \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n - \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + \ \"azure-mgmt-servicelinker (==1.2.0b2)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b2\",\n \"psycopg2-binary (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless - Extension\",\n \"version\": \"0.3.9\"\n },\n - \ \"sha256Digest\": \"48e3b58838945f62f6aecac7579b00f3a71d6d4db7f8f34af39d6308a26bd445\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.11-py3-none-any.whl\",\n - \ \"filename\": \"serviceconnector_passwordless-0.3.11-py3-none-any.whl\",\n + Extension\",\n \"version\": \"2.0.1\"\n },\n + \ \"sha256Digest\": \"65f6db04c42d74474534a8dc3d59066cc04325b72551a7045fd9d298350b3ad0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-2.0.2-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-2.0.2-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.46.0\",\n \"classifiers\": + false,\n \"azext.minCliCoreVersion\": \"2.60.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -35827,18 +42436,18 @@ interactions: \ \"run_requires\": [\n {\n \"requires\": [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n \ \"azure-core\",\n \"azure-core\",\n - \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n - \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + \ \"azure-mgmt-servicelinker (==1.2.0b2)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b2\",\n \"psycopg2-binary (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless - Extension\",\n \"version\": \"0.3.11\"\n },\n - \ \"sha256Digest\": \"bb8d273e2b221c439fb5d418ddf2d8591e3382f2efba85ce384e6dcb93488a38\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.12-py3-none-any.whl\",\n - \ \"filename\": \"serviceconnector_passwordless-0.3.12-py3-none-any.whl\",\n + Extension\",\n \"version\": \"2.0.2\"\n },\n + \ \"sha256Digest\": \"19001ff4ebcd5b4b2cc890a7cdef6fdd1bc404d9e29c03c5adcfe59355864671\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-2.0.3-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-2.0.3-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + false,\n \"azext.minCliCoreVersion\": \"2.60.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -35862,18 +42471,18 @@ interactions: \ \"run_requires\": [\n {\n \"requires\": [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n \ \"azure-core\",\n \"azure-core\",\n - \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n - \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + \ \"azure-mgmt-servicelinker (==1.2.0b2)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b2\",\n \"psycopg2-binary (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless - Extension\",\n \"version\": \"0.3.12\"\n },\n - \ \"sha256Digest\": \"7d3fadef5e1dddc362f043c8b0a802668c24187c68fdf8e33797250f5276ee2f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-0.3.13-py3-none-any.whl\",\n - \ \"filename\": \"serviceconnector_passwordless-0.3.13-py3-none-any.whl\",\n + Extension\",\n \"version\": \"2.0.3\"\n },\n + \ \"sha256Digest\": \"045240af31f6ba900b9743f10c2e7a552e5c09c31aec8bec63ce05e7e96fd7e7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/serviceconnector_passwordless-2.0.5-py3-none-any.whl\",\n + \ \"filename\": \"serviceconnector_passwordless-2.0.5-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": - true,\n \"azext.minCliCoreVersion\": \"2.53.0\",\n \"classifiers\": + false,\n \"azext.minCliCoreVersion\": \"2.60.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \"Intended Audience :: System Administrators\",\n \"Programming Language :: @@ -35897,14 +42506,14 @@ interactions: \ \"run_requires\": [\n {\n \"requires\": [\n \"PyMySQL (==1.0.2)\",\n \"PyMySQL==1.0.2\",\n \ \"azure-core\",\n \"azure-core\",\n - \ \"azure-mgmt-servicelinker (==1.2.0b1)\",\n - \ \"azure-mgmt-servicelinker==1.2.0b1\",\n \"psycopg2-binary + \ \"azure-mgmt-servicelinker (==1.2.0b2)\",\n + \ \"azure-mgmt-servicelinker==1.2.0b2\",\n \"psycopg2-binary (==2.9.5)\",\n \"psycopg2-binary==2.9.5\",\n \ \"pyodbc (==4.0.35)\",\n \"pyodbc==4.0.35\"\n \ ]\n }\n ],\n \ \"summary\": \"Microsoft Azure Command-Line Tools Serviceconnector-passwordless - Extension\",\n \"version\": \"0.3.13\"\n },\n - \ \"sha256Digest\": \"0948c4b5cb9ef84ad4470b3947d67034aef0531fba24d97782f48e0aacb2801a\"\n + Extension\",\n \"version\": \"2.0.5\"\n },\n + \ \"sha256Digest\": \"27b8c5f6e1b576ce2c3a74e967851398e2e0bca77faaccb890410e66dcf9c304\"\n \ }\n ],\n \"site-recovery\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/site_recovery-1.0.0-py3-none-any.whl\",\n \ \"filename\": \"site_recovery-1.0.0-py3-none-any.whl\",\n @@ -36113,10 +42722,478 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.5\"\n },\n - \ \"sha256Digest\": \"091004e8bfea9c39fbb192065b2355018f6a3ab1041e914ace26f8c02ef14687\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.7-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.7-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.1.5\"\n },\n + \ \"sha256Digest\": \"091004e8bfea9c39fbb192065b2355018f6a3ab1041e914ace26f8c02ef14687\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.7-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.7-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.7\"\n },\n + \ \"sha256Digest\": \"351b7e2d1b434f72eeaa1a8392a57e2c2cb52223d2140c446de85e339f7c457d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.8-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.8-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.8\"\n },\n + \ \"sha256Digest\": \"e0ff591d3833ea873c4e3ba72c33f314c67ff01cf3da2da358a2b40cea9b6bb0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.9-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.9-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.9\"\n },\n + \ \"sha256Digest\": \"bb71dbe3b05a6bc32bce1b12a5793dd6171dbed226d3173f115ffe411a8044df\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.10-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.10-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.10\"\n },\n + \ \"sha256Digest\": \"864200fb0cc9f988e40db675c6b6b016c2fcff91ff25551c03a576ae0dd4096b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.11-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.11-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.11\"\n },\n + \ \"sha256Digest\": \"be1471eb6aa6a462d13f352f643f4267fa8411c73f17d2b6d0f842229860dde8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.12-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.12-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.12\"\n },\n + \ \"sha256Digest\": \"ae1c41d2d09150c600e51d6de3a085a04d079b6803bdf4fcba6b041460f46a8d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.13-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.13-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.13\"\n },\n + \ \"sha256Digest\": \"c3d968114b8e68b522962dccba958bc43b0235af55c417ad5cf6b6a25f1a9444\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.14-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.1.14-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.1.14\"\n },\n + \ \"sha256Digest\": \"e7d57cac5569ee8b530ddc51cf44ff45eedbdf5f94fadbb058e79eea705758a8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.2.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.2.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.2.0\"\n },\n + \ \"sha256Digest\": \"36ff3ca0812a809dcfda55b4510194f3a53891b7f5a7a2bb0bc5385c072e9fae\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.3.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.3.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.3.0\"\n },\n + \ \"sha256Digest\": \"5021a61fc3d91bcd78ce38f15d2d1de977d6aa9c15e87cfc9d45c653a01076d6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.4.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.4.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.4.0\"\n },\n + \ \"sha256Digest\": \"e808882388d07ccbd1b96a176a3d992b8434296a16af816a6dd19e13bb228d55\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.4.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.4.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.4.1\"\n },\n + \ \"sha256Digest\": \"bca1287b8fb6cd2e1d4b1d4d92859840ee5e44223225942756d067cd0eeed8d8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.4.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.4.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.4.2\"\n },\n + \ \"sha256Digest\": \"6a56032cea46be8a2e3cd27242c73481d2b2f31074456cb31c868a051eda3127\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.5.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.5.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.5.0\"\n },\n + \ \"sha256Digest\": \"b553b17bdeab27e2c69f9dd3957e5e59efc664b9405e581809a2730cc7ef5619\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.0-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.6.0\"\n },\n + \ \"sha256Digest\": \"30839266640b6e89a183107ede0abcdec3363cd5831fe36c179107d267faa57b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.6.1\"\n },\n + \ \"sha256Digest\": \"37a32ef1b28f9e1ecd1f61a76bf6a44bf063746a5401894dd513999afdeed0b0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.6.2\"\n },\n + \ \"sha256Digest\": \"6718bc1fb7ff0e106b3e00603d900adab9e2ed7b7939a0e1ed223d5cdf7924fc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.3-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.38.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"spring\",\n \"summary\": \"Microsoft Azure Command-Line + Tools spring Extension\",\n \"version\": \"1.6.3\"\n },\n + \ \"sha256Digest\": \"0dcbb166127c0f4eb0b33eb70ea108b6c7e9f470858c12da30eecb483eb0080b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.4-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.4-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36139,10 +43216,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.7\"\n },\n - \ \"sha256Digest\": \"351b7e2d1b434f72eeaa1a8392a57e2c2cb52223d2140c446de85e339f7c457d\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.8-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.8-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.6.4\"\n },\n + \ \"sha256Digest\": \"a52902d1a828827847c2b8a571fcd3970ee6c006a49ed1fcfd57e581bfefa251\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.5-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.5-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36165,10 +43242,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.8\"\n },\n - \ \"sha256Digest\": \"e0ff591d3833ea873c4e3ba72c33f314c67ff01cf3da2da358a2b40cea9b6bb0\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.9-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.9-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.6.5\"\n },\n + \ \"sha256Digest\": \"a00363a73db626180830a20c0465874f6d4062dad07862e1b4a22f8c1908dca8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.6-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.6-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36191,10 +43268,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.9\"\n },\n - \ \"sha256Digest\": \"bb71dbe3b05a6bc32bce1b12a5793dd6171dbed226d3173f115ffe411a8044df\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.10-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.10-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.6.6\"\n },\n + \ \"sha256Digest\": \"34064f43b620a36f1f8aa20200990297aaaf91c58795e0274d6f719136b029a4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.7-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.7-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36217,10 +43294,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.10\"\n },\n - \ \"sha256Digest\": \"864200fb0cc9f988e40db675c6b6b016c2fcff91ff25551c03a576ae0dd4096b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.11-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.11-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.6.7\"\n },\n + \ \"sha256Digest\": \"7d9a8d4f792962dd1f713a839f9099bcf04c24958411f8e0edc4ef47321b87a3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.8-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.6.8-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36243,10 +43320,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.11\"\n },\n - \ \"sha256Digest\": \"be1471eb6aa6a462d13f352f643f4267fa8411c73f17d2b6d0f842229860dde8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.12-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.12-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.6.8\"\n },\n + \ \"sha256Digest\": \"2286a779c293a47a4f2d01c2699f6d01ac8d28ac471c07e97f4c9f38750e6c92\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.7.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.38.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36269,12 +43346,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.12\"\n },\n - \ \"sha256Digest\": \"ae1c41d2d09150c600e51d6de3a085a04d079b6803bdf4fcba6b041460f46a8d\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.13-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.13-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.7.0\"\n },\n + \ \"sha256Digest\": \"913b70f5f98b1da973fdb8324916ebc8fef4747a872b834efcbdef19101cb424\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.7.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36295,12 +43372,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.13\"\n },\n - \ \"sha256Digest\": \"c3d968114b8e68b522962dccba958bc43b0235af55c417ad5cf6b6a25f1a9444\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.1.14-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.1.14-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.7.1\"\n },\n + \ \"sha256Digest\": \"4a4252041f9b0395cf6614b86b1c93afd94ac92d75ab82daae6634b0dbfa60a5\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.7.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36321,12 +43398,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.1.14\"\n },\n - \ \"sha256Digest\": \"e7d57cac5569ee8b530ddc51cf44ff45eedbdf5f94fadbb058e79eea705758a8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.2.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.2.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.7.2\"\n },\n + \ \"sha256Digest\": \"b4a5740ff04788a947d6c67c57cea71b3a3e3244adb7d19bc02e52ccd7c4fea0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.7.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36347,12 +43424,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.2.0\"\n },\n - \ \"sha256Digest\": \"36ff3ca0812a809dcfda55b4510194f3a53891b7f5a7a2bb0bc5385c072e9fae\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.3.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.3.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.7.3\"\n },\n + \ \"sha256Digest\": \"a58e5fec5be4068420a10e14072bc788caf2782908c3406c92c761c4619426ec\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.8.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.8.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36373,12 +43450,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.3.0\"\n },\n - \ \"sha256Digest\": \"5021a61fc3d91bcd78ce38f15d2d1de977d6aa9c15e87cfc9d45c653a01076d6\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.4.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.4.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.8.0\"\n },\n + \ \"sha256Digest\": \"d83225658e5959ee43b9dac59ec9d9488fc3f3158f09f99f5d97ab58f1549c17\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.9.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.9.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36399,12 +43476,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.4.0\"\n },\n - \ \"sha256Digest\": \"e808882388d07ccbd1b96a176a3d992b8434296a16af816a6dd19e13bb228d55\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.4.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.4.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.9.0\"\n },\n + \ \"sha256Digest\": \"9efab0aa23a5aba4ed754b25e1197b9b1e960184cecd10237d3ebad66c3c1a78\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.9.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.9.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36425,12 +43502,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.4.1\"\n },\n - \ \"sha256Digest\": \"bca1287b8fb6cd2e1d4b1d4d92859840ee5e44223225942756d067cd0eeed8d8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.4.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.4.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.9.1\"\n },\n + \ \"sha256Digest\": \"3b07830d1a32c045af46de4c77250db5ea65fba26f1d9bb8f7f8582a923d34b2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.9.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.9.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36451,12 +43528,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.4.2\"\n },\n - \ \"sha256Digest\": \"6a56032cea46be8a2e3cd27242c73481d2b2f31074456cb31c868a051eda3127\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.5.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.5.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.9.2\"\n },\n + \ \"sha256Digest\": \"36b30260e23bef6398eb153090379d8784d6b3868fa41d1748e447a37a21c874\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.10.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.10.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36477,12 +43554,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.5.0\"\n },\n - \ \"sha256Digest\": \"b553b17bdeab27e2c69f9dd3957e5e59efc664b9405e581809a2730cc7ef5619\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.10.0\"\n },\n + \ \"sha256Digest\": \"031895d8e91ad28eb8edda87b34bd704d8ed8b471597bcaaa0064ff2c408c101\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.11.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36503,12 +43580,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.0\"\n },\n - \ \"sha256Digest\": \"30839266640b6e89a183107ede0abcdec3363cd5831fe36c179107d267faa57b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.11.0\"\n },\n + \ \"sha256Digest\": \"a02e5fe4531399d9e2d790004e55ce21d19dd384e2da377244beeb7342239291\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.11.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36529,12 +43606,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.1\"\n },\n - \ \"sha256Digest\": \"37a32ef1b28f9e1ecd1f61a76bf6a44bf063746a5401894dd513999afdeed0b0\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.11.1\"\n },\n + \ \"sha256Digest\": \"7cb83c3cb8811f10c724d7d321510821b9c8ca7103927820c8aab8257a063f44\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.11.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36555,12 +43632,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.2\"\n },\n - \ \"sha256Digest\": \"6718bc1fb7ff0e106b3e00603d900adab9e2ed7b7939a0e1ed223d5cdf7924fc\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.3-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.3-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.11.2\"\n },\n + \ \"sha256Digest\": \"6122206a0eb4de9bde73b8a8975b8f1b7ccf120e8b419dadbd890921c068120a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.11.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36581,12 +43658,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.3\"\n },\n - \ \"sha256Digest\": \"0dcbb166127c0f4eb0b33eb70ea108b6c7e9f470858c12da30eecb483eb0080b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.4-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.4-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.11.3\"\n },\n + \ \"sha256Digest\": \"415dce682cd5636d234e0b36f015322b0fb5062a0a7955bc8f9a122cdd7f9c0e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.12.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.12.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36607,12 +43684,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.4\"\n },\n - \ \"sha256Digest\": \"a52902d1a828827847c2b8a571fcd3970ee6c006a49ed1fcfd57e581bfefa251\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.5-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.5-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.12.0\"\n },\n + \ \"sha256Digest\": \"8d2a4bf4fa2bad75868b1f1dabfe5e6d41e93affd29098f1c818486174aed3ec\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.12.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.12.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36633,12 +43710,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.5\"\n },\n - \ \"sha256Digest\": \"a00363a73db626180830a20c0465874f6d4062dad07862e1b4a22f8c1908dca8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.6-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.6-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.12.1\"\n },\n + \ \"sha256Digest\": \"8b4ddd8caa4df29b8e98e4d258ce2ca36d146387300b7b289c705de760bd75ff\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.12.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.12.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36659,12 +43736,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.6\"\n },\n - \ \"sha256Digest\": \"34064f43b620a36f1f8aa20200990297aaaf91c58795e0274d6f719136b029a4\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.7-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.7-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.12.2\"\n },\n + \ \"sha256Digest\": \"89e1762ee425d9d535b563799b9ef8bca1dbdc1083e217b6f5403c5b737e8ce0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.13.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36685,12 +43762,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.7\"\n },\n - \ \"sha256Digest\": \"7d9a8d4f792962dd1f713a839f9099bcf04c24958411f8e0edc4ef47321b87a3\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.6.8-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.6.8-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.13.0\"\n },\n + \ \"sha256Digest\": \"ad70a699f7b14f3fa7099a4ea4da31cd62f7222ce3fe7b8f705df16750dd3dcb\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.13.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36711,12 +43788,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.6.8\"\n },\n - \ \"sha256Digest\": \"2286a779c293a47a4f2d01c2699f6d01ac8d28ac471c07e97f4c9f38750e6c92\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.7.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.13.1\"\n },\n + \ \"sha256Digest\": \"bc70bf2099410034e833c95c76b4b35366916f3f50f53bb22cfbdc6c9224754d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.13.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.38.0\",\n \"classifiers\": [\n \"Development + \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -36737,10 +43814,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.7.0\"\n },\n - \ \"sha256Digest\": \"913b70f5f98b1da973fdb8324916ebc8fef4747a872b834efcbdef19101cb424\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.7.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.13.2\"\n },\n + \ \"sha256Digest\": \"e87768d4df7b6a633f9c0ea50216a49c382d3a681a4f8c2a39021cc802092887\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.13.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36763,10 +43840,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.7.1\"\n },\n - \ \"sha256Digest\": \"4a4252041f9b0395cf6614b86b1c93afd94ac92d75ab82daae6634b0dbfa60a5\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.7.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.13.3\"\n },\n + \ \"sha256Digest\": \"694913f936898e8a3c06feae951be4c979913a3fc04d4a5eeb944f1586406cac\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.14.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.14.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36789,10 +43866,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.7.2\"\n },\n - \ \"sha256Digest\": \"b4a5740ff04788a947d6c67c57cea71b3a3e3244adb7d19bc02e52ccd7c4fea0\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.7.3-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.7.3-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.14.0\"\n },\n + \ \"sha256Digest\": \"3452d273b7e2bda35c592944518ff65cc148c06369a5b976af84100f1b6be719\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.14.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.14.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36815,10 +43892,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.7.3\"\n },\n - \ \"sha256Digest\": \"a58e5fec5be4068420a10e14072bc788caf2782908c3406c92c761c4619426ec\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.8.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.8.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.14.2\"\n },\n + \ \"sha256Digest\": \"9264d442d0fe12960e1e9fdaa2b2863a51b87eed0d3ffc6b6c85ce4261cd937f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.14.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.14.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36841,88 +43918,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.8.0\"\n },\n - \ \"sha256Digest\": \"d83225658e5959ee43b9dac59ec9d9488fc3f3158f09f99f5d97ab58f1549c17\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.9.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.9.0-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n - \ \"License :: OSI Approved :: MIT License\"\n ],\n - \ \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.9.0\"\n },\n - \ \"sha256Digest\": \"9efab0aa23a5aba4ed754b25e1197b9b1e960184cecd10237d3ebad66c3c1a78\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.9.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.9.1-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n - \ \"License :: OSI Approved :: MIT License\"\n ],\n - \ \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.9.1\"\n },\n - \ \"sha256Digest\": \"3b07830d1a32c045af46de4c77250db5ea65fba26f1d9bb8f7f8582a923d34b2\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.9.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.9.2-py3-none-any.whl\",\n \"metadata\": - {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development - Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n - \ \"Intended Audience :: System Administrators\",\n - \ \"Programming Language :: Python\",\n \"Programming - Language :: Python :: 3\",\n \"Programming Language - :: Python :: 3.6\",\n \"Programming Language :: Python - :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n - \ \"License :: OSI Approved :: MIT License\"\n ],\n - \ \"extensions\": {\n \"python.details\": - {\n \"contacts\": [\n {\n - \ \"email\": \"azpycli@microsoft.com\",\n - \ \"name\": \"Microsoft Corporation\",\n - \ \"role\": \"author\"\n }\n - \ ],\n \"document_names\": - {\n \"description\": \"DESCRIPTION.rst\"\n - \ },\n \"project_urls\": - {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/spring\"\n - \ }\n }\n },\n - \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": - \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": - \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.9.2\"\n },\n - \ \"sha256Digest\": \"36b30260e23bef6398eb153090379d8784d6b3868fa41d1748e447a37a21c874\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.10.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.10.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.14.3\"\n },\n + \ \"sha256Digest\": \"c8eafccfd0c0d31e732fdb6ff18b7c647ea70587687bafec355ed1fa40d75346\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.15.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.15.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36945,10 +43944,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.10.0\"\n },\n - \ \"sha256Digest\": \"031895d8e91ad28eb8edda87b34bd704d8ed8b471597bcaaa0064ff2c408c101\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.11.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.15.0\"\n },\n + \ \"sha256Digest\": \"ca61934f24ccd5640747de02039081fc33493ebec2b462961dd398aeefb041e8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.15.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.15.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36971,10 +43970,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.11.0\"\n },\n - \ \"sha256Digest\": \"a02e5fe4531399d9e2d790004e55ce21d19dd384e2da377244beeb7342239291\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.11.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.15.1\"\n },\n + \ \"sha256Digest\": \"d01289fadaa3f8a024089d21699490260d5a04752751a07a225e0b1668cf28a1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.16.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.16.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -36997,10 +43996,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.11.1\"\n },\n - \ \"sha256Digest\": \"7cb83c3cb8811f10c724d7d321510821b9c8ca7103927820c8aab8257a063f44\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.11.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.16.0\"\n },\n + \ \"sha256Digest\": \"ccea329952e48382372742fc179bcad391fcdae94692b33da14ca80d9c344487\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.17.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.17.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37023,10 +44022,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.11.2\"\n },\n - \ \"sha256Digest\": \"6122206a0eb4de9bde73b8a8975b8f1b7ccf120e8b419dadbd890921c068120a\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.11.3-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.11.3-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.17.0\"\n },\n + \ \"sha256Digest\": \"1914ab006f731d3ed27eae28429134dcf5ccd4fd5cc46d0dcf773277dd7cb53b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.18.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.18.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37049,10 +44048,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.11.3\"\n },\n - \ \"sha256Digest\": \"415dce682cd5636d234e0b36f015322b0fb5062a0a7955bc8f9a122cdd7f9c0e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.12.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.12.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.18.0\"\n },\n + \ \"sha256Digest\": \"8ee1a9ac7bbc649d37c328ebf62994180689e64778d225dbc046a848208498f1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.19.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37075,10 +44074,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.12.0\"\n },\n - \ \"sha256Digest\": \"8d2a4bf4fa2bad75868b1f1dabfe5e6d41e93affd29098f1c818486174aed3ec\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.12.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.12.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.19.0\"\n },\n + \ \"sha256Digest\": \"770e81524dab1c51788dbd82b0b1a5ef3bc99738b481babdd6335605f12d9eea\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.19.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37101,10 +44100,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.12.1\"\n },\n - \ \"sha256Digest\": \"8b4ddd8caa4df29b8e98e4d258ce2ca36d146387300b7b289c705de760bd75ff\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.12.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.12.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.19.1\"\n },\n + \ \"sha256Digest\": \"b9f9e224aeafbc9a774adec2222a5efcc76ba88a0d50ef3aaebb69d59cbd9812\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.19.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37127,10 +44126,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.12.2\"\n },\n - \ \"sha256Digest\": \"89e1762ee425d9d535b563799b9ef8bca1dbdc1083e217b6f5403c5b737e8ce0\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.13.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.19.2\"\n },\n + \ \"sha256Digest\": \"fcd04cee0a1778ed6ee5fd3ec470f919ba4f2f133fbb93737164a65b17eab76b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.19.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37153,10 +44152,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.13.0\"\n },\n - \ \"sha256Digest\": \"ad70a699f7b14f3fa7099a4ea4da31cd62f7222ce3fe7b8f705df16750dd3dcb\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.13.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.19.3\"\n },\n + \ \"sha256Digest\": \"80cbd41e563231e500670402b01e95150adce18b7c128320c3d2393284e0d5d5\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.4-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.19.4-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37179,10 +44178,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.13.1\"\n },\n - \ \"sha256Digest\": \"bc70bf2099410034e833c95c76b4b35366916f3f50f53bb22cfbdc6c9224754d\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.13.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.19.4\"\n },\n + \ \"sha256Digest\": \"9a278e1ffc07c31c575b9837ad86002427f7a39175581724e8aedc91d407bc01\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.20.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.20.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37205,10 +44204,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.13.2\"\n },\n - \ \"sha256Digest\": \"e87768d4df7b6a633f9c0ea50216a49c382d3a681a4f8c2a39021cc802092887\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.13.3-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.13.3-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.20.0\"\n },\n + \ \"sha256Digest\": \"7dd09706b04194a1f3d762d0f88fffa9d51d94e81b83a700fb217001dc1d7702\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.20.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.20.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.45.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -37231,12 +44230,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.13.3\"\n },\n - \ \"sha256Digest\": \"694913f936898e8a3c06feae951be4c979913a3fc04d4a5eeb944f1586406cac\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.14.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.14.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.20.1\"\n },\n + \ \"sha256Digest\": \"3f0fa8b87858c4b313bf2772975c58ff76dcecbf35309c220150105f644209c6\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.21.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.21.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37257,12 +44256,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.14.0\"\n },\n - \ \"sha256Digest\": \"3452d273b7e2bda35c592944518ff65cc148c06369a5b976af84100f1b6be719\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.14.2-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.14.2-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.21.0\"\n },\n + \ \"sha256Digest\": \"a513aff7c4034e4b7016b948ae6fcfabcc0c754c1631d619233ea7bf61508ab1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.22.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.22.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37283,12 +44282,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.14.2\"\n },\n - \ \"sha256Digest\": \"9264d442d0fe12960e1e9fdaa2b2863a51b87eed0d3ffc6b6c85ce4261cd937f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.14.3-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.14.3-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.22.0\"\n },\n + \ \"sha256Digest\": \"bfc252e596b14d4212e017b1d64d5c9882f25ee61f7684bfd4e187f3b19bb497\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.23.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.23.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37309,12 +44308,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.14.3\"\n },\n - \ \"sha256Digest\": \"c8eafccfd0c0d31e732fdb6ff18b7c647ea70587687bafec355ed1fa40d75346\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.15.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.15.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.23.0\"\n },\n + \ \"sha256Digest\": \"249c22d850131babda049e4524be50ecd6abe76dc88998f91a4c0985928c83cd\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.24.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.24.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37335,12 +44334,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.15.0\"\n },\n - \ \"sha256Digest\": \"ca61934f24ccd5640747de02039081fc33493ebec2b462961dd398aeefb041e8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.15.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.15.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.24.0\"\n },\n + \ \"sha256Digest\": \"92b6b4f07d1a5f1f19892735697e2bce813910f0840f920d9205d490cca52fcc\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.24.1-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.24.1-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37361,12 +44360,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.15.1\"\n },\n - \ \"sha256Digest\": \"d01289fadaa3f8a024089d21699490260d5a04752751a07a225e0b1668cf28a1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.16.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.16.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.24.1\"\n },\n + \ \"sha256Digest\": \"d47c8dcffd935d85cc924d88335e4feabfa5c8528b86d538e4d0ce0abda1762d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.24.2-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.24.2-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37387,12 +44386,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.16.0\"\n },\n - \ \"sha256Digest\": \"ccea329952e48382372742fc179bcad391fcdae94692b33da14ca80d9c344487\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.17.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.17.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.24.2\"\n },\n + \ \"sha256Digest\": \"2bce0075fcf2365cca884f6acd1385f2d769ef7a20f122c04f27f77bac30c0ad\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.24.3-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.24.3-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37413,12 +44412,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.17.0\"\n },\n - \ \"sha256Digest\": \"1914ab006f731d3ed27eae28429134dcf5ccd4fd5cc46d0dcf773277dd7cb53b\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.18.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.18.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.24.3\"\n },\n + \ \"sha256Digest\": \"8f173b6f3544ac73de36f1cd065aade3472b2056374de28c25c2082c51b5efb3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.24.4-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.24.4-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37439,12 +44438,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.18.0\"\n },\n - \ \"sha256Digest\": \"8ee1a9ac7bbc649d37c328ebf62994180689e64778d225dbc046a848208498f1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.0-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.19.0-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.24.4\"\n },\n + \ \"sha256Digest\": \"2e298a74b53fcac40d6173a5e9ea386568fcf73d88bde4c44b37c8b755b7555d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.24.5-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.24.5-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37465,12 +44464,12 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.19.0\"\n },\n - \ \"sha256Digest\": \"770e81524dab1c51788dbd82b0b1a5ef3bc99738b481babdd6335605f12d9eea\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.19.1-py3-none-any.whl\",\n - \ \"filename\": \"spring-1.19.1-py3-none-any.whl\",\n \"metadata\": + Tools spring Extension\",\n \"version\": \"1.24.5\"\n },\n + \ \"sha256Digest\": \"fc3d3d751da3262ef123904c3f9253eb7f0d6b1d3c6001aab69c5c6c1a9a89f8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/spring-1.25.0-py3-none-any.whl\",\n + \ \"filename\": \"spring-1.25.0-py3-none-any.whl\",\n \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": - \"2.45.0\",\n \"classifiers\": [\n \"Development + \"2.56.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -37491,8 +44490,8 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"spring\",\n \"summary\": \"Microsoft Azure Command-Line - Tools spring Extension\",\n \"version\": \"1.19.1\"\n },\n - \ \"sha256Digest\": \"b9f9e224aeafbc9a774adec2222a5efcc76ba88a0d50ef3aaebb69d59cbd9812\"\n + Tools spring Extension\",\n \"version\": \"1.25.0\"\n },\n + \ \"sha256Digest\": \"2b9cf4ae2fd52b5f644bfefba69ed5e574404597e3cab0e3a9b8e44e7b03363f\"\n \ }\n ],\n \"spring-cloud\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"spring_cloud-0.1.0-py2.py3-none-any.whl\",\n @@ -39402,6 +46401,67 @@ interactions: \ \"summary\": \"SSH into Azure VMs using RBAC and AAD OpenSSH Certificates\",\n \"version\": \"2.0.2\"\n },\n \ \"sha256Digest\": \"fe74b89a8b7ae41f0cb021a3211b5bdf3584ba99d907c7928ba6f4594ca723e9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/ssh-2.0.3-py3-none-any.whl\",\n + \ \"filename\": \"ssh-2.0.3-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.45.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/ssh\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ssh\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"oschmod (==0.3.12)\",\n \"oschmod==0.3.12\"\n + \ ]\n }\n ],\n + \ \"summary\": \"SSH into Azure VMs using RBAC and AAD OpenSSH + Certificates\",\n \"version\": \"2.0.3\"\n },\n + \ \"sha256Digest\": \"c63e790eab8b4e939551fa4a96f691c823c5dfe15de3a05a2db27108236430e3\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/ssh-2.0.4-py3-none-any.whl\",\n + \ \"filename\": \"ssh-2.0.4-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.45.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/ssh\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"ssh\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"oras (==0.1.30)\",\n \"oras==0.1.30\",\n + \ \"oschmod (==0.3.12)\",\n \"oschmod==0.3.12\"\n + \ ]\n }\n ],\n + \ \"summary\": \"SSH into Azure VMs using RBAC and AAD OpenSSH + Certificates\",\n \"version\": \"2.0.4\"\n },\n + \ \"sha256Digest\": \"f9154c0cae61ff13a8da589fff05a55dc8127120d720b7bf633efba28fb29034\"\n \ }\n ],\n \"stack-hci\": [\n {\n \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/stack_hci-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"stack_hci-0.1.0-py3-none-any.whl\",\n \"metadata\": @@ -39753,6 +46813,216 @@ interactions: \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line Tools Stack-HCi-VM Extension\",\n \"version\": \"0.1.8\"\n \ },\n \"sha256Digest\": \"9d92e9f019d0790be488b92fe84fa4ddfa2cd2b7c227808d6553abdcda3664af\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/SelfServiceVM/CLI/stack_hci_vm-0.1.11.1-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-0.1.11.1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://msazure.visualstudio.com/msk8s/_git/azstackhci-util?version=GBmain\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line + Tools AzureStackHCIClient Extension \",\n \"version\": + \"0.1.11\"\n },\n \"sha256Digest\": \"cc99134288545178d08b18abd5b7c9e3d099d2add8b52ab9308f6c5fd97ae60c\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/SelfServiceVM/CLI/stack_hci_vm-1.0.1-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-1.0.1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm\"\n + \ }\n }\n },\n + \ \"extras\": [],\n \"generator\": \"bdist_wheel + (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": + \"2.0\",\n \"name\": \"stack-hci-vm\",\n \"run_requires\": + [\n {\n \"requires\": [\n + \ \"azure-identity\",\n \"azure-identity\",\n + \ \"azure-mgmt-resourcegraph\",\n \"azure-mgmt-resourcegraph\"\n + \ ]\n }\n ],\n + \ \"summary\": \"Microsoft Azure Command-Line Tools Stack-HCi-VM + Extension\",\n \"version\": \"1.0.1\"\n },\n + \ \"sha256Digest\": \"f07527adb8d0b762619eaa67d270119e0170485b549fa3fcc1df6c93b9c21a88\"\n + \ },\n {\n \"downloadUrl\": \"https://hybridaksstorage.z13.web.core.windows.net/SelfServiceVM/CLI/stack_hci_vm-1.1.2-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-1.1.2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.15.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Stack-HCi-VM Extension\",\n \"version\": \"1.1.2\"\n + \ },\n \"sha256Digest\": \"eac2401a6aebfcacd2f9d7dd468c00024b2b83ecfe72e33c77697b04a2af0d20\"\n + \ },\n {\n \"downloadUrl\": \"https://hciarcvmsstorage.z13.web.core.windows.net/cli-extensions/stack_hci_vm-1.1.11-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-1.1.11-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.15.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Stack-HCi-VM Extension\",\n \"version\": \"1.1.11\"\n + \ },\n \"sha256Digest\": \"35810b2c3e02a7e3f0fa985c5bd443fbf94ccd72ac28b6ebff5aad1b2d7469aa\"\n + \ },\n {\n \"downloadUrl\": \"https://hciarcvmsstorage.z13.web.core.windows.net/cli-extensions/stack_hci_vm-1.1.12-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-1.1.12-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.15.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Stack-HCi-VM Extension\",\n \"version\": \"1.1.12\"\n + \ },\n \"sha256Digest\": \"de1cd45f5d1cf72dbec728b41ac6cd686a1c0f254cdc7ee361758d5dd8dc2974\"\n + \ },\n {\n \"downloadUrl\": \"https://hciarcvmsstorage.z13.web.core.windows.net/cli-extensions/stack_hci_vm-1.1.14-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-1.1.14-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.15.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Stack-HCi-VM Extension\",\n \"version\": \"1.1.14\"\n + \ },\n \"sha256Digest\": \"c48b293937a50a7bdcbbb8d5028062f08f65bf3cf7e88bf723ea90935f2ddb9c\"\n + \ },\n {\n \"downloadUrl\": \"https://hciarcvmsstorage.z13.web.core.windows.net/cli-extensions/stack_hci_vm-1.1.16-py3-none-any.whl\",\n + \ \"filename\": \"stack_hci_vm-1.1.16-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.15.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"stack-hci-vm\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Stack-HCi-VM Extension\",\n \"version\": \"1.1.16\"\n + \ },\n \"sha256Digest\": \"6b08c750b3c3898aab17c459ff626210c17ad12f960f2ab89204765a17d530da\"\n + \ }\n ],\n \"standbypool\": [\n {\n \"downloadUrl\": + \"https://azcliprod.blob.core.windows.net/cli-extensions/standbypool-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"standbypool-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/standbypool\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"standbypool\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Standbypool Extension.\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"44c03e320c8b49f52390e3c11d61b25a67afeffc18d62baa522c373142de0e15\"\n \ }\n ],\n \"staticwebapp\": [\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/staticwebapp-1.0.0-py3-none-any.whl\",\n \ \"filename\": \"staticwebapp-1.0.0-py3-none-any.whl\",\n \"metadata\": @@ -39780,6 +47050,33 @@ interactions: \"staticwebapp\",\n \"summary\": \"Microsoft Azure Command-Line Tools Staticwebapp Extension\",\n \"version\": \"1.0.0\"\n \ },\n \"sha256Digest\": \"fb1dcd876fc2d829cc7a1cc545e9445364d43357d888bb3deeb36a716b805717\"\n + \ }\n ],\n \"storage-actions\": [\n {\n + \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/storage_actions-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"storage_actions-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/storage-actions\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"storage-actions\",\n \"summary\": \"Microsoft Azure Command-Line + Tools StorageActions Extension.\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"07c5be256edbbe2c81d839e4c6d3d917a56b93921515028cf962393e1176331b\"\n \ }\n ],\n \"storage-blob-preview\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/storage_blob_preview-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"storage_blob_preview-0.1.0-py2.py3-none-any.whl\",\n @@ -40250,6 +47547,32 @@ interactions: \"storage-mover\",\n \"summary\": \"Microsoft Azure Command-Line Tools StorageMover Extension.\",\n \"version\": \"1.0.0\"\n \ },\n \"sha256Digest\": \"135a11f6d9f0b833ce3cc83914e289852f1f786083d294f647a0f90e01666f0d\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/storage_mover-1.1.0-py3-none-any.whl\",\n + \ \"filename\": \"storage_mover-1.1.0-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/storage-mover\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"storage-mover\",\n \"summary\": \"Microsoft Azure Command-Line + Tools StorageMover Extension.\",\n \"version\": \"1.1.0\"\n + \ },\n \"sha256Digest\": \"7d768aca50aa98978a0d929c46cffe60bf488a527665485da631b33444cae24c\"\n \ }\n ],\n \"storage-preview\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/storage_preview-0.2.8-py2.py3-none-any.whl\",\n \ \"filename\": \"storage_preview-0.2.8-py2.py3-none-any.whl\",\n @@ -40977,6 +48300,33 @@ interactions: \"storagesync\",\n \"summary\": \"Microsoft Azure Command-Line Tools MicrosoftStorageSync Extension\",\n \"version\": \"0.1.2\"\n },\n \"sha256Digest\": \"498aff0d83037e11a668915788a7a78c981d7241ad31e9fb7cf2f27725253261\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/storagesync-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"storagesync-1.0.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 2\",\n \"Programming Language + :: Python :: 2.7\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.4\",\n + \ \"Programming Language :: Python :: 3.5\",\n \"Programming + Language :: Python :: 3.6\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/storagesync\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"storagesync\",\n \"summary\": \"Microsoft Azure Command-Line + Tools MicrosoftStorageSync Extension\",\n \"version\": + \"1.0.0\"\n },\n \"sha256Digest\": \"1f6997e186199058e60d8fdc020c407d4f92d8e78286189c1887e57a371b43c1\"\n \ }\n ],\n \"stream-analytics\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/stream_analytics-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"stream_analytics-0.1.0-py2.py3-none-any.whl\",\n @@ -41290,6 +48640,57 @@ interactions: \"support\",\n \"summary\": \"Microsoft Azure Command-Line Tools Support Extension\",\n \"version\": \"1.0.3\"\n },\n \ \"sha256Digest\": \"9f5b4ebc6a90b48d2a3c18ce7b74d89240275dcf23aa836b8509882b1ee28c56\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/support-1.0.4-py2.py3-none-any.whl\",\n + \ \"filename\": \"support-1.0.4-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": + \"2.0.81\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-cli-extensions/tree/main/src/support\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"support\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Support Extension\",\n \"version\": \"1.0.4\"\n },\n + \ \"sha256Digest\": \"ac554e2b6362a9a6ff8e03000730df31dd72781aba8bbdcf05ceb44ce1b680a0\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/support-2.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"support-2.0.0-py2.py3-none-any.whl\",\n \"metadata\": + {\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.6\",\n \"Programming + Language :: Python :: 3.7\",\n \"Programming Language + :: Python :: 3.8\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/azure/azure-cli-extensions/tree/main/src/support\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"support\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Support Extension\",\n \"version\": \"2.0.0\"\n },\n + \ \"sha256Digest\": \"5dde97f8fb12eaa258530f68ec2cae00a957f30479835e9f5ed057940312741a\"\n \ }\n ],\n \"timeseriesinsights\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/timeseriesinsights-0.1.0-py3-none-any.whl\",\n \ \"filename\": \"timeseriesinsights-0.1.0-py3-none-any.whl\",\n @@ -41548,6 +48949,85 @@ interactions: \"traffic-collector\",\n \"summary\": \"Microsoft Azure Command-Line Tools TrafficCollector Extension.\",\n \"version\": \"0.1.2\"\n },\n \"sha256Digest\": \"98bda4d9a9233efb0ae1c5fae1a6c2a42942e8a71b0ebf19d3a7193548b13ff2\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/traffic_collector-0.1.3-py3-none-any.whl\",\n + \ \"filename\": \"traffic_collector-0.1.3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.40.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/traffic-collector\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"traffic-collector\",\n \"summary\": \"Microsoft Azure + Command-Line Tools TrafficCollector Extension.\",\n \"version\": + \"0.1.3\"\n },\n \"sha256Digest\": \"a144a4fda3bce84db22277bd8611084ae1ae39e0bb8c7b50619ec378711f57ba\"\n + \ }\n ],\n \"trustedsigning\": [\n {\n + \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/trustedsigning-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"trustedsigning-1.0.0b1-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/trustedsigning\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"trustedsigning\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Trustedsigning Extension.\",\n \"version\": \"1.0.0b1\"\n + \ },\n \"sha256Digest\": \"d49d6fe7430ae84096cb4914532a2abc8d9dc2bb46ca33226b686bc7a6e7fc37\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/trustedsigning-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"trustedsigning-1.0.0b2-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + true,\n \"azext.minCliCoreVersion\": \"2.57.0\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 3\",\n + \ \"Programming Language :: Python :: 3.7\",\n \"Programming + Language :: Python :: 3.8\",\n \"Programming Language + :: Python :: 3.9\",\n \"License :: OSI Approved :: + MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"document_names\": {\n \"description\": + \"DESCRIPTION.rst\"\n },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/trustedsigning\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"trustedsigning\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Trustedsigning Extension.\",\n \"version\": \"1.0.0b2\"\n + \ },\n \"sha256Digest\": \"c3ae869c1371493180b9ed71db0bdc3842bad54c8832beb6007118d26bed71e8\"\n \ }\n ],\n \"virtual-network-manager\": [\n {\n \ \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-0.5.1-py3-none-any.whl\",\n \ \"filename\": \"virtual_network_manager-0.5.1-py3-none-any.whl\",\n @@ -41600,11 +49080,37 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"0.5.2\"\n },\n \"sha256Digest\": \"a115ac51ef73b6ba377b289f15b3afe87b392bd462ae50c21c91b9f7fc2288c8\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-0.5.3-py3-none-any.whl\",\n - \ \"filename\": \"virtual_network_manager-0.5.3-py3-none-any.whl\",\n + \"0.5.2\"\n },\n \"sha256Digest\": \"a115ac51ef73b6ba377b289f15b3afe87b392bd462ae50c21c91b9f7fc2288c8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-0.5.3-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-0.5.3-py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.15.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.6\",\n \"Programming Language :: Python + :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/network-manager\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"virtual-network-manager\",\n \"summary\": \"Microsoft + Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": + \"0.5.3\"\n },\n \"sha256Digest\": \"6b956e955ac01eec26f1135cdadb58e4bc7349a7c3e4064a077433ddf88cccf9\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-0.6.0-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-0.6.0-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.15.0\",\n \"classifiers\": [\n \"Development + \"2.43.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -41626,11 +49132,11 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"0.5.3\"\n },\n \"sha256Digest\": \"6b956e955ac01eec26f1135cdadb58e4bc7349a7c3e4064a077433ddf88cccf9\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-0.6.0-py3-none-any.whl\",\n - \ \"filename\": \"virtual_network_manager-0.6.0-py3-none-any.whl\",\n + \"0.6.0\"\n },\n \"sha256Digest\": \"91215253b053ad19413345c789b5ed1cc79ab2af18624ad279dca24a7913730a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.0b1-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-1.0.0b1-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.43.0\",\n \"classifiers\": [\n \"Development + \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -41652,9 +49158,9 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"0.6.0\"\n },\n \"sha256Digest\": \"91215253b053ad19413345c789b5ed1cc79ab2af18624ad279dca24a7913730a\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.0b1-py3-none-any.whl\",\n - \ \"filename\": \"virtual_network_manager-1.0.0b1-py3-none-any.whl\",\n + \"1.0.0b1\"\n },\n \"sha256Digest\": \"094c473dc8feb568ae3ca3f7f716ab3adda4fb18e2b1db9579f13b8ad14d94cf\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.0b2-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-1.0.0b2-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -41678,9 +49184,9 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"1.0.0b1\"\n },\n \"sha256Digest\": \"094c473dc8feb568ae3ca3f7f716ab3adda4fb18e2b1db9579f13b8ad14d94cf\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.0b2-py3-none-any.whl\",\n - \ \"filename\": \"virtual_network_manager-1.0.0b2-py3-none-any.whl\",\n + \"1.0.0b2\"\n },\n \"sha256Digest\": \"3a8476fa6dcc072b49be7bdd9e1926392be4d16e41e0efa631f7f2a873583ca1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.0-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-1.0.0-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -41704,9 +49210,9 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"1.0.0b2\"\n },\n \"sha256Digest\": \"3a8476fa6dcc072b49be7bdd9e1926392be4d16e41e0efa631f7f2a873583ca1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.0-py3-none-any.whl\",\n - \ \"filename\": \"virtual_network_manager-1.0.0-py3-none-any.whl\",\n + \"1.0.0\"\n },\n \"sha256Digest\": \"4dbb5ddd86e2b2a0cb99e3e81f9f3b258c8a74490c91e94caa6f63e4b990ee48\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.1-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-1.0.1-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": \"2.51.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n @@ -41730,11 +49236,11 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"1.0.0\"\n },\n \"sha256Digest\": \"4dbb5ddd86e2b2a0cb99e3e81f9f3b258c8a74490c91e94caa6f63e4b990ee48\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.0.1-py3-none-any.whl\",\n - \ \"filename\": \"virtual_network_manager-1.0.1-py3-none-any.whl\",\n + \"1.0.1\"\n },\n \"sha256Digest\": \"a18581c625791fb29736e7ec1b9e18d4a00f3765a8600192e10c892fd27b7ba1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_network_manager-1.2.0-py3-none-any.whl\",\n + \ \"filename\": \"virtual_network_manager-1.2.0-py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.minCliCoreVersion\": - \"2.51.0\",\n \"classifiers\": [\n \"Development + \"2.57.0\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n \ \"Intended Audience :: System Administrators\",\n \ \"Programming Language :: Python\",\n \"Programming @@ -41756,7 +49262,7 @@ interactions: \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"virtual-network-manager\",\n \"summary\": \"Microsoft Azure Command-Line Tools NetworkManagementClient Extension\",\n \"version\": - \"1.0.1\"\n },\n \"sha256Digest\": \"a18581c625791fb29736e7ec1b9e18d4a00f3765a8600192e10c892fd27b7ba1\"\n + \"1.2.0\"\n },\n \"sha256Digest\": \"7f9f239fd7904645beacc2b738dd4660fb36779966e9b2331c43826e37564793\"\n \ }\n ],\n \"virtual-network-tap\": [\n {\n \ \"downloadUrl\": \"https://azurecliprod.blob.core.windows.net/cli-extensions/virtual_network_tap-0.1.0-py2.py3-none-any.whl\",\n \ \"filename\": \"virtual_network_tap-0.1.0-py2.py3-none-any.whl\",\n @@ -42369,6 +49875,32 @@ interactions: \"virtual-wan\",\n \"summary\": \"Manage virtual WAN, hubs, VPN gateways and VPN sites.\",\n \"version\": \"0.3.0\"\n \ },\n \"sha256Digest\": \"e5f4e9d4398cf0fcd656c0107386adbc8493e69e3158af6c5145ed23aaf77165\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/virtual_wan-1.0.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"virtual_wan-1.0.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 2\",\n \"Programming Language + :: Python :: 2.7\",\n \"Programming Language :: Python + :: 3\",\n \"Programming Language :: Python :: 3.4\",\n + \ \"Programming Language :: Python :: 3.5\",\n \"Programming + Language :: Python :: 3.6\",\n \"License :: OSI Approved + :: MIT License\"\n ],\n \"extensions\": + {\n \"python.details\": {\n \"contacts\": + [\n {\n \"email\": + \"azpycli@microsoft.com\",\n \"name\": + \"Microsoft Corporation\",\n \"role\": + \"author\"\n }\n ],\n + \ \"project_urls\": {\n \"Home\": + \"https://github.com/Azure/azure-cli-extensions/tree/main/src/virtual-wan\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"virtual-wan\",\n \"summary\": \"Manage virtual WAN, hubs, + VPN gateways and VPN sites.\",\n \"version\": \"1.0.0\"\n + \ },\n \"sha256Digest\": \"0ef7b4bf9ffd0aa1ad5c50e15a343276636bcfe0296e52d2ee5f0b75ce70633d\"\n \ }\n ],\n \"vm-repair\": [\n {\n \"downloadUrl\": \"https://azurecomputeaidrepair.blob.core.windows.net/prod/vm_repair-0.2.6-py2.py3-none-any.whl\",\n \ \"filename\": \"vm_repair-0.2.6-py2.py3-none-any.whl\",\n @@ -42814,10 +50346,206 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.4\"\n },\n - \ \"sha256Digest\": \"de9e7d77143dadc1606ebe079431ed974e483737cc001e89ff52335f60c938d1\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.5-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.4.5-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.4.4\"\n },\n + \ \"sha256Digest\": \"de9e7d77143dadc1606ebe079431ed974e483737cc001e89ff52335f60c938d1\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.5-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.4.5-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.4.5\"\n },\n + \ \"sha256Digest\": \"6fb1d3a83fb4e06581f850d68070d22ed7d29739633a336efaeb8155baadd0df\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.4.6-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.4.6\"\n },\n + \ \"sha256Digest\": \"79b261c39c6f90889d0bfa41581566bb8b659b492ca1f9a37d700518b1408b85\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.7-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.4.7-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.4.7\"\n },\n + \ \"sha256Digest\": \"bed73a688d073c97207daaa907816db5781b429b6f3441d1b618b463feff2fcb\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.8-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.4.8-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.4.8\"\n },\n + \ \"sha256Digest\": \"2ea0b50f1b484bc9c7ea72e9285163de489e726ef24cb2939620d3fa3c763c4a\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.9-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.4.9-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.4.9\"\n },\n + \ \"sha256Digest\": \"4fe3fe3af8d52b86ad51af08b642fe93f4de076947df8127e9825762e7c46769\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.10-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.4.10-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.4.10\"\n },\n + \ \"sha256Digest\": \"67e4fd4a5daf78c9e7244cabda74aede9d2c9c92d11dab4c3e3d431017e656c7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.0-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.0-py2.py3-none-any.whl\",\n + \ \"metadata\": {\n \"azext.isPreview\": + false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": + [\n \"Development Status :: 4 - Beta\",\n \"Intended + Audience :: Developers\",\n \"Intended Audience :: + System Administrators\",\n \"Programming Language :: + Python\",\n \"Programming Language :: Python :: 2\",\n + \ \"Programming Language :: Python :: 2.7\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.4\",\n \"Programming Language :: Python + :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"caiddev@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/vm-repair\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"vm-repair\",\n \"summary\": \"Auto repair commands to + fix VMs.\",\n \"version\": \"0.5.0\"\n },\n + \ \"sha256Digest\": \"dd5f2ec5d37aa6e745e9e706d4bd1d848f17f209807522831354ac0230c07f4c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -42842,10 +50570,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.5\"\n },\n - \ \"sha256Digest\": \"6fb1d3a83fb4e06581f850d68070d22ed7d29739633a336efaeb8155baadd0df\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.6-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.4.6-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.1\"\n },\n + \ \"sha256Digest\": \"91efbb3d2b46f01e6a4b04fd792f353dd702a8769319f59a0252fa35d7c409ab\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -42870,10 +50598,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.6\"\n },\n - \ \"sha256Digest\": \"79b261c39c6f90889d0bfa41581566bb8b659b492ca1f9a37d700518b1408b85\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.7-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.4.7-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.2\"\n },\n + \ \"sha256Digest\": \"959f9bae59170c8c8785e47f046f3634472243b76cf576f049ca4cdaded0534e\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -42898,10 +50626,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.7\"\n },\n - \ \"sha256Digest\": \"bed73a688d073c97207daaa907816db5781b429b6f3441d1b618b463feff2fcb\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.8-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.4.8-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.3\"\n },\n + \ \"sha256Digest\": \"6b71d6ddfb3a70057316ca760b0406417a330852ef184b2da239e417c4852dd4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.4-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -42926,10 +50654,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.8\"\n },\n - \ \"sha256Digest\": \"2ea0b50f1b484bc9c7ea72e9285163de489e726ef24cb2939620d3fa3c763c4a\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.9-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.4.9-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.4\"\n },\n + \ \"sha256Digest\": \"49938853a802b1415f697200402e26a74679805fe08f0ba6b2e066bb4af69730\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.5-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.5-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -42954,10 +50682,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.9\"\n },\n - \ \"sha256Digest\": \"4fe3fe3af8d52b86ad51af08b642fe93f4de076947df8127e9825762e7c46769\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.4.10-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.4.10-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.5\"\n },\n + \ \"sha256Digest\": \"feb439384e06c2a972f024a1d9eac7b766f03048fe1d142fe5043b3d583ca42f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.6-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -42982,10 +50710,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.4.10\"\n },\n - \ \"sha256Digest\": \"67e4fd4a5daf78c9e7244cabda74aede9d2c9c92d11dab4c3e3d431017e656c7\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.0-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.0-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.6\"\n },\n + \ \"sha256Digest\": \"ed46927769751d9bd3410979bef63dc2e7e3df5027e881e469c01c44eab67535\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.7-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.7-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43010,10 +50738,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.0\"\n },\n - \ \"sha256Digest\": \"dd5f2ec5d37aa6e745e9e706d4bd1d848f17f209807522831354ac0230c07f4c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.1-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.1-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.7\"\n },\n + \ \"sha256Digest\": \"bea352b15c0e1c5e0751c51e916f616b59e902256117f8cecd73c3f28928a89c\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.8-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.8-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43038,10 +50766,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.1\"\n },\n - \ \"sha256Digest\": \"91efbb3d2b46f01e6a4b04fd792f353dd702a8769319f59a0252fa35d7c409ab\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.2-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.2-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.8\"\n },\n + \ \"sha256Digest\": \"8f1d0dbc284a527af98d183df447533a295d5b7c81fc73e5f15c57182a03ce8f\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.9-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-0.5.9-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43066,10 +50794,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.2\"\n },\n - \ \"sha256Digest\": \"959f9bae59170c8c8785e47f046f3634472243b76cf576f049ca4cdaded0534e\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.3-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.3-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"0.5.9\"\n },\n + \ \"sha256Digest\": \"4e41adbfd52e88a21ae112ff8076f58ded8100e319963c0b5bbf105e7607be25\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.0b1-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.0b1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43094,10 +50822,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.3\"\n },\n - \ \"sha256Digest\": \"6b71d6ddfb3a70057316ca760b0406417a330852ef184b2da239e417c4852dd4\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.4-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.4-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.0b1\"\n },\n + \ \"sha256Digest\": \"7e6b9fb9952a56811d65de87b87b0403a6161edfa82284a43fa58f176e397b8b\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.1-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.1-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43122,10 +50850,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.4\"\n },\n - \ \"sha256Digest\": \"49938853a802b1415f697200402e26a74679805fe08f0ba6b2e066bb4af69730\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.5-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.5-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.1\"\n },\n + \ \"sha256Digest\": \"0b8d2814ba628765785accf730a220e5805f700a6d1f07a653f1c0d8f8e8dc03\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.2-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.2-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43150,10 +50878,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.5\"\n },\n - \ \"sha256Digest\": \"feb439384e06c2a972f024a1d9eac7b766f03048fe1d142fe5043b3d583ca42f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.6-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.6-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.2\"\n },\n + \ \"sha256Digest\": \"54945c836b3a91aed5a92eaca872c47e364dd3e846ab02aca637412488ead5b4\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.3-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.3-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43178,10 +50906,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.6\"\n },\n - \ \"sha256Digest\": \"ed46927769751d9bd3410979bef63dc2e7e3df5027e881e469c01c44eab67535\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.7-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.7-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.3\"\n },\n + \ \"sha256Digest\": \"3ea7181d6e5337cc9c85176467bafc413a2c1111a21ec06dd3e406f9cac82a93\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.4-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.4-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43206,10 +50934,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.7\"\n },\n - \ \"sha256Digest\": \"bea352b15c0e1c5e0751c51e916f616b59e902256117f8cecd73c3f28928a89c\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.8-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.8-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.4\"\n },\n + \ \"sha256Digest\": \"2adddc6d8cba9c6846a0c76f2612177a4d5b0813732f83534e4f8d0a48ddf9ab\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.5-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.5-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43234,10 +50962,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.8\"\n },\n - \ \"sha256Digest\": \"8f1d0dbc284a527af98d183df447533a295d5b7c81fc73e5f15c57182a03ce8f\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-0.5.9-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-0.5.9-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.5\"\n },\n + \ \"sha256Digest\": \"f2f7bc5698f89e0f6254464dc18d04d477dab4aab93296a46649018723855b26\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.6-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.6-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43262,10 +50990,10 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"0.5.9\"\n },\n - \ \"sha256Digest\": \"4e41adbfd52e88a21ae112ff8076f58ded8100e319963c0b5bbf105e7607be25\"\n - \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.0b1-py2.py3-none-any.whl\",\n - \ \"filename\": \"vm_repair-1.0.0b1-py2.py3-none-any.whl\",\n + fix VMs.\",\n \"version\": \"1.0.6\"\n },\n + \ \"sha256Digest\": \"c3fe396c4c769095f68fe765505e40ff4671b192e1a6daee584749044a906ca7\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/vm_repair-1.0.7-py2.py3-none-any.whl\",\n + \ \"filename\": \"vm_repair-1.0.7-py2.py3-none-any.whl\",\n \ \"metadata\": {\n \"azext.isPreview\": false,\n \"azext.minCliCoreVersion\": \"2.0.67\",\n \"classifiers\": [\n \"Development Status :: 4 - Beta\",\n \"Intended @@ -43290,8 +51018,8 @@ interactions: \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": \"vm-repair\",\n \"summary\": \"Auto repair commands to - fix VMs.\",\n \"version\": \"1.0.0b1\"\n },\n - \ \"sha256Digest\": \"7e6b9fb9952a56811d65de87b87b0403a6161edfa82284a43fa58f176e397b8b\"\n + fix VMs.\",\n \"version\": \"1.0.7\"\n },\n + \ \"sha256Digest\": \"989b15053fe19f1dbb37fd4a31720e2a1ca622ecadaaa4b5c568c44e44c20fa6\"\n \ }\n ],\n \"vmware\": [\n {\n \"downloadUrl\": \"https://github.com/virtustream/az-vmware-cli/releases/download/0.7.2/vmware-0.7.2-py2.py3-none-any.whl\",\n \ \"filename\": \"vmware-0.7.2-py2.py3-none-any.whl\",\n \"metadata\": @@ -43880,20 +51608,72 @@ interactions: \"workloads\",\n \"summary\": \"Microsoft Azure Command-Line Tools Workloads Extension.\",\n \"version\": \"0.1.0a1\"\n \ },\n \"sha256Digest\": \"0e5ba95c3799d043fc2ba869ce0c5b2eea200357a8b0cbd2b2733bb91d4cc7a8\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/workloads-1.1.0b1-py3-none-any.whl\",\n + \ \"filename\": \"workloads-1.1.0b1-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.55.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/workloads\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"workloads\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Workloads Extension.\",\n \"version\": \"1.1.0b1\"\n + \ },\n \"sha256Digest\": \"262c41b08b831d689802634bb1a0fea0add38c3611f27b2036576d45232a1ff5\"\n + \ },\n {\n \"downloadUrl\": \"https://azcliprod.blob.core.windows.net/cli-extensions/workloads-1.1.0b2-py3-none-any.whl\",\n + \ \"filename\": \"workloads-1.1.0b2-py3-none-any.whl\",\n \"metadata\": + {\n \"azext.isPreview\": true,\n \"azext.minCliCoreVersion\": + \"2.57.0\",\n \"classifiers\": [\n \"Development + Status :: 4 - Beta\",\n \"Intended Audience :: Developers\",\n + \ \"Intended Audience :: System Administrators\",\n + \ \"Programming Language :: Python\",\n \"Programming + Language :: Python :: 3\",\n \"Programming Language + :: Python :: 3.7\",\n \"Programming Language :: Python + :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n + \ \"License :: OSI Approved :: MIT License\"\n ],\n + \ \"extensions\": {\n \"python.details\": + {\n \"contacts\": [\n {\n + \ \"email\": \"azpycli@microsoft.com\",\n + \ \"name\": \"Microsoft Corporation\",\n + \ \"role\": \"author\"\n }\n + \ ],\n \"document_names\": + {\n \"description\": \"DESCRIPTION.rst\"\n + \ },\n \"project_urls\": + {\n \"Home\": \"https://github.com/Azure/azure-cli-extensions/tree/main/src/workloads\"\n + \ }\n }\n },\n + \ \"generator\": \"bdist_wheel (0.30.0)\",\n \"license\": + \"MIT\",\n \"metadata_version\": \"2.0\",\n \"name\": + \"workloads\",\n \"summary\": \"Microsoft Azure Command-Line + Tools Workloads Extension.\",\n \"version\": \"1.1.0b2\"\n + \ },\n \"sha256Digest\": \"716ec3db6d1d637da3d0255e83406aed3acd26b83405bbcadc4d30e1110beea3\"\n \ }\n ]\n },\n \"formatVersion\": \"1\"\n}" headers: content-length: - - '3583033' + - '4247270' content-md5: - - 5LjzhsDYgo50RzyT8yw4jQ== + - bBmScI4azYhgmhHogNWmXw== content-type: - application/json date: - - Wed, 10 Jan 2024 09:26:16 GMT + - Sun, 14 Jul 2024 19:59:13 GMT etag: - - '0x8DC117D4A52D3CE' + - '0x8DCA2363FB7BE21' last-modified: - - Wed, 10 Jan 2024 01:41:39 GMT + - Fri, 12 Jul 2024 05:48:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-blob-type: @@ -43919,31 +51699,33 @@ interactions: ParameterSetName: - -n -g --type User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_firewall_basic_sku_000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-01-10T09:17:08Z","module":"azure-firewall","Creator":"v-taoxuzeng@microsoft.com","DateCreated":"2024-01-10T09:19:16Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-07-14T19:45:45Z","module":"azure-firewall","Created":"2024-07-14T19:45:48.3253050Z","CreationDate":"2024-07-14T19:45:48.3252988Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '480' + - '492' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:21 GMT + - Sun, 14 Jul 2024 19:59:20 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 2AE663EAF39344B49DF74463097F5897 Ref B: MRS211050315023 Ref C: 2024-07-14T19:59:19Z' status: code: 200 message: OK @@ -43965,20 +51747,20 @@ interactions: ParameterSetName: - -n -g --type User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-network/22.2.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualWans/vwan-000007?api-version=2022-07-01 response: body: string: "{\r\n \"name\": \"vwan-000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualWans/vwan-000007\",\r\n - \ \"etag\": \"W/\\\"e83d6074-c18b-4e44-b6ba-860ac596fb15\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"9f52350c-70fd-4bd2-9f04-5e5293b9cba8\\\"\",\r\n \"type\": \"Microsoft.Network/virtualWans\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"disableVpnEncryption\": false,\r\n \"allowBranchToBranchTraffic\": true,\r\n \"office365LocalBreakoutCategory\": \"None\",\r\n \"type\": \"Standard\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/91171605-3070-4569-8a57-e3743003ec05?api-version=2022-07-01&t=638404755850674055&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=qb4uSmePUa0UCLXm6tBW9qg2MZVoGFBeL2fRmD3Idg-zeLwf1_wl4U8cJySS7eZU7X1OJRPq19-SbVS_U1gzkBAHlzTEr2OsEBQIqjGXGUyBb50tRGs-YwgJxNXl9TFEUbPUYjOZDtF8sukeLI3YHT6PS_fHPsEvYmtfmhZyTUndxWPjs-NYsm9m-4nwThUySvb6ZlXmXPc_AuGWIl8jsti2GH8z_1uIO2IzvtnPK-O67r2mJuXXKlsPP4LljBWwH-Pp4ga1CauDfPaS9YvbpyMLZB8RNC1VEbokCXfoYzLPVyDZk3q0UmKMv6o66vBNzzlhNm6Re1BSuvLXqlWK-g&h=ZbMGt0ddMGeCUhi0NCAoZEocqxiYUgnvplN6ImtPlwQ + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/0a53e459-4f8a-41be-ba91-0bb825db807a?api-version=2022-07-01&t=638565839660963982&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=WYoulbE8MqliTneVzTM1RgunC3hV9q7OkhnlR9ZMPk52jhbCcV3NtPCiDixiFnhLrNWfII03Wu3IIhZWHqIBuEzfdV5XGtoOO2UBrUL7xcsn5XkRnM_8l61CIzhl2vXiZ7kiLuOytGHCWtoLiyQjj1qR5kYxxVzglnKRt6aFxwlhLl0NYAZE6lKLK0Vjclk6kocSMYElhA0OHJst1O4GE92OAMXy2fi58FhSggeierKm5qkOuhP2dEspO_6tvXMwdraJMpxcIyHByrVx6UrEJMvWZXE4OXYWCxeDu-acFLJBp6lw9QFwBJj9IIVGjiVAOmu8R1mH7YcVGbRpyfhMTw&h=k11duIRzgPt8E9H8VYxlg1UvmB-ySy3gFQsvQJOzLgA cache-control: - no-cache content-length: @@ -43986,19 +51768,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:24 GMT + - Sun, 14 Jul 2024 19:59:25 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 800564D37B2D4ABEB0F8D90F7C3CA797 Ref B: MRS211050619029 Ref C: 2024-07-14T19:59:20Z' status: code: 201 message: Created @@ -44016,9 +51800,9 @@ interactions: ParameterSetName: - -n -g --type User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-network/22.2.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/91171605-3070-4569-8a57-e3743003ec05?api-version=2022-07-01&t=638404755850674055&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=qb4uSmePUa0UCLXm6tBW9qg2MZVoGFBeL2fRmD3Idg-zeLwf1_wl4U8cJySS7eZU7X1OJRPq19-SbVS_U1gzkBAHlzTEr2OsEBQIqjGXGUyBb50tRGs-YwgJxNXl9TFEUbPUYjOZDtF8sukeLI3YHT6PS_fHPsEvYmtfmhZyTUndxWPjs-NYsm9m-4nwThUySvb6ZlXmXPc_AuGWIl8jsti2GH8z_1uIO2IzvtnPK-O67r2mJuXXKlsPP4LljBWwH-Pp4ga1CauDfPaS9YvbpyMLZB8RNC1VEbokCXfoYzLPVyDZk3q0UmKMv6o66vBNzzlhNm6Re1BSuvLXqlWK-g&h=ZbMGt0ddMGeCUhi0NCAoZEocqxiYUgnvplN6ImtPlwQ + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/0a53e459-4f8a-41be-ba91-0bb825db807a?api-version=2022-07-01&t=638565839660963982&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=WYoulbE8MqliTneVzTM1RgunC3hV9q7OkhnlR9ZMPk52jhbCcV3NtPCiDixiFnhLrNWfII03Wu3IIhZWHqIBuEzfdV5XGtoOO2UBrUL7xcsn5XkRnM_8l61CIzhl2vXiZ7kiLuOytGHCWtoLiyQjj1qR5kYxxVzglnKRt6aFxwlhLl0NYAZE6lKLK0Vjclk6kocSMYElhA0OHJst1O4GE92OAMXy2fi58FhSggeierKm5qkOuhP2dEspO_6tvXMwdraJMpxcIyHByrVx6UrEJMvWZXE4OXYWCxeDu-acFLJBp6lw9QFwBJj9IIVGjiVAOmu8R1mH7YcVGbRpyfhMTw&h=k11duIRzgPt8E9H8VYxlg1UvmB-ySy3gFQsvQJOzLgA response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44030,24 +51814,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:25 GMT + - Sun, 14 Jul 2024 19:59:26 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d74262f8-26fa-4300-a288-58d23db78958 + - 808049e5-fcfb-4ab7-b3aa-c9130b54645f + x-msedge-ref: + - 'Ref A: D9BC8ED59E874EF097C20368FA097830 Ref B: MRS211050619029 Ref C: 2024-07-14T19:59:26Z' status: code: 200 message: OK @@ -44065,9 +51846,9 @@ interactions: ParameterSetName: - -n -g --type User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-network/22.2.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/91171605-3070-4569-8a57-e3743003ec05?api-version=2022-07-01&t=638404755850674055&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=qb4uSmePUa0UCLXm6tBW9qg2MZVoGFBeL2fRmD3Idg-zeLwf1_wl4U8cJySS7eZU7X1OJRPq19-SbVS_U1gzkBAHlzTEr2OsEBQIqjGXGUyBb50tRGs-YwgJxNXl9TFEUbPUYjOZDtF8sukeLI3YHT6PS_fHPsEvYmtfmhZyTUndxWPjs-NYsm9m-4nwThUySvb6ZlXmXPc_AuGWIl8jsti2GH8z_1uIO2IzvtnPK-O67r2mJuXXKlsPP4LljBWwH-Pp4ga1CauDfPaS9YvbpyMLZB8RNC1VEbokCXfoYzLPVyDZk3q0UmKMv6o66vBNzzlhNm6Re1BSuvLXqlWK-g&h=ZbMGt0ddMGeCUhi0NCAoZEocqxiYUgnvplN6ImtPlwQ + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/0a53e459-4f8a-41be-ba91-0bb825db807a?api-version=2022-07-01&t=638565839660963982&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=WYoulbE8MqliTneVzTM1RgunC3hV9q7OkhnlR9ZMPk52jhbCcV3NtPCiDixiFnhLrNWfII03Wu3IIhZWHqIBuEzfdV5XGtoOO2UBrUL7xcsn5XkRnM_8l61CIzhl2vXiZ7kiLuOytGHCWtoLiyQjj1qR5kYxxVzglnKRt6aFxwlhLl0NYAZE6lKLK0Vjclk6kocSMYElhA0OHJst1O4GE92OAMXy2fi58FhSggeierKm5qkOuhP2dEspO_6tvXMwdraJMpxcIyHByrVx6UrEJMvWZXE4OXYWCxeDu-acFLJBp6lw9QFwBJj9IIVGjiVAOmu8R1mH7YcVGbRpyfhMTw&h=k11duIRzgPt8E9H8VYxlg1UvmB-ySy3gFQsvQJOzLgA response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -44079,24 +51860,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:35 GMT + - Sun, 14 Jul 2024 19:59:36 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 847d6fd3-a982-44fc-baaa-38cb79277680 + - bce8c1ee-3b31-443e-bf8d-01731e6aae71 + x-msedge-ref: + - 'Ref A: 18262766D2324BB390F904F3CC4E83AB Ref B: MRS211050619029 Ref C: 2024-07-14T19:59:36Z' status: code: 200 message: OK @@ -44114,13 +51892,13 @@ interactions: ParameterSetName: - -n -g --type User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-network/22.2.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualWans/vwan-000007?api-version=2022-07-01 response: body: string: "{\r\n \"name\": \"vwan-000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualWans/vwan-000007\",\r\n - \ \"etag\": \"W/\\\"fe5203ab-2199-4eae-b912-f1977f66160f\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"1de17134-0fde-4d7d-bbae-7ff83473b7f1\\\"\",\r\n \"type\": \"Microsoft.Network/virtualWans\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"disableVpnEncryption\": false,\r\n \"allowBranchToBranchTraffic\": true,\r\n \"office365LocalBreakoutCategory\": @@ -44133,23 +51911,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:36 GMT + - Sun, 14 Jul 2024 19:59:37 GMT etag: - - W/"fe5203ab-2199-4eae-b912-f1977f66160f" + - W/"1de17134-0fde-4d7d-bbae-7ff83473b7f1" expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 11F3B578C77A4B228D67793518626D6C Ref B: MRS211050619029 Ref C: 2024-07-14T19:59:37Z' status: code: 200 message: OK @@ -44172,13 +51948,13 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualHubs/vhub-000008?api-version=2022-05-01 response: body: string: "{\r\n \"name\": \"vhub-000008\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualHubs/vhub-000008\",\r\n - \ \"etag\": \"W/\\\"dae11f19-bad1-4346-a226-8c0d47395b06\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"c07369a4-04b0-4bc3-8006-789bed9fbb74\\\"\",\r\n \"type\": \"Microsoft.Network/virtualHubs\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"virtualHubRouteTableV2s\": [],\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n \"virtualRouterAsn\": @@ -44192,7 +51968,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs cache-control: - no-cache content-length: @@ -44200,22 +51976,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:39 GMT + - Sun, 14 Jul 2024 19:59:45 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5f221fff-cedc-4c4c-a311-22a00a0ff428 + - e211b0c5-fd9f-415f-97ff-90c23638fa1f x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 1F5DDC07B0D94EFD8D554B03247F27AC Ref B: MRS211050618027 Ref C: 2024-07-14T19:59:38Z' status: code: 201 message: Created @@ -44233,9 +52010,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44247,24 +52024,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:39 GMT + - Sun, 14 Jul 2024 19:59:46 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 386850af-5e03-4307-8e7d-ad21fe102bdf + - b961d631-4fe7-4e23-ac6a-2f99c1fd8838 + x-msedge-ref: + - 'Ref A: 8DCF730C20424CD1AADF4A6BAA75A373 Ref B: MRS211050618027 Ref C: 2024-07-14T19:59:46Z' status: code: 200 message: OK @@ -44282,9 +52056,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44296,24 +52070,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:26:50 GMT + - Sun, 14 Jul 2024 19:59:56 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 4dd891c3-ed4c-40a9-b539-e13ba5ab8adb + - 9a60cc6f-fae5-4b67-9f75-ffa2fa5933a0 + x-msedge-ref: + - 'Ref A: 0D275424FEF1481DB4DCB9596CA79F8F Ref B: MRS211050618027 Ref C: 2024-07-14T19:59:57Z' status: code: 200 message: OK @@ -44331,9 +52102,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44345,24 +52116,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:27:11 GMT + - Sun, 14 Jul 2024 20:00:17 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 28f3b738-263c-4464-b41d-111e88705982 + - ef9339a3-278c-488d-bf1f-7651b3c15b3b + x-msedge-ref: + - 'Ref A: F582EF6678A1421E856966BBF032789B Ref B: MRS211050618027 Ref C: 2024-07-14T20:00:17Z' status: code: 200 message: OK @@ -44380,9 +52148,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44394,24 +52162,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:27:31 GMT + - Sun, 14 Jul 2024 20:00:38 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - eff82a9d-fde8-408f-9272-ff47de28f6eb + - d82be3eb-f81a-4f36-b1a1-d5ff2e0e3476 + x-msedge-ref: + - 'Ref A: 6D4EF7F010EC45C6A7BFC61D5049AE2C Ref B: MRS211050618027 Ref C: 2024-07-14T20:00:38Z' status: code: 200 message: OK @@ -44429,9 +52194,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44443,24 +52208,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:28:12 GMT + - Sun, 14 Jul 2024 20:01:19 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 03fb9bcc-a55a-45eb-80ac-810489e1602a + - 9ee359df-c531-4971-9b92-e9ad8e661ad3 + x-msedge-ref: + - 'Ref A: F74A85D093864AFF9FCFDF2A6E51A0C7 Ref B: MRS211050618027 Ref C: 2024-07-14T20:01:19Z' status: code: 200 message: OK @@ -44478,9 +52240,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44492,24 +52254,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:28:52 GMT + - Sun, 14 Jul 2024 20:01:59 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0aaa130d-8bfa-425b-91e7-456d5ae98e6e + - 71b1c9f0-6334-40b2-b6f0-d7f24a668677 + x-msedge-ref: + - 'Ref A: B3F87CD9106B4C33A6D4DE5CB2A318C6 Ref B: MRS211050618027 Ref C: 2024-07-14T20:01:59Z' status: code: 200 message: OK @@ -44527,9 +52286,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44541,24 +52300,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:30:12 GMT + - Sun, 14 Jul 2024 20:03:20 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5a7e62b0-6a49-48b9-a5e1-d601f562d3e0 + - 64d2ed71-f6b4-4a72-a2bd-90bac7855871 + x-msedge-ref: + - 'Ref A: 97D82BE7A9364D7DB013B539563104D4 Ref B: MRS211050619023 Ref C: 2024-07-14T20:03:20Z' status: code: 200 message: OK @@ -44576,9 +52332,9 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/b8babd9f-2c51-4a70-9f5b-1566e509b288?api-version=2022-05-01&t=638404756002667726&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=rrest0vfKYnhy3x28cWzuEnRyQ1T_tkDAGhsqECB_4dHDmtx02-L_YwZNcy59Z9paWMpxvXF5RMeHSU7SwKwCvc_2DVk6ixyTsrMdbq1urfy9aaU-2kl3wjH2yFUA092nmx_mxUIgbqR8nM3eJiktsaNqJmzjBmM3Ql8rjkzZRnaCyfc72U2QGDNul3XwCv3UZDdwL9IjMSPEP_6nEO2P3fONgGs2u55_lKal2HjXtVkxcIGGA5vNGb29oykYmLdi6nGzY5P5Je5iLxNDq51iqtt2Fb6Um_c_MBrn_AFxoLWal15U84J5NQ1Cw58RtUCitupxi2DZXX5a32xwTNK0A&h=bpbyKE9N5dO0NMWbWDNEl4b3L1r5ZTCeYhaa9G6p9RM + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/701234a0-48b2-4f1e-acf0-85fdf8fd3f1e?api-version=2022-05-01&t=638565839861245650&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=swG6atE8Oru-oKXbmIVnrjOsh4H2B4xJ6-Oxs-leV94EYh8uN35DfKBfOvqQYOlabsm5hPl31cvSUdw-cp6Uf9ddOuDZz1SHFdwUd9-LMVX_u4NvzHgOxJjBeZsmLYvmWmApoWKWIUOALdFtOtiGjBX1vNIzbzr2xX3Taw-Qbw_akRUHaPsZ3y2yj8G7MkQCnEnzKFliZk_Cmsj7fJjUCKB1C30evgjElh5e4oq_9_laIsTkpwYPSOWMMumk8KwfLUyT_fQI7QjuBqN2M_46ikY2eL1S1YkAcbyocIa8xnGSIrEdJyMMSRXblMiIT9aBfqOSKKrmFSco2oB__Nv3qQ&h=LGF5scfWlGEb9M8dJq4FVp5gAn_x2_JXEsfjRnji4Qs response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -44590,24 +52346,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:32:54 GMT + - Sun, 14 Jul 2024 20:06:01 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6f441f13-a93c-4d85-8655-24bb565666e7 + - 6a44cafc-b7dd-4cf3-b766-e02cd316a9ee + x-msedge-ref: + - 'Ref A: 95A0718C42284893B7F88F71BA75384E Ref B: MRS211050315035 Ref C: 2024-07-14T20:06:01Z' status: code: 200 message: OK @@ -44625,13 +52378,13 @@ interactions: ParameterSetName: - -n -g --vwan --address-prefix -l --sku User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualHubs/vhub-000008?api-version=2022-05-01 response: body: string: "{\r\n \"name\": \"vhub-000008\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualHubs/vhub-000008\",\r\n - \ \"etag\": \"W/\\\"0300b67c-db88-4710-8c83-7a1489af7a83\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"58a2a7bb-ff2b-4eec-8ddc-c0ad3e2f9697\\\"\",\r\n \"type\": \"Microsoft.Network/virtualHubs\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"virtualHubRouteTableV2s\": [],\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n \"virtualRouterAsn\": @@ -44649,24 +52402,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:32:54 GMT + - Sun, 14 Jul 2024 20:06:04 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - aac97195-b679-48cb-a2d8-5e45fce5d9e2 + - 4840c120-54a1-4a08-9a97-568560fc0d0e + x-msedge-ref: + - 'Ref A: 09E5D1779F1C4AA293738DFEC135FC90 Ref B: MRS211050315035 Ref C: 2024-07-14T20:06:01Z' status: code: 200 message: OK @@ -44684,31 +52434,33 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_firewall_basic_sku_000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-01-10T09:17:08Z","module":"azure-firewall","Creator":"v-taoxuzeng@microsoft.com","DateCreated":"2024-01-10T09:19:16Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001","name":"cli_test_firewall_basic_sku_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_firewall_basic_sku","date":"2024-07-14T19:45:45Z","module":"azure-firewall","Created":"2024-07-14T19:45:48.3253050Z","CreationDate":"2024-07-14T19:45:48.3252988Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '480' + - '492' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:32:55 GMT + - Sun, 14 Jul 2024 20:06:05 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 33E486E1F15A4B8BAFE3C3D760362228 Ref B: MRS211050313025 Ref C: 2024-07-14T20:06:04Z' status: code: 200 message: OK @@ -44732,13 +52484,13 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002?api-version=2022-01-01 response: body: string: "{\r\n \"name\": \"firewall-000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002\",\r\n - \ \"etag\": \"W/\\\"f29309b6-e731-4263-96af-10d697612cff\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"978cf370-fb7e-4845-be95-c418ac86db51\\\"\",\r\n \"type\": \"Microsoft.Network/azureFirewalls\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"sku\": {\r\n \"name\": \"AZFW_Hub\",\r\n \"tier\": \"Basic\"\r\n },\r\n \"additionalProperties\": @@ -44749,7 +52501,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s cache-control: - no-cache content-length: @@ -44757,22 +52509,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:32:58 GMT + - Sun, 14 Jul 2024 20:06:11 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - eca46d19-8876-4c7e-865c-79331ab20343 + - a71f52f4-2210-429a-a70f-4e3e28cf7626 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' + x-msedge-ref: + - 'Ref A: 0EFE706B10964F95B48A23E31A783F02 Ref B: MRS211050313017 Ref C: 2024-07-14T20:06:06Z' status: code: 201 message: Created @@ -44790,9 +52543,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44804,24 +52557,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:32:58 GMT + - Sun, 14 Jul 2024 20:06:12 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - adacb610-a0ce-432f-a2ad-646596d90808 + - eaf454d3-edda-4055-a153-f6976968f857 + x-msedge-ref: + - 'Ref A: 4AF3253016A64C009A81CC1D28B81BC6 Ref B: MRS211050313017 Ref C: 2024-07-14T20:06:12Z' status: code: 200 message: OK @@ -44839,9 +52589,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44853,24 +52603,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:33:08 GMT + - Sun, 14 Jul 2024 20:06:23 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 1586d89d-ccb9-4c8d-890c-259df46612fc + - afca68c8-dd00-41c6-bd8c-6995d1385a58 + x-msedge-ref: + - 'Ref A: E241BDE429AD4142A09CFCCD65FCCDAC Ref B: MRS211050313017 Ref C: 2024-07-14T20:06:22Z' status: code: 200 message: OK @@ -44888,9 +52635,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44902,24 +52649,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:33:28 GMT + - Sun, 14 Jul 2024 20:06:43 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6c87b38c-2f96-4c40-80b7-d8676c98b62c + - 0961c238-50d8-484f-be0d-787e9307fc4e + x-msedge-ref: + - 'Ref A: 5BF3C0BEF8CE44FBB72AD0FB007AF213 Ref B: MRS211050313017 Ref C: 2024-07-14T20:06:43Z' status: code: 200 message: OK @@ -44937,9 +52681,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -44951,24 +52695,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:33:49 GMT + - Sun, 14 Jul 2024 20:07:03 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - f77455cb-00f2-4002-9a2b-d0d9a7b8b210 + - 66c6e014-0a4f-402c-9c9b-24a190918e80 + x-msedge-ref: + - 'Ref A: 5AB7C9A2F243483B8CE354BCEE139536 Ref B: MRS211050313017 Ref C: 2024-07-14T20:07:04Z' status: code: 200 message: OK @@ -44986,9 +52727,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45000,24 +52741,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:34:29 GMT + - Sun, 14 Jul 2024 20:07:44 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ef959254-6d20-4c14-888d-3dc021f2806f + - 1d970a90-f7e6-4dc7-acbc-ba8085ba15b4 + x-msedge-ref: + - 'Ref A: 39D666FA2BAF4FBAB5B4D73E087923FC Ref B: MRS211050313017 Ref C: 2024-07-14T20:07:44Z' status: code: 200 message: OK @@ -45035,9 +52773,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45049,24 +52787,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:35:09 GMT + - Sun, 14 Jul 2024 20:08:25 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 7ada72b1-cfb3-4ddb-8520-ac1e707c18b5 + - a75f9e69-f477-4b4a-ace9-1e776f2b17f2 + x-msedge-ref: + - 'Ref A: 066B8556C35341B19DEC1A6326383A46 Ref B: MRS211050313017 Ref C: 2024-07-14T20:08:24Z' status: code: 200 message: OK @@ -45084,9 +52819,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45098,24 +52833,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:36:31 GMT + - Sun, 14 Jul 2024 20:09:46 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5341d65f-2fb5-4651-9c22-ba20afe4d6e3 + - 7cf4a737-0c45-431f-b1fa-a7fdb1d0a304 + x-msedge-ref: + - 'Ref A: 8CD16988032F4697814E0DB113C681A8 Ref B: MRS211050618031 Ref C: 2024-07-14T20:09:46Z' status: code: 200 message: OK @@ -45133,9 +52865,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45147,24 +52879,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:39:11 GMT + - Sun, 14 Jul 2024 20:12:27 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e0968e48-9c50-4f39-907a-d8f138a21c99 + - 1d68c468-1361-43a4-aa94-705c8d5e134d + x-msedge-ref: + - 'Ref A: 2844EF98186542D0B481CD2AF11E7D3D Ref B: MRS211050313033 Ref C: 2024-07-14T20:12:27Z' status: code: 200 message: OK @@ -45182,9 +52911,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45196,24 +52925,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:40:52 GMT + - Sun, 14 Jul 2024 20:14:08 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ed921400-7432-49a4-b9b3-4dc4d344c737 + - 680c5072-1b1e-4187-8e0a-c99d4130eca7 + x-msedge-ref: + - 'Ref A: CFB6B0AAD15C4C9A90EB2C0B799864F6 Ref B: MRS211050315039 Ref C: 2024-07-14T20:14:08Z' status: code: 200 message: OK @@ -45231,9 +52957,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45245,24 +52971,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:42:33 GMT + - Sun, 14 Jul 2024 20:15:50 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 65307a6a-02d8-4534-a01b-6645d89cb44c + - c7ed13ee-f5f4-4fee-afd3-36ce01f55f43 + x-msedge-ref: + - 'Ref A: EE05F3F96AFF4E3885E863FA110FF19F Ref B: MRS211050313035 Ref C: 2024-07-14T20:15:49Z' status: code: 200 message: OK @@ -45280,9 +53003,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45294,24 +53017,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:44:14 GMT + - Sun, 14 Jul 2024 20:17:30 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2c851ed0-9d2a-4166-82cc-500f1a0311c7 + - 98a81ce6-f4b6-4724-b611-302a7fc732d8 + x-msedge-ref: + - 'Ref A: 639E0402C8AA4297A012950194B5CC3D Ref B: MRS211050315017 Ref C: 2024-07-14T20:17:30Z' status: code: 200 message: OK @@ -45329,9 +53049,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45343,24 +53063,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:45:55 GMT + - Sun, 14 Jul 2024 20:19:12 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3129301c-ee58-4178-82c2-fe1366c4ae4e + - 3e7c9818-9dbc-4e0d-b717-a5850e9c46f1 + x-msedge-ref: + - 'Ref A: A6F4E4443C4842048EFBE3307AFB6852 Ref B: MRS211050619025 Ref C: 2024-07-14T20:19:12Z' status: code: 200 message: OK @@ -45378,9 +53095,9 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"InProgress\"\r\n}" @@ -45392,24 +53109,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:47:35 GMT + - Sun, 14 Jul 2024 20:20:53 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - c538ab0d-e53c-4445-965e-6e7ec5fabf48 + - d9ac74e0-1f0a-4ae5-81be-336399e3fe5f + x-msedge-ref: + - 'Ref A: C7DA285B2E6840EDA673CBDA46CFE2FA Ref B: MRS211050315037 Ref C: 2024-07-14T20:20:53Z' status: code: 200 message: OK @@ -45427,9 +53141,101 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/967b7a97-3ca4-4000-8521-2c42b4c05f66?api-version=2022-01-01&t=638404759785919275&c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo&s=pFewecqYTcbjrPXNW10cPFYsP4tbZRtShgpJVk58ROvEAFU8Kfz6Pkl8WfKjR8oYwEg50lG4o42wW30h5j0XhuDfN7_S1PEExqpWJ2rwvYtm2BZTfapOQMv1UlTRv4yD2oO5l0NkwD8Gl8ZqOiGh5cUkQCJYCiXNo7MFFQHtktH_p01o7zZq8Eq-RLwGmZn2-TkOuIFBLNC0oGvx_QRAUxQOTb_-HWeTx9BGmv0EqoSsVbsUmJP4ASkpe4yieB0yOMf1fGjDN9-nGWrmwIH_K_TuQMlwh76tEgJSSCPsPtNARSeRFPXKf9GvLR5yGzubQ0bX0pXtR4lSmDufwNQOBA&h=Q8S7UQJaPhG0W_eXnFm4-dvQAWBXcDLHNlv1z0BLnQc + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 20:22:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 42d949ff-f761-4e5b-b4c1-420757980a16 + x-msedge-ref: + - 'Ref A: 7F33EA4299A14086BAA8FAFDE936C2B8 Ref B: MRS211050315045 Ref C: 2024-07-14T20:22:34Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vhub --public-ip-count --sku --tier + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 14 Jul 2024 20:24:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - da18ad88-1edd-4380-837f-91585116eed5 + x-msedge-ref: + - 'Ref A: 29D08EC34C824118925DB46446FB9678 Ref B: MRS211050313017 Ref C: 2024-07-14T20:24:15Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network firewall create + Connection: + - keep-alive + ParameterSetName: + - -n -g --vhub --public-ip-count --sku --tier + User-Agent: + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/d85a1d00-7325-4800-8fd7-364f8e49d63d?api-version=2022-01-01&t=638565843718471392&c=MIIH5zCCBs-gAwIBAgITfwMuw4EdrrnuXQZ3pQAEAy7DgTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwNTA5MDQxNjI0WhcNMjUwNTA0MDQxNjI0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA8ab6_Aa9jtfZEbQhBCPjBV-o8Z0xSV__xQC-lEt8Xn3KQneUs5IqLpgkIdW_PmRmZgf9O3QtLrYQz4NkhhcPQHpvhFEyizgKuAWbtaaT-WCIlji8blwOeehO8H-pOBg5pTzxB40nWTCm6X5rEcdHeQQG9lS5k51Zs8YrHcIXzTIcEk7shCyfsQOc1YIY_qabYyds2eLX9-CYW19DTtGvBAp8IPRdgc-Nq_pE3woawRmK0Jq_8n08e2QdX2HitfXrjL2s_jF6MnJnJ9f4GQf4RE1gGz05Piq2Rh2ii29RNYSy-WCITYNBXzak9041KEz9M6SneGGXuJoHVY1VGJl0CAwEAAaOCBNQwggTQMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBTPJReXvGs99TFNdTjnUtQFkgjUGDAOBgNVHQ8BAf8EBAMCBaAwQAYDVR0RBDkwN4I1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABplggdRJywFMERBxBvU2_xPoBee_16mrzSsOO5fB9KwMH7rqDtYsS7J-1G-JprZzud5QGzhUF4cyTcTON8306PYkppL6bN4caaXnORDi21n0NlxhAkS44sxxYcX5uB8TsBog58g7G8TEDKb1zJMII26A8067ZKxS7BcCCcf0ON5gO9S72fYx0baRVOBJLFsTSemCG31wIirv8zNMtTPFuM4al280ORukXNxST214qZ84V9eNfYGO7O7LYXJWNqLAwUsyeuvfOiJZ6ByzHXRPpg6guBhLQjJfUMTJkLWd-bee5pMjfp8JIvjnZQfW-PtI8KicK6MS85JE9gp1_06zY8&s=afCKmzF99SgVMK-w8TBt2M6kfQ8bnyLSMiK55al0rniiOY1wwKZTeN27lkoRqUJ4nGp0-79aBQ_o3acukff812PTH7B9fwM78q0KdSAwGpCGQASfEJ1PxOshVzJrfBKJxzb4Zjnl0LwEwt-H0gvSUskLD5A7TnJT-3Q82UwuHPvO8xpR2uraYumHs4tSqo6j1SUHmU2Thb9G4FbxPMLg2RmPITLd6SvRcIFbmSEwUdFppWhEuxhrvTj_-f8f-F56aSqzR-wQOuD_yc9W3L9JrHUlu2JC0qavP1M2NtB3tSYr2arSWM4fvUJnv73GttD4E74YiL3QZGN-7ZreYjQEhg&h=ls93VllEfUnXkRJ_lS5EQfilzZgBuY1Uh0PoWBra12s response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -45441,24 +53247,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:49:16 GMT + - Sun, 14 Jul 2024 20:25:56 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0674a878-1578-4f04-95a7-184e7abc1cc9 + - 83a99c1e-2104-4e06-b67b-5fcabab99a26 + x-msedge-ref: + - 'Ref A: 884DF5E1310C4BD58653FFA85076372D Ref B: MRS211050618035 Ref C: 2024-07-14T20:25:56Z' status: code: 200 message: OK @@ -45476,21 +53279,21 @@ interactions: ParameterSetName: - -n -g --vhub --public-ip-count --sku --tier User-Agent: - - AZURECLI/2.56.0 (AAZ) azsdk-python-core/1.28.0 Python/3.9.5 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.62.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.22631-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002?api-version=2022-01-01 response: body: string: "{\r\n \"name\": \"firewall-000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/azureFirewalls/firewall-000002\",\r\n - \ \"etag\": \"W/\\\"6fb17dec-7c2a-4727-bdc6-182fd55c4b91\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"83efb76f-4e40-4d6d-a3eb-d61ee1e77048\\\"\",\r\n \"type\": \"Microsoft.Network/azureFirewalls\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"AZFW_Hub\",\r\n \"tier\": \"Basic\"\r\n },\r\n \"additionalProperties\": {},\r\n \"virtualHub\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_firewall_basic_sku_000001/providers/Microsoft.Network/virtualHubs/vhub-000008\"\r\n \ },\r\n \"hubIPAddresses\": {\r\n \"privateIPAddress\": \"10.0.0.132\",\r\n \ \"publicIPs\": {\r\n \"addresses\": [\r\n {\r\n \"address\": - \"40.83.173.130\"\r\n },\r\n {\r\n \"address\": - \"40.83.214.95\"\r\n }\r\n ],\r\n \"count\": 2\r\n + \"40.86.190.11\"\r\n },\r\n {\r\n \"address\": + \"40.78.100.177\"\r\n }\r\n ],\r\n \"count\": 2\r\n \ }\r\n }\r\n }\r\n}" headers: cache-control: @@ -45500,26 +53303,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Jan 2024 09:49:17 GMT + - Sun, 14 Jul 2024 20:25:56 GMT etag: - - W/"6fb17dec-7c2a-4727-bdc6-182fd55c4b91" + - W/"83efb76f-4e40-4d6d-a3eb-d61ee1e77048" expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e546b5b2-98b2-4e9f-8267-ee5ec99ab464 + - a27c1372-f624-457f-829b-7944bc58bb85 + x-msedge-ref: + - 'Ref A: 7842F08721734C57AA249B30309F5D00 Ref B: MRS211050618035 Ref C: 2024-07-14T20:25:56Z' status: code: 200 message: OK diff --git a/src/azure-firewall/azext_firewall/tests/latest/test_azure_firewall_scenario.py b/src/azure-firewall/azext_firewall/tests/latest/test_azure_firewall_scenario.py index 17ba790c6bd..b4b4086e3b3 100644 --- a/src/azure-firewall/azext_firewall/tests/latest/test_azure_firewall_scenario.py +++ b/src/azure-firewall/azext_firewall/tests/latest/test_azure_firewall_scenario.py @@ -1093,3 +1093,243 @@ def test_azure_firewall_policy_with_snat(self, resource_group): ]) self.cmd("network firewall policy delete -n {policy} -g {rg}") + + @AllowLargeResponse(size_kb=10240) + @ResourceGroupPreparer(name_prefix='cli_test_azure_firewall_policy_draft', location='westus2') + def test_azure_policy_draft(self, resource_group, resource_group_location): + self.kwargs.update({ + 'policy': 'myclipolicy', + 'rg': resource_group, + 'ipconfig': 'myipconfig1', + 'location': resource_group_location, + 'collectiongroup': 'myclirulecollectiongroup', + 'collection_group_priority': 10000 + }) + self.cmd('network firewall policy create -g {rg} -n {policy} -l {location} --sku Premium --idps-mode Off', checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies'), + self.check('name', '{policy}') + ]) + + self.kwargs.update({'location': 'westus2'}) + self.cmd('network firewall policy draft create -g {rg} --name {policy}', checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts'), + self.check('name', '{policy}') + ]) + + self.cmd( + 'network firewall policy draft update -g {rg} --name {policy} --threat-intel-mode Deny --idps-mode Alert', + checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts'), + self.check('threatIntelMode', 'Deny'), + self.check('name', '{policy}'), + self.check('intrusionDetection.mode', 'Alert') + ]) + + self.cmd('network firewall policy draft intrusion-detection add -g {rg} --policy-name {policy} --mode Deny --signature-id 10001 --private-ranges 167.220.204.0/24 167.221.205.101/32', + checks=[ + self.check('bypassTrafficSettings', []), + self.check('length(signatureOverrides)', 1), + self.check('signatureOverrides[0]', {'id': '10001', 'mode': 'Deny'}), + self.check('privateRanges[0]', "167.220.204.0/24"), + self.check('privateRanges[1]', "167.221.205.101/32") + ]) + + self.cmd('network firewall policy draft intrusion-detection add -g {rg} --policy-name {policy} --mode Alert --signature-id 20001 --private-ranges 167.220.208.0/24 167.221.205.102/32', + checks=[ + self.check('bypassTrafficSettings', []), + self.check('length(signatureOverrides)', 2), + self.check('signatureOverrides[0]', {'id': '10001', 'mode': 'Deny'}), + self.check('signatureOverrides[1]', {'id': '20001', 'mode': 'Alert'}), + self.check('privateRanges[0]', "167.220.208.0/24"), + self.check('privateRanges[1]', "167.221.205.102/32") + ]) + + self.cmd('network firewall policy draft intrusion-detection add -g {rg} --policy-name {policy} ' + '--rule-name bypass-rule-1 ' + '--rule-protocol TCP ' + '--rule-src-addresses 10.0.0.12 10.0.0.15 ' + '--rule-dest-addresses 192.168.0.103 192.168.0.104 ' + '--rule-dest-ports 8080 9090 5432', + checks=[ + self.check('length(bypassTrafficSettings)', 1), + self.check('bypassTrafficSettings[0].description', None), + self.check('bypassTrafficSettings[0].destinationAddresses', ['192.168.0.103', '192.168.0.104']), + self.check('bypassTrafficSettings[0].destinationIpGroups', None), + self.check('bypassTrafficSettings[0].protocol', 'TCP'), + self.check('bypassTrafficSettings[0].destinationPorts', ['8080', '9090', '5432']), + self.check('length(signatureOverrides)', 2), + self.check('signatureOverrides[0]', {'id': '10001', 'mode': 'Deny'}), + self.check('signatureOverrides[1]', {'id': '20001', 'mode': 'Alert'}), + ]) + + self.cmd('network firewall policy draft intrusion-detection list -g {rg} --policy-name {policy}', + checks=[ + self.check('length(bypassTrafficSettings)', 1), + self.check('length(signatureOverrides)', 2), + self.check('length(privateRanges)', 2) + ]) + + self.cmd('network firewall policy draft intrusion-detection remove -g {rg} --policy-name {policy} ' + '--rule-name bypass-rule-1 ' + '--signature-id 10001') + + self.cmd('network firewall policy draft intrusion-detection list -g {rg} --policy-name {policy}', + checks=[ + self.check('length(bypassTrafficSettings)', 0), + self.check('length(signatureOverrides)', 1), + self.check('length(privateRanges)', 2) + ]) + + self.cmd('network firewall policy show -g {rg} -n {policy}', + checks=[ + self.check('threatIntelMode', 'Alert') + ]) + + self.cmd('network firewall policy deploy -g {rg} --name {policy}') + + self.cmd('network firewall policy show -g {rg} -n {policy}', + checks=[ + self.check('threatIntelMode', 'Deny') + ]) + + self.cmd('network firewall policy intrusion-detection list -g {rg} --policy-name {policy}', + checks=[ + self.check('length(bypassTrafficSettings)', 0), + self.check('length(signatureOverrides)', 1), + self.check('length(privateRanges)', 2) + ]) + + self.cmd('network firewall policy delete -g {rg} --name {policy}') + + + @AllowLargeResponse(size_kb=10240) + @ResourceGroupPreparer(name_prefix='cli_test_azure_firewall_policy_draft', location='westus2') + def test_azure_policy_rcg_draft(self, resource_group, resource_group_location): + self.kwargs.update({ + 'policy': 'myclipolicy', + 'rg': resource_group, + 'ipconfig': 'myipconfig1', + 'location': resource_group_location, + 'collectiongroup': 'myclirulecollectiongroup', + 'collection_group_priority': 10000 + }) + self.cmd('network firewall policy create -g {rg} -n {policy} -l {location}', checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies'), + self.check('name', '{policy}') + ]) + + self.kwargs.update({'location': 'westus2'}) + self.cmd('network firewall policy draft create -g {rg} --name {policy}', checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies/FirewallPolicyDrafts'), + self.check('name', '{policy}') + ]) + + self.cmd('network firewall policy rule-collection-group create -g {rg} --priority {collection_group_priority} --policy-name {policy} -n {collectiongroup}', checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies/RuleCollectionGroups'), + self.check('name', '{collectiongroup}') + ]) + + self.cmd('network firewall policy rule-collection-group draft create -g {rg} --name {collectiongroup} --priority 150 --policy-name {policy}', checks=[ + self.check('type', 'Microsoft.Network/FirewallPolicies/RuleCollectionGroups/RuleCollectionGroupDrafts'), + self.check('name', '{collectiongroup}'), + self.check('priority', 150) + ]) + + self.cmd('network firewall policy rule-collection-group draft update -g {rg} --policy-name {policy} --name {collectiongroup} --priority 12000', checks=[ + self.check('priority', 12000) + ]) + + self.cmd('network firewall policy rule-collection-group draft show -g {rg} --policy-name {policy} -n {collectiongroup}', checks=[ + self.check('priority', 12000) + ]) + + self.cmd('az network firewall policy rule-collection-group draft collection add-nat-collection -n nat-collection \ + --policy-name {policy} --rule-collection-group-name {collectiongroup} -g {rg} --collection-priority 10005 \ + --action DNAT --rule-name network-rule --description "test" \ + --destination-addresses "202.120.36.15" --source-addresses "202.120.36.13" "202.120.36.14" \ + --translated-address 128.1.1.1 --translated-port 1234 \ + --destination-ports 12000 --ip-protocols TCP UDP', checks=[ + self.check('length(ruleCollections)', 1), + self.check('ruleCollections[0].ruleCollectionType', "FirewallPolicyNatRuleCollection"), + self.check('ruleCollections[0].name', "nat-collection") + ]) + + self.cmd('network firewall policy rule-collection-group draft collection add-filter-collection -g {rg} --policy-name {policy} \ + --rule-collection-group-name {collectiongroup} -n filter-collection-1 --collection-priority 13000 \ + --action Allow --rule-name network-rule --rule-type NetworkRule \ + --description "test" --destination-addresses "202.120.36.15" --source-addresses "202.120.36.13" "202.120.36.14" \ + --destination-ports 12003 12004 --ip-protocols Any ICMP', checks=[ + self.check('length(ruleCollections)', 2), + self.check('ruleCollections[1].ruleCollectionType', "FirewallPolicyFilterRuleCollection"), + self.check('ruleCollections[1].name', "filter-collection-1") + ]) + + self.cmd('network firewall policy rule-collection-group draft collection add-filter-collection -g {rg} --policy-name {policy} \ + --rule-collection-group-name {collectiongroup} -n filter-collection-2 --collection-priority 14000 \ + --action Allow --rule-name application-rule --rule-type ApplicationRule \ + --description "test" --destination-addresses "202.120.36.15" "202.120.36.16" --source-addresses "202.120.36.13" "202.120.36.14" --protocols Http=12800 Https=12801 \ + --fqdn-tags AzureBackup HDInsight ' + '--target-urls www.google.com www.bing.com ' + '--enable-tls-inspection true', + checks=[ + self.check('length(ruleCollections)', 3), + self.check('ruleCollections[2].ruleCollectionType', "FirewallPolicyFilterRuleCollection"), + self.check('ruleCollections[2].name', "filter-collection-2"), + self.check('ruleCollections[2].rules[0].ruleType', 'ApplicationRule'), + self.check('ruleCollections[2].rules[0].terminateTLS', True), + self.check('ruleCollections[2].rules[0].targetUrls', ['www.google.com', 'www.bing.com']) + ]) + + self.cmd('az network firewall policy rule-collection-group draft collection add-nat-collection -n nat-collection-2 \ + --policy-name {policy} --rule-collection-group-name {collectiongroup} -g {rg} --collection-priority 1000 \ + --action DNAT --rule-name network-rule --description "test" \ + --destination-addresses "202.120.36.15" --source-addresses "202.120.36.13" "202.120.36.14" \ + --translated-fqdn www.google.com --translated-port 1234 \ + --destination-ports 12000 --ip-protocols TCP UDP', checks=[ + self.check('length(ruleCollections)', 4), + self.check('ruleCollections[3].ruleCollectionType', "FirewallPolicyNatRuleCollection"), + self.check('ruleCollections[3].name', "nat-collection-2") + ]) + + self.cmd('network firewall policy rule-collection-group draft collection rule add -g {rg} --policy-name {policy} ' + '--rule-collection-group-name {collectiongroup} --collection-name filter-collection-2 --name application-rule-2 ' + '--rule-type ApplicationRule --description "test" --source-addresses 202.120.36.13 202.120.36.14 ' + '--destination-addresses 202.120.36.15 202.120.36.16 --protocols Http=12800 Https=12801 --target-fqdns www.bing.com', + checks=[ + self.check('length(ruleCollections[2].rules)', 2), + ]) + + self.cmd('network firewall policy rule-collection-group draft collection list -g {rg} --policy-name {policy} \ + --rule-collection-group-name {collectiongroup}', checks=[ + self.check('length(@)', 4) + ]) + + self.cmd('network firewall policy rule-collection-group draft collection rule remove -g {rg} --policy-name {policy} \ + --rule-collection-group-name {collectiongroup} --collection-name filter-collection-1 --name network-rule-2', checks=[ + self.check('length(ruleCollections[1].rules)', 1), + self.check('ruleCollections[1].rules[0].name', 'network-rule') + ]) + + self.cmd('network firewall policy rule-collection-group draft collection remove -g {rg} --policy-name {policy} \ + --rule-collection-group-name {collectiongroup} --name filter-collection-1', checks=[ + self.check('length(ruleCollections)', 3) + ]) + + self.cmd('network firewall policy rule-collection-group draft show -g {rg} --policy-name {policy} --name {collectiongroup}', + checks=[ + self.check('length(ruleCollections[1].rules)', 2), + self.check('ruleCollections[1].rules[0].name', 'application-rule'), + self.check('length(ruleCollections)', 3) + ]) + + self.cmd('network firewall policy deploy -g {rg} --name {policy}') + + self.cmd('network firewall policy rule-collection-group show -g {rg} --policy-name {policy} --name {collectiongroup}', + checks=[ + self.check('length(ruleCollections[1].rules)', 2), + self.check('ruleCollections[1].rules[0].name', 'application-rule'), + self.check('length(ruleCollections)', 3) + ]) + + self.cmd('network firewall policy delete -g {rg} --name {policy}') + diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/__init__.py new file mode 100644 index 00000000000..b92fe1a6ef8 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import NetworkManagementClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NetworkManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_client.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_client.py new file mode 100644 index 00000000000..9e24f89d8b7 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_client.py @@ -0,0 +1,2487 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin + +from ._configuration import NetworkManagementClientConfiguration +from ._serialization import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +from .operations import ( + ApplicationGatewaysOperations, + ExpressRouteCircuitAuthorizationsOperations, + ExpressRouteCircuitPeeringsOperations, + ExpressRouteCircuitsOperations, + ExpressRouteServiceProvidersOperations, + LoadBalancersOperations, + LocalNetworkGatewaysOperations, + NetworkInterfacesOperations, + NetworkSecurityGroupsOperations, + PublicIPAddressesOperations, + RouteTablesOperations, + RoutesOperations, + SecurityRulesOperations, + SubnetsOperations, + UsagesOperations, + VirtualNetworkGatewayConnectionsOperations, + VirtualNetworkGatewaysOperations, + VirtualNetworksOperations, + ApplicationSecurityGroupsOperations, + AvailableEndpointServicesOperations, + BgpServiceCommunitiesOperations, + ConnectionMonitorsOperations, + DefaultSecurityRulesOperations, + InboundNatRulesOperations, + LoadBalancerBackendAddressPoolsOperations, + LoadBalancerFrontendIPConfigurationsOperations, + LoadBalancerLoadBalancingRulesOperations, + LoadBalancerNetworkInterfacesOperations, + LoadBalancerProbesOperations, + NetworkInterfaceIPConfigurationsOperations, + NetworkInterfaceLoadBalancersOperations, + NetworkWatchersOperations, + Operations, + PacketCapturesOperations, + RouteFilterRulesOperations, + RouteFiltersOperations, + VirtualNetworkPeeringsOperations, + AzureFirewallsOperations, + DdosProtectionPlansOperations, + ExpressRouteCircuitConnectionsOperations, + ExpressRouteCrossConnectionPeeringsOperations, + ExpressRouteCrossConnectionsOperations, + HubVirtualNetworkConnectionsOperations, + VirtualHubsOperations, + VirtualWANsOperations, + VpnConnectionsOperations, + VpnGatewaysOperations, + VpnSitesConfigurationOperations, + VpnSitesOperations, + AvailableDelegationsOperations, + AvailableResourceGroupDelegationsOperations, + AzureFirewallFqdnTagsOperations, + DdosCustomPoliciesOperations, + ExpressRouteConnectionsOperations, + ExpressRouteGatewaysOperations, + ExpressRouteLinksOperations, + ExpressRoutePortsLocationsOperations, + ExpressRoutePortsOperations, + InterfaceEndpointsOperations, + LoadBalancerOutboundRulesOperations, + NetworkInterfaceTapConfigurationsOperations, + NetworkProfilesOperations, + P2SVpnGatewaysOperations, + P2SVpnServerConfigurationsOperations, + PublicIPPrefixesOperations, + ServiceEndpointPoliciesOperations, + ServiceEndpointPolicyDefinitionsOperations, + VirtualNetworkTapsOperations, + VirtualWansOperations, + PeerExpressRouteCircuitConnectionsOperations, + WebApplicationFirewallPoliciesOperations, + NatGatewaysOperations, + ResourceNavigationLinksOperations, + ServiceAssociationLinksOperations, + AvailablePrivateEndpointTypesOperations, + BastionHostsOperations, + PrivateEndpointsOperations, + PrivateLinkServicesOperations, + ServiceTagsOperations, + FirewallPoliciesOperations, + FirewallPolicyRuleGroupsOperations, + VpnLinkConnectionsOperations, + VpnSiteLinkConnectionsOperations, + VpnSiteLinksOperations, + VirtualRouterPeeringsOperations, + VirtualRoutersOperations, + AvailableServiceAliasesOperations, + VpnServerConfigurationsAssociatedWithVirtualWanOperations, + VpnServerConfigurationsOperations, + IpGroupsOperations, + VirtualHubRouteTableV2SOperations, + FlowLogsOperations, + NetworkVirtualAppliancesOperations, + IpAllocationsOperations, + PrivateDnsZoneGroupsOperations, + SecurityPartnerProvidersOperations, + HubRouteTablesOperations, + ApplicationGatewayPrivateEndpointConnectionsOperations, + ApplicationGatewayPrivateLinkResourcesOperations, + FirewallPolicyRuleCollectionGroupsOperations, + VirtualApplianceSitesOperations, + VirtualApplianceSkusOperations, + VirtualHubBgpConnectionOperations, + VirtualHubBgpConnectionsOperations, + VirtualHubIpConfigurationOperations, + CustomIPPrefixesOperations, + DscpConfigurationOperations, + InboundSecurityRuleOperations, + WebCategoriesOperations, + NatRulesOperations, + VirtualNetworkGatewayNatRulesOperations, + ActiveConnectivityConfigurationsOperations, + ActiveSecurityAdminRulesOperations, + ActiveSecurityUserRulesOperations, + AdminRuleCollectionsOperations, + AdminRulesOperations, + ConnectivityConfigurationsOperations, + EffectiveConnectivityConfigurationsOperations, + EffectiveVirtualNetworksOperations, + NetworkGroupsOperations, + NetworkManagerCommitsOperations, + NetworkManagerDeploymentStatusOperations, + NetworkManagerEffectiveSecurityAdminRulesOperations, + NetworkManagersOperations, + NetworkSecurityPerimetersOperations, + NspAccessRulesOperations, + NspAccessRulesReconcileOperations, + NspAssociationReconcileOperations, + NspAssociationsOperations, + NspLinkReferencesOperations, + NspLinksOperations, + NspProfilesOperations, + PerimeterAssociableResourceTypesOperations, + SecurityAdminConfigurationsOperations, + SecurityUserConfigurationsOperations, + UserRuleCollectionsOperations, + UserRulesOperations, + ApplicationGatewayWafDynamicManifestsDefaultOperations, + ApplicationGatewayWafDynamicManifestsOperations, + ConfigurationPolicyGroupsOperations, + ExpressRoutePortAuthorizationsOperations, + ExpressRouteProviderPortsLocationOperations, + FirewallPolicyIdpsSignaturesFilterValuesOperations, + FirewallPolicyIdpsSignaturesOperations, + FirewallPolicyIdpsSignaturesOverridesOperations, + ManagementGroupNetworkManagerConnectionsOperations, + RouteMapsOperations, + RoutingIntentOperations, + ScopeConnectionsOperations, + ServiceTagInformationOperations, + StaticMembersOperations, + SubscriptionNetworkManagerConnectionsOperations, + VipSwapOperations, + NetworkVirtualApplianceConnectionsOperations, + FirewallPolicyDeploymentsOperations, + FirewallPolicyDraftsOperations, + FirewallPolicyRuleCollectionGroupDraftsOperations, + NetworkManagementClientOperationsMixin, +) +from ._validation import api_version_validation +from . import models +class _SDKClient(object): + def __init__(self, *args, **kwargs): + """This is a fake class to support current implemetation of MultiApiClientMixin." + Will be removed in final version of multiapi azure-core based client + """ + pass + +class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): + """Network Client. + + This ready contains multiple API versions, to help you deal with all of the Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, it uses the latest API version available on public Azure. + For production, you should stick to a particular api-version and/or profile. + The profile sets a mapping between an operation group and its API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + DEFAULT_API_VERSION = '2023-11-01' + _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'active_connectivity_configurations': '2021-02-01-preview', + 'active_security_admin_rules': '2021-02-01-preview', + 'active_security_user_rules': '2021-02-01-preview', + 'effective_connectivity_configurations': '2021-02-01-preview', + 'effective_virtual_networks': '2021-02-01-preview', + 'firewall_policy_rule_groups': '2020-04-01', + 'interface_endpoints': '2019-02-01', + 'network_manager_effective_security_admin_rules': '2021-02-01-preview', + 'network_security_perimeters': '2021-02-01-preview', + 'nsp_access_rules': '2021-02-01-preview', + 'nsp_access_rules_reconcile': '2021-02-01-preview', + 'nsp_association_reconcile': '2021-02-01-preview', + 'nsp_associations': '2021-02-01-preview', + 'nsp_link_references': '2021-02-01-preview', + 'nsp_links': '2021-02-01-preview', + 'nsp_profiles': '2021-02-01-preview', + 'p2_svpn_server_configurations': '2019-07-01', + 'perimeter_associable_resource_types': '2021-02-01-preview', + 'security_user_configurations': '2021-02-01-preview', + 'user_rule_collections': '2021-02-01-preview', + 'user_rules': '2021-02-01-preview', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + api_version: Optional[str]=None, + base_url: str = "https://management.azure.com", + profile: KnownProfiles=KnownProfiles.default, + **kwargs: Any + ): + if api_version: + kwargs.setdefault('api_version', api_version) + self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + super(NetworkManagementClient, self).__init__( + api_version=api_version, + profile=profile + ) + + self._serialize = Serializer(self._models_dict()) + self._deserialize = Deserializer(self._models_dict()) + self._serialize.client_side_validation = False + + + @classmethod + def _models_dict(cls): + return {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateways(self): + api_version = self._get_api_version("application_gateways") + return ApplicationGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuit_authorizations(self): + api_version = self._get_api_version("express_route_circuit_authorizations") + return ExpressRouteCircuitAuthorizationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuit_peerings(self): + api_version = self._get_api_version("express_route_circuit_peerings") + return ExpressRouteCircuitPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuits(self): + api_version = self._get_api_version("express_route_circuits") + return ExpressRouteCircuitsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_service_providers(self): + api_version = self._get_api_version("express_route_service_providers") + return ExpressRouteServiceProvidersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancers(self): + api_version = self._get_api_version("load_balancers") + return LoadBalancersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def local_network_gateways(self): + api_version = self._get_api_version("local_network_gateways") + return LocalNetworkGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interfaces(self): + api_version = self._get_api_version("network_interfaces") + return NetworkInterfacesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_security_groups(self): + api_version = self._get_api_version("network_security_groups") + return NetworkSecurityGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def public_ip_addresses(self): + api_version = self._get_api_version("public_ip_addresses") + return PublicIPAddressesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_tables(self): + api_version = self._get_api_version("route_tables") + return RouteTablesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def routes(self): + api_version = self._get_api_version("routes") + return RoutesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def security_rules(self): + api_version = self._get_api_version("security_rules") + return SecurityRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def subnets(self): + api_version = self._get_api_version("subnets") + return SubnetsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def usages(self): + api_version = self._get_api_version("usages") + return UsagesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_gateway_connections(self): + api_version = self._get_api_version("virtual_network_gateway_connections") + return VirtualNetworkGatewayConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_gateways(self): + api_version = self._get_api_version("virtual_network_gateways") + return VirtualNetworkGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_networks(self): + api_version = self._get_api_version("virtual_networks") + return VirtualNetworksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_security_groups(self): + api_version = self._get_api_version("application_security_groups") + return ApplicationSecurityGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_endpoint_services(self): + api_version = self._get_api_version("available_endpoint_services") + return AvailableEndpointServicesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def bgp_service_communities(self): + api_version = self._get_api_version("bgp_service_communities") + return BgpServiceCommunitiesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def connection_monitors(self): + api_version = self._get_api_version("connection_monitors") + return ConnectionMonitorsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def default_security_rules(self): + api_version = self._get_api_version("default_security_rules") + return DefaultSecurityRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def inbound_nat_rules(self): + api_version = self._get_api_version("inbound_nat_rules") + return InboundNatRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_backend_address_pools(self): + api_version = self._get_api_version("load_balancer_backend_address_pools") + return LoadBalancerBackendAddressPoolsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_frontend_ip_configurations(self): + api_version = self._get_api_version("load_balancer_frontend_ip_configurations") + return LoadBalancerFrontendIPConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_load_balancing_rules(self): + api_version = self._get_api_version("load_balancer_load_balancing_rules") + return LoadBalancerLoadBalancingRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_network_interfaces(self): + api_version = self._get_api_version("load_balancer_network_interfaces") + return LoadBalancerNetworkInterfacesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_probes(self): + api_version = self._get_api_version("load_balancer_probes") + return LoadBalancerProbesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interface_ip_configurations(self): + api_version = self._get_api_version("network_interface_ip_configurations") + return NetworkInterfaceIPConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interface_load_balancers(self): + api_version = self._get_api_version("network_interface_load_balancers") + return NetworkInterfaceLoadBalancersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_watchers(self): + api_version = self._get_api_version("network_watchers") + return NetworkWatchersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def operations(self): + api_version = self._get_api_version("operations") + return Operations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def packet_captures(self): + api_version = self._get_api_version("packet_captures") + return PacketCapturesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_filter_rules(self): + api_version = self._get_api_version("route_filter_rules") + return RouteFilterRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_filters(self): + api_version = self._get_api_version("route_filters") + return RouteFiltersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_peerings(self): + api_version = self._get_api_version("virtual_network_peerings") + return VirtualNetworkPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def azure_firewalls(self): + api_version = self._get_api_version("azure_firewalls") + return AzureFirewallsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ddos_protection_plans(self): + api_version = self._get_api_version("ddos_protection_plans") + return DdosProtectionPlansOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuit_connections(self): + api_version = self._get_api_version("express_route_circuit_connections") + return ExpressRouteCircuitConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_cross_connection_peerings(self): + api_version = self._get_api_version("express_route_cross_connection_peerings") + return ExpressRouteCrossConnectionPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_cross_connections(self): + api_version = self._get_api_version("express_route_cross_connections") + return ExpressRouteCrossConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def hub_virtual_network_connections(self): + api_version = self._get_api_version("hub_virtual_network_connections") + return HubVirtualNetworkConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hubs(self): + api_version = self._get_api_version("virtual_hubs") + return VirtualHubsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_wans(self): + api_version = self._get_api_version("virtual_wans") + return VirtualWansOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_connections(self): + api_version = self._get_api_version("vpn_connections") + return VpnConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_gateways(self): + api_version = self._get_api_version("vpn_gateways") + return VpnGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_sites_configuration(self): + api_version = self._get_api_version("vpn_sites_configuration") + return VpnSitesConfigurationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_sites(self): + api_version = self._get_api_version("vpn_sites") + return VpnSitesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_delegations(self): + api_version = self._get_api_version("available_delegations") + return AvailableDelegationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_resource_group_delegations(self): + api_version = self._get_api_version("available_resource_group_delegations") + return AvailableResourceGroupDelegationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def azure_firewall_fqdn_tags(self): + api_version = self._get_api_version("azure_firewall_fqdn_tags") + return AzureFirewallFqdnTagsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ddos_custom_policies(self): + api_version = self._get_api_version("ddos_custom_policies") + return DdosCustomPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_connections(self): + api_version = self._get_api_version("express_route_connections") + return ExpressRouteConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_gateways(self): + api_version = self._get_api_version("express_route_gateways") + return ExpressRouteGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_links(self): + api_version = self._get_api_version("express_route_links") + return ExpressRouteLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_ports_locations(self): + api_version = self._get_api_version("express_route_ports_locations") + return ExpressRoutePortsLocationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_ports(self): + api_version = self._get_api_version("express_route_ports") + return ExpressRoutePortsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01'] + ) + def interface_endpoints(self): + api_version = self._get_api_version("interface_endpoints") + return InterfaceEndpointsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_outbound_rules(self): + api_version = self._get_api_version("load_balancer_outbound_rules") + return LoadBalancerOutboundRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interface_tap_configurations(self): + api_version = self._get_api_version("network_interface_tap_configurations") + return NetworkInterfaceTapConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_profiles(self): + api_version = self._get_api_version("network_profiles") + return NetworkProfilesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def p2_svpn_gateways(self): + api_version = self._get_api_version("p2_svpn_gateways") + return P2SVpnGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01'] + ) + def p2_svpn_server_configurations(self): + api_version = self._get_api_version("p2_svpn_server_configurations") + return P2SVpnServerConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def public_ip_prefixes(self): + api_version = self._get_api_version("public_ip_prefixes") + return PublicIPPrefixesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_endpoint_policies(self): + api_version = self._get_api_version("service_endpoint_policies") + return ServiceEndpointPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_endpoint_policy_definitions(self): + api_version = self._get_api_version("service_endpoint_policy_definitions") + return ServiceEndpointPolicyDefinitionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_taps(self): + api_version = self._get_api_version("virtual_network_taps") + return VirtualNetworkTapsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def peer_express_route_circuit_connections(self): + api_version = self._get_api_version("peer_express_route_circuit_connections") + return PeerExpressRouteCircuitConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def web_application_firewall_policies(self): + api_version = self._get_api_version("web_application_firewall_policies") + return WebApplicationFirewallPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def nat_gateways(self): + api_version = self._get_api_version("nat_gateways") + return NatGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def resource_navigation_links(self): + api_version = self._get_api_version("resource_navigation_links") + return ResourceNavigationLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_association_links(self): + api_version = self._get_api_version("service_association_links") + return ServiceAssociationLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_private_endpoint_types(self): + api_version = self._get_api_version("available_private_endpoint_types") + return AvailablePrivateEndpointTypesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def bastion_hosts(self): + api_version = self._get_api_version("bastion_hosts") + return BastionHostsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def private_endpoints(self): + api_version = self._get_api_version("private_endpoints") + return PrivateEndpointsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def private_link_services(self): + api_version = self._get_api_version("private_link_services") + return PrivateLinkServicesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_tags(self): + api_version = self._get_api_version("service_tags") + return ServiceTagsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policies(self): + api_version = self._get_api_version("firewall_policies") + return FirewallPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01'] + ) + def firewall_policy_rule_groups(self): + api_version = self._get_api_version("firewall_policy_rule_groups") + return FirewallPolicyRuleGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_link_connections(self): + api_version = self._get_api_version("vpn_link_connections") + return VpnLinkConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_site_link_connections(self): + api_version = self._get_api_version("vpn_site_link_connections") + return VpnSiteLinkConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_site_links(self): + api_version = self._get_api_version("vpn_site_links") + return VpnSiteLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_router_peerings(self): + api_version = self._get_api_version("virtual_router_peerings") + return VirtualRouterPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_routers(self): + api_version = self._get_api_version("virtual_routers") + return VirtualRoutersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_service_aliases(self): + api_version = self._get_api_version("available_service_aliases") + return AvailableServiceAliasesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_server_configurations_associated_with_virtual_wan(self): + api_version = self._get_api_version("vpn_server_configurations_associated_with_virtual_wan") + return VpnServerConfigurationsAssociatedWithVirtualWanOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_server_configurations(self): + api_version = self._get_api_version("vpn_server_configurations") + return VpnServerConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ip_groups(self): + api_version = self._get_api_version("ip_groups") + return IpGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_route_table_v2_s(self): + api_version = self._get_api_version("virtual_hub_route_table_v2_s") + return VirtualHubRouteTableV2SOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def flow_logs(self): + api_version = self._get_api_version("flow_logs") + return FlowLogsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_virtual_appliances(self): + api_version = self._get_api_version("network_virtual_appliances") + return NetworkVirtualAppliancesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ip_allocations(self): + api_version = self._get_api_version("ip_allocations") + return IpAllocationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def private_dns_zone_groups(self): + api_version = self._get_api_version("private_dns_zone_groups") + return PrivateDnsZoneGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def security_partner_providers(self): + api_version = self._get_api_version("security_partner_providers") + return SecurityPartnerProvidersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def hub_route_tables(self): + api_version = self._get_api_version("hub_route_tables") + return HubRouteTablesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_private_endpoint_connections(self): + api_version = self._get_api_version("application_gateway_private_endpoint_connections") + return ApplicationGatewayPrivateEndpointConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_private_link_resources(self): + api_version = self._get_api_version("application_gateway_private_link_resources") + return ApplicationGatewayPrivateLinkResourcesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_rule_collection_groups(self): + api_version = self._get_api_version("firewall_policy_rule_collection_groups") + return FirewallPolicyRuleCollectionGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_appliance_sites(self): + api_version = self._get_api_version("virtual_appliance_sites") + return VirtualApplianceSitesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_appliance_skus(self): + api_version = self._get_api_version("virtual_appliance_skus") + return VirtualApplianceSkusOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_bgp_connection(self): + api_version = self._get_api_version("virtual_hub_bgp_connection") + return VirtualHubBgpConnectionOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_bgp_connections(self): + api_version = self._get_api_version("virtual_hub_bgp_connections") + return VirtualHubBgpConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_ip_configuration(self): + api_version = self._get_api_version("virtual_hub_ip_configuration") + return VirtualHubIpConfigurationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def custom_ip_prefixes(self): + api_version = self._get_api_version("custom_ip_prefixes") + return CustomIPPrefixesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def dscp_configuration(self): + api_version = self._get_api_version("dscp_configuration") + return DscpConfigurationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def inbound_security_rule(self): + api_version = self._get_api_version("inbound_security_rule") + return InboundSecurityRuleOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def web_categories(self): + api_version = self._get_api_version("web_categories") + return WebCategoriesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def nat_rules(self): + api_version = self._get_api_version("nat_rules") + return NatRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_gateway_nat_rules(self): + api_version = self._get_api_version("virtual_network_gateway_nat_rules") + return VirtualNetworkGatewayNatRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def active_connectivity_configurations(self): + api_version = self._get_api_version("active_connectivity_configurations") + return ActiveConnectivityConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def active_security_admin_rules(self): + api_version = self._get_api_version("active_security_admin_rules") + return ActiveSecurityAdminRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def active_security_user_rules(self): + api_version = self._get_api_version("active_security_user_rules") + return ActiveSecurityUserRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def admin_rule_collections(self): + api_version = self._get_api_version("admin_rule_collections") + return AdminRuleCollectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def admin_rules(self): + api_version = self._get_api_version("admin_rules") + return AdminRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def connectivity_configurations(self): + api_version = self._get_api_version("connectivity_configurations") + return ConnectivityConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def effective_connectivity_configurations(self): + api_version = self._get_api_version("effective_connectivity_configurations") + return EffectiveConnectivityConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def effective_virtual_networks(self): + api_version = self._get_api_version("effective_virtual_networks") + return EffectiveVirtualNetworksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_groups(self): + api_version = self._get_api_version("network_groups") + return NetworkGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_manager_commits(self): + api_version = self._get_api_version("network_manager_commits") + return NetworkManagerCommitsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_manager_deployment_status(self): + api_version = self._get_api_version("network_manager_deployment_status") + return NetworkManagerDeploymentStatusOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def network_manager_effective_security_admin_rules(self): + api_version = self._get_api_version("network_manager_effective_security_admin_rules") + return NetworkManagerEffectiveSecurityAdminRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_managers(self): + api_version = self._get_api_version("network_managers") + return NetworkManagersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def network_security_perimeters(self): + api_version = self._get_api_version("network_security_perimeters") + return NetworkSecurityPerimetersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_access_rules(self): + api_version = self._get_api_version("nsp_access_rules") + return NspAccessRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_access_rules_reconcile(self): + api_version = self._get_api_version("nsp_access_rules_reconcile") + return NspAccessRulesReconcileOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_association_reconcile(self): + api_version = self._get_api_version("nsp_association_reconcile") + return NspAssociationReconcileOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_associations(self): + api_version = self._get_api_version("nsp_associations") + return NspAssociationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_link_references(self): + api_version = self._get_api_version("nsp_link_references") + return NspLinkReferencesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_links(self): + api_version = self._get_api_version("nsp_links") + return NspLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_profiles(self): + api_version = self._get_api_version("nsp_profiles") + return NspProfilesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def perimeter_associable_resource_types(self): + api_version = self._get_api_version("perimeter_associable_resource_types") + return PerimeterAssociableResourceTypesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def security_admin_configurations(self): + api_version = self._get_api_version("security_admin_configurations") + return SecurityAdminConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def security_user_configurations(self): + api_version = self._get_api_version("security_user_configurations") + return SecurityUserConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def user_rule_collections(self): + api_version = self._get_api_version("user_rule_collections") + return UserRuleCollectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def user_rules(self): + api_version = self._get_api_version("user_rules") + return UserRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_waf_dynamic_manifests_default(self): + api_version = self._get_api_version("application_gateway_waf_dynamic_manifests_default") + return ApplicationGatewayWafDynamicManifestsDefaultOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_waf_dynamic_manifests(self): + api_version = self._get_api_version("application_gateway_waf_dynamic_manifests") + return ApplicationGatewayWafDynamicManifestsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def configuration_policy_groups(self): + api_version = self._get_api_version("configuration_policy_groups") + return ConfigurationPolicyGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_port_authorizations(self): + api_version = self._get_api_version("express_route_port_authorizations") + return ExpressRoutePortAuthorizationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_provider_ports_location(self): + api_version = self._get_api_version("express_route_provider_ports_location") + return ExpressRouteProviderPortsLocationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_idps_signatures_filter_values(self): + api_version = self._get_api_version("firewall_policy_idps_signatures_filter_values") + return FirewallPolicyIdpsSignaturesFilterValuesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_idps_signatures(self): + api_version = self._get_api_version("firewall_policy_idps_signatures") + return FirewallPolicyIdpsSignaturesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_idps_signatures_overrides(self): + api_version = self._get_api_version("firewall_policy_idps_signatures_overrides") + return FirewallPolicyIdpsSignaturesOverridesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def management_group_network_manager_connections(self): + api_version = self._get_api_version("management_group_network_manager_connections") + return ManagementGroupNetworkManagerConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_maps(self): + api_version = self._get_api_version("route_maps") + return RouteMapsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def routing_intent(self): + api_version = self._get_api_version("routing_intent") + return RoutingIntentOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def scope_connections(self): + api_version = self._get_api_version("scope_connections") + return ScopeConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_tag_information(self): + api_version = self._get_api_version("service_tag_information") + return ServiceTagInformationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def static_members(self): + api_version = self._get_api_version("static_members") + return StaticMembersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def subscription_network_manager_connections(self): + api_version = self._get_api_version("subscription_network_manager_connections") + return SubscriptionNetworkManagerConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vip_swap(self): + api_version = self._get_api_version("vip_swap") + return VipSwapOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_virtual_appliance_connections(self): + api_version = self._get_api_version("network_virtual_appliance_connections") + return NetworkVirtualApplianceConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-11-01'] + ) + def firewall_policy_deployments(self): + api_version = self._get_api_version("firewall_policy_deployments") + return FirewallPolicyDeploymentsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-11-01'] + ) + def firewall_policy_drafts(self): + api_version = self._get_api_version("firewall_policy_drafts") + return FirewallPolicyDraftsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-11-01'] + ) + def firewall_policy_rule_collection_group_drafts(self): + api_version = self._get_api_version("firewall_policy_rule_collection_group_drafts") + return FirewallPolicyRuleCollectionGroupDraftsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + def close(self): + self._client.close() + def __enter__(self): + self._client.__enter__() + return self + def __exit__(self, *exc_details): + self._client.__exit__(*exc_details) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_configuration.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_configuration.py new file mode 100644 index 00000000000..3966cf6871e --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class NetworkManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for NetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft + Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-network/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_serialization.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_serialization.py new file mode 100644 index 00000000000..75e26c415d2 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_serialization.py @@ -0,0 +1,2004 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[ + [str, Dict[str, Any], Any], Any + ] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]]=None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str, list + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get('skip_quote', False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]]=None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + else: + return date_obj diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_validation.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_validation.py new file mode 100644 index 00000000000..e5cf60c8914 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_validation.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_valid_on = kwargs.pop("params_valid_on", {}) + method_valid_on = kwargs.pop("method_valid_on", {}) + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + func_name = func.__name__ + try: + client = args[0] + client_api_version = client._get_api_version(func_name) # pylint: disable=protected-access + except AttributeError: + client_api_version = client._api_version # pylint: disable=protected-access + + if method_valid_on and client_api_version not in method_valid_on: + raise ValueError( + f"'{func_name}' is not available in API version " + f"{client_api_version}. All valid API version are {', '.join(method_valid_on)}." + ) + + unsupported = { + parameter: ", ".join(api_versions) + for parameter, api_versions in params_valid_on.items() + if parameter in kwargs and client_api_version not in api_versions + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"All valid API version are {versions} \n" + for param, versions in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_vendor.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_vendor.py new file mode 100644 index 00000000000..789c0a30e2e --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_vendor.py @@ -0,0 +1,36 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import NetworkManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from .._serialization import Deserializer, Serializer + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +class NetworkManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: NetworkManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_version.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_version.py new file mode 100644 index 00000000000..d970657f97f --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "25.4.0" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/__init__.py new file mode 100644 index 00000000000..84fa163a400 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import NetworkManagementClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NetworkManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_client.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_client.py new file mode 100644 index 00000000000..0a4b510fbba --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_client.py @@ -0,0 +1,2487 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin + +from .._serialization import Deserializer, Serializer +from ._configuration import NetworkManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +from .operations import ( + ApplicationGatewaysOperations, + ExpressRouteCircuitAuthorizationsOperations, + ExpressRouteCircuitPeeringsOperations, + ExpressRouteCircuitsOperations, + ExpressRouteServiceProvidersOperations, + LoadBalancersOperations, + LocalNetworkGatewaysOperations, + NetworkInterfacesOperations, + NetworkSecurityGroupsOperations, + PublicIPAddressesOperations, + RouteTablesOperations, + RoutesOperations, + SecurityRulesOperations, + SubnetsOperations, + UsagesOperations, + VirtualNetworkGatewayConnectionsOperations, + VirtualNetworkGatewaysOperations, + VirtualNetworksOperations, + ApplicationSecurityGroupsOperations, + AvailableEndpointServicesOperations, + BgpServiceCommunitiesOperations, + ConnectionMonitorsOperations, + DefaultSecurityRulesOperations, + InboundNatRulesOperations, + LoadBalancerBackendAddressPoolsOperations, + LoadBalancerFrontendIPConfigurationsOperations, + LoadBalancerLoadBalancingRulesOperations, + LoadBalancerNetworkInterfacesOperations, + LoadBalancerProbesOperations, + NetworkInterfaceIPConfigurationsOperations, + NetworkInterfaceLoadBalancersOperations, + NetworkWatchersOperations, + Operations, + PacketCapturesOperations, + RouteFilterRulesOperations, + RouteFiltersOperations, + VirtualNetworkPeeringsOperations, + AzureFirewallsOperations, + DdosProtectionPlansOperations, + ExpressRouteCircuitConnectionsOperations, + ExpressRouteCrossConnectionPeeringsOperations, + ExpressRouteCrossConnectionsOperations, + HubVirtualNetworkConnectionsOperations, + VirtualHubsOperations, + VirtualWANsOperations, + VpnConnectionsOperations, + VpnGatewaysOperations, + VpnSitesConfigurationOperations, + VpnSitesOperations, + AvailableDelegationsOperations, + AvailableResourceGroupDelegationsOperations, + AzureFirewallFqdnTagsOperations, + DdosCustomPoliciesOperations, + ExpressRouteConnectionsOperations, + ExpressRouteGatewaysOperations, + ExpressRouteLinksOperations, + ExpressRoutePortsLocationsOperations, + ExpressRoutePortsOperations, + InterfaceEndpointsOperations, + LoadBalancerOutboundRulesOperations, + NetworkInterfaceTapConfigurationsOperations, + NetworkProfilesOperations, + P2SVpnGatewaysOperations, + P2SVpnServerConfigurationsOperations, + PublicIPPrefixesOperations, + ServiceEndpointPoliciesOperations, + ServiceEndpointPolicyDefinitionsOperations, + VirtualNetworkTapsOperations, + VirtualWansOperations, + PeerExpressRouteCircuitConnectionsOperations, + WebApplicationFirewallPoliciesOperations, + NatGatewaysOperations, + ResourceNavigationLinksOperations, + ServiceAssociationLinksOperations, + AvailablePrivateEndpointTypesOperations, + BastionHostsOperations, + PrivateEndpointsOperations, + PrivateLinkServicesOperations, + ServiceTagsOperations, + FirewallPoliciesOperations, + FirewallPolicyRuleGroupsOperations, + VpnLinkConnectionsOperations, + VpnSiteLinkConnectionsOperations, + VpnSiteLinksOperations, + VirtualRouterPeeringsOperations, + VirtualRoutersOperations, + AvailableServiceAliasesOperations, + VpnServerConfigurationsAssociatedWithVirtualWanOperations, + VpnServerConfigurationsOperations, + IpGroupsOperations, + VirtualHubRouteTableV2SOperations, + FlowLogsOperations, + NetworkVirtualAppliancesOperations, + IpAllocationsOperations, + PrivateDnsZoneGroupsOperations, + SecurityPartnerProvidersOperations, + HubRouteTablesOperations, + ApplicationGatewayPrivateEndpointConnectionsOperations, + ApplicationGatewayPrivateLinkResourcesOperations, + FirewallPolicyRuleCollectionGroupsOperations, + VirtualApplianceSitesOperations, + VirtualApplianceSkusOperations, + VirtualHubBgpConnectionOperations, + VirtualHubBgpConnectionsOperations, + VirtualHubIpConfigurationOperations, + CustomIPPrefixesOperations, + DscpConfigurationOperations, + InboundSecurityRuleOperations, + WebCategoriesOperations, + NatRulesOperations, + VirtualNetworkGatewayNatRulesOperations, + ActiveConnectivityConfigurationsOperations, + ActiveSecurityAdminRulesOperations, + ActiveSecurityUserRulesOperations, + AdminRuleCollectionsOperations, + AdminRulesOperations, + ConnectivityConfigurationsOperations, + EffectiveConnectivityConfigurationsOperations, + EffectiveVirtualNetworksOperations, + NetworkGroupsOperations, + NetworkManagerCommitsOperations, + NetworkManagerDeploymentStatusOperations, + NetworkManagerEffectiveSecurityAdminRulesOperations, + NetworkManagersOperations, + NetworkSecurityPerimetersOperations, + NspAccessRulesOperations, + NspAccessRulesReconcileOperations, + NspAssociationReconcileOperations, + NspAssociationsOperations, + NspLinkReferencesOperations, + NspLinksOperations, + NspProfilesOperations, + PerimeterAssociableResourceTypesOperations, + SecurityAdminConfigurationsOperations, + SecurityUserConfigurationsOperations, + UserRuleCollectionsOperations, + UserRulesOperations, + ApplicationGatewayWafDynamicManifestsDefaultOperations, + ApplicationGatewayWafDynamicManifestsOperations, + ConfigurationPolicyGroupsOperations, + ExpressRoutePortAuthorizationsOperations, + ExpressRouteProviderPortsLocationOperations, + FirewallPolicyIdpsSignaturesFilterValuesOperations, + FirewallPolicyIdpsSignaturesOperations, + FirewallPolicyIdpsSignaturesOverridesOperations, + ManagementGroupNetworkManagerConnectionsOperations, + RouteMapsOperations, + RoutingIntentOperations, + ScopeConnectionsOperations, + ServiceTagInformationOperations, + StaticMembersOperations, + SubscriptionNetworkManagerConnectionsOperations, + VipSwapOperations, + NetworkVirtualApplianceConnectionsOperations, + FirewallPolicyDeploymentsOperations, + FirewallPolicyDraftsOperations, + FirewallPolicyRuleCollectionGroupDraftsOperations, + NetworkManagementClientOperationsMixin, +) +from .._validation import api_version_validation +from .. import models +class _SDKClient(object): + def __init__(self, *args, **kwargs): + """This is a fake class to support current implemetation of MultiApiClientMixin." + Will be removed in final version of multiapi azure-core based client + """ + pass + +class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): + """Network Client. + + This ready contains multiple API versions, to help you deal with all of the Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, it uses the latest API version available on public Azure. + For production, you should stick to a particular api-version and/or profile. + The profile sets a mapping between an operation group and its API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + DEFAULT_API_VERSION = '2023-11-01' + _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'active_connectivity_configurations': '2021-02-01-preview', + 'active_security_admin_rules': '2021-02-01-preview', + 'active_security_user_rules': '2021-02-01-preview', + 'effective_connectivity_configurations': '2021-02-01-preview', + 'effective_virtual_networks': '2021-02-01-preview', + 'firewall_policy_rule_groups': '2020-04-01', + 'interface_endpoints': '2019-02-01', + 'network_manager_effective_security_admin_rules': '2021-02-01-preview', + 'network_security_perimeters': '2021-02-01-preview', + 'nsp_access_rules': '2021-02-01-preview', + 'nsp_access_rules_reconcile': '2021-02-01-preview', + 'nsp_association_reconcile': '2021-02-01-preview', + 'nsp_associations': '2021-02-01-preview', + 'nsp_link_references': '2021-02-01-preview', + 'nsp_links': '2021-02-01-preview', + 'nsp_profiles': '2021-02-01-preview', + 'p2_svpn_server_configurations': '2019-07-01', + 'perimeter_associable_resource_types': '2021-02-01-preview', + 'security_user_configurations': '2021-02-01-preview', + 'user_rule_collections': '2021-02-01-preview', + 'user_rules': '2021-02-01-preview', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + api_version: Optional[str] = None, + base_url: str = "https://management.azure.com", + profile: KnownProfiles = KnownProfiles.default, + **kwargs: Any + ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) + self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + super(NetworkManagementClient, self).__init__( + api_version=api_version, + profile=profile + ) + + self._serialize = Serializer(self._models_dict()) + self._deserialize = Deserializer(self._models_dict()) + self._serialize.client_side_validation = False + + + @classmethod + def _models_dict(cls): + return {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateways(self): + api_version = self._get_api_version("application_gateways") + return ApplicationGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuit_authorizations(self): + api_version = self._get_api_version("express_route_circuit_authorizations") + return ExpressRouteCircuitAuthorizationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuit_peerings(self): + api_version = self._get_api_version("express_route_circuit_peerings") + return ExpressRouteCircuitPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuits(self): + api_version = self._get_api_version("express_route_circuits") + return ExpressRouteCircuitsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_service_providers(self): + api_version = self._get_api_version("express_route_service_providers") + return ExpressRouteServiceProvidersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancers(self): + api_version = self._get_api_version("load_balancers") + return LoadBalancersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def local_network_gateways(self): + api_version = self._get_api_version("local_network_gateways") + return LocalNetworkGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interfaces(self): + api_version = self._get_api_version("network_interfaces") + return NetworkInterfacesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_security_groups(self): + api_version = self._get_api_version("network_security_groups") + return NetworkSecurityGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def public_ip_addresses(self): + api_version = self._get_api_version("public_ip_addresses") + return PublicIPAddressesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_tables(self): + api_version = self._get_api_version("route_tables") + return RouteTablesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def routes(self): + api_version = self._get_api_version("routes") + return RoutesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def security_rules(self): + api_version = self._get_api_version("security_rules") + return SecurityRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def subnets(self): + api_version = self._get_api_version("subnets") + return SubnetsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def usages(self): + api_version = self._get_api_version("usages") + return UsagesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_gateway_connections(self): + api_version = self._get_api_version("virtual_network_gateway_connections") + return VirtualNetworkGatewayConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_gateways(self): + api_version = self._get_api_version("virtual_network_gateways") + return VirtualNetworkGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_networks(self): + api_version = self._get_api_version("virtual_networks") + return VirtualNetworksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_security_groups(self): + api_version = self._get_api_version("application_security_groups") + return ApplicationSecurityGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_endpoint_services(self): + api_version = self._get_api_version("available_endpoint_services") + return AvailableEndpointServicesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def bgp_service_communities(self): + api_version = self._get_api_version("bgp_service_communities") + return BgpServiceCommunitiesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def connection_monitors(self): + api_version = self._get_api_version("connection_monitors") + return ConnectionMonitorsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def default_security_rules(self): + api_version = self._get_api_version("default_security_rules") + return DefaultSecurityRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def inbound_nat_rules(self): + api_version = self._get_api_version("inbound_nat_rules") + return InboundNatRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_backend_address_pools(self): + api_version = self._get_api_version("load_balancer_backend_address_pools") + return LoadBalancerBackendAddressPoolsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_frontend_ip_configurations(self): + api_version = self._get_api_version("load_balancer_frontend_ip_configurations") + return LoadBalancerFrontendIPConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_load_balancing_rules(self): + api_version = self._get_api_version("load_balancer_load_balancing_rules") + return LoadBalancerLoadBalancingRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_network_interfaces(self): + api_version = self._get_api_version("load_balancer_network_interfaces") + return LoadBalancerNetworkInterfacesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_probes(self): + api_version = self._get_api_version("load_balancer_probes") + return LoadBalancerProbesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interface_ip_configurations(self): + api_version = self._get_api_version("network_interface_ip_configurations") + return NetworkInterfaceIPConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interface_load_balancers(self): + api_version = self._get_api_version("network_interface_load_balancers") + return NetworkInterfaceLoadBalancersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_watchers(self): + api_version = self._get_api_version("network_watchers") + return NetworkWatchersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def operations(self): + api_version = self._get_api_version("operations") + return Operations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def packet_captures(self): + api_version = self._get_api_version("packet_captures") + return PacketCapturesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_filter_rules(self): + api_version = self._get_api_version("route_filter_rules") + return RouteFilterRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_filters(self): + api_version = self._get_api_version("route_filters") + return RouteFiltersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_peerings(self): + api_version = self._get_api_version("virtual_network_peerings") + return VirtualNetworkPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def azure_firewalls(self): + api_version = self._get_api_version("azure_firewalls") + return AzureFirewallsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ddos_protection_plans(self): + api_version = self._get_api_version("ddos_protection_plans") + return DdosProtectionPlansOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_circuit_connections(self): + api_version = self._get_api_version("express_route_circuit_connections") + return ExpressRouteCircuitConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_cross_connection_peerings(self): + api_version = self._get_api_version("express_route_cross_connection_peerings") + return ExpressRouteCrossConnectionPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_cross_connections(self): + api_version = self._get_api_version("express_route_cross_connections") + return ExpressRouteCrossConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def hub_virtual_network_connections(self): + api_version = self._get_api_version("hub_virtual_network_connections") + return HubVirtualNetworkConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hubs(self): + api_version = self._get_api_version("virtual_hubs") + return VirtualHubsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_wans(self): + api_version = self._get_api_version("virtual_wans") + return VirtualWansOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_connections(self): + api_version = self._get_api_version("vpn_connections") + return VpnConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_gateways(self): + api_version = self._get_api_version("vpn_gateways") + return VpnGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_sites_configuration(self): + api_version = self._get_api_version("vpn_sites_configuration") + return VpnSitesConfigurationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_sites(self): + api_version = self._get_api_version("vpn_sites") + return VpnSitesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_delegations(self): + api_version = self._get_api_version("available_delegations") + return AvailableDelegationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_resource_group_delegations(self): + api_version = self._get_api_version("available_resource_group_delegations") + return AvailableResourceGroupDelegationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def azure_firewall_fqdn_tags(self): + api_version = self._get_api_version("azure_firewall_fqdn_tags") + return AzureFirewallFqdnTagsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ddos_custom_policies(self): + api_version = self._get_api_version("ddos_custom_policies") + return DdosCustomPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_connections(self): + api_version = self._get_api_version("express_route_connections") + return ExpressRouteConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_gateways(self): + api_version = self._get_api_version("express_route_gateways") + return ExpressRouteGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_links(self): + api_version = self._get_api_version("express_route_links") + return ExpressRouteLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_ports_locations(self): + api_version = self._get_api_version("express_route_ports_locations") + return ExpressRoutePortsLocationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_ports(self): + api_version = self._get_api_version("express_route_ports") + return ExpressRoutePortsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01'] + ) + def interface_endpoints(self): + api_version = self._get_api_version("interface_endpoints") + return InterfaceEndpointsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def load_balancer_outbound_rules(self): + api_version = self._get_api_version("load_balancer_outbound_rules") + return LoadBalancerOutboundRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_interface_tap_configurations(self): + api_version = self._get_api_version("network_interface_tap_configurations") + return NetworkInterfaceTapConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_profiles(self): + api_version = self._get_api_version("network_profiles") + return NetworkProfilesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def p2_svpn_gateways(self): + api_version = self._get_api_version("p2_svpn_gateways") + return P2SVpnGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01'] + ) + def p2_svpn_server_configurations(self): + api_version = self._get_api_version("p2_svpn_server_configurations") + return P2SVpnServerConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def public_ip_prefixes(self): + api_version = self._get_api_version("public_ip_prefixes") + return PublicIPPrefixesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_endpoint_policies(self): + api_version = self._get_api_version("service_endpoint_policies") + return ServiceEndpointPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_endpoint_policy_definitions(self): + api_version = self._get_api_version("service_endpoint_policy_definitions") + return ServiceEndpointPolicyDefinitionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_taps(self): + api_version = self._get_api_version("virtual_network_taps") + return VirtualNetworkTapsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def peer_express_route_circuit_connections(self): + api_version = self._get_api_version("peer_express_route_circuit_connections") + return PeerExpressRouteCircuitConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def web_application_firewall_policies(self): + api_version = self._get_api_version("web_application_firewall_policies") + return WebApplicationFirewallPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def nat_gateways(self): + api_version = self._get_api_version("nat_gateways") + return NatGatewaysOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def resource_navigation_links(self): + api_version = self._get_api_version("resource_navigation_links") + return ResourceNavigationLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_association_links(self): + api_version = self._get_api_version("service_association_links") + return ServiceAssociationLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_private_endpoint_types(self): + api_version = self._get_api_version("available_private_endpoint_types") + return AvailablePrivateEndpointTypesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def bastion_hosts(self): + api_version = self._get_api_version("bastion_hosts") + return BastionHostsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def private_endpoints(self): + api_version = self._get_api_version("private_endpoints") + return PrivateEndpointsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def private_link_services(self): + api_version = self._get_api_version("private_link_services") + return PrivateLinkServicesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_tags(self): + api_version = self._get_api_version("service_tags") + return ServiceTagsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policies(self): + api_version = self._get_api_version("firewall_policies") + return FirewallPoliciesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01'] + ) + def firewall_policy_rule_groups(self): + api_version = self._get_api_version("firewall_policy_rule_groups") + return FirewallPolicyRuleGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_link_connections(self): + api_version = self._get_api_version("vpn_link_connections") + return VpnLinkConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_site_link_connections(self): + api_version = self._get_api_version("vpn_site_link_connections") + return VpnSiteLinkConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_site_links(self): + api_version = self._get_api_version("vpn_site_links") + return VpnSiteLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_router_peerings(self): + api_version = self._get_api_version("virtual_router_peerings") + return VirtualRouterPeeringsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_routers(self): + api_version = self._get_api_version("virtual_routers") + return VirtualRoutersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def available_service_aliases(self): + api_version = self._get_api_version("available_service_aliases") + return AvailableServiceAliasesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_server_configurations_associated_with_virtual_wan(self): + api_version = self._get_api_version("vpn_server_configurations_associated_with_virtual_wan") + return VpnServerConfigurationsAssociatedWithVirtualWanOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vpn_server_configurations(self): + api_version = self._get_api_version("vpn_server_configurations") + return VpnServerConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ip_groups(self): + api_version = self._get_api_version("ip_groups") + return IpGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_route_table_v2_s(self): + api_version = self._get_api_version("virtual_hub_route_table_v2_s") + return VirtualHubRouteTableV2SOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def flow_logs(self): + api_version = self._get_api_version("flow_logs") + return FlowLogsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_virtual_appliances(self): + api_version = self._get_api_version("network_virtual_appliances") + return NetworkVirtualAppliancesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def ip_allocations(self): + api_version = self._get_api_version("ip_allocations") + return IpAllocationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def private_dns_zone_groups(self): + api_version = self._get_api_version("private_dns_zone_groups") + return PrivateDnsZoneGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def security_partner_providers(self): + api_version = self._get_api_version("security_partner_providers") + return SecurityPartnerProvidersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def hub_route_tables(self): + api_version = self._get_api_version("hub_route_tables") + return HubRouteTablesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_private_endpoint_connections(self): + api_version = self._get_api_version("application_gateway_private_endpoint_connections") + return ApplicationGatewayPrivateEndpointConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_private_link_resources(self): + api_version = self._get_api_version("application_gateway_private_link_resources") + return ApplicationGatewayPrivateLinkResourcesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_rule_collection_groups(self): + api_version = self._get_api_version("firewall_policy_rule_collection_groups") + return FirewallPolicyRuleCollectionGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_appliance_sites(self): + api_version = self._get_api_version("virtual_appliance_sites") + return VirtualApplianceSitesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_appliance_skus(self): + api_version = self._get_api_version("virtual_appliance_skus") + return VirtualApplianceSkusOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_bgp_connection(self): + api_version = self._get_api_version("virtual_hub_bgp_connection") + return VirtualHubBgpConnectionOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_bgp_connections(self): + api_version = self._get_api_version("virtual_hub_bgp_connections") + return VirtualHubBgpConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_hub_ip_configuration(self): + api_version = self._get_api_version("virtual_hub_ip_configuration") + return VirtualHubIpConfigurationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def custom_ip_prefixes(self): + api_version = self._get_api_version("custom_ip_prefixes") + return CustomIPPrefixesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def dscp_configuration(self): + api_version = self._get_api_version("dscp_configuration") + return DscpConfigurationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def inbound_security_rule(self): + api_version = self._get_api_version("inbound_security_rule") + return InboundSecurityRuleOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def web_categories(self): + api_version = self._get_api_version("web_categories") + return WebCategoriesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def nat_rules(self): + api_version = self._get_api_version("nat_rules") + return NatRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def virtual_network_gateway_nat_rules(self): + api_version = self._get_api_version("virtual_network_gateway_nat_rules") + return VirtualNetworkGatewayNatRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def active_connectivity_configurations(self): + api_version = self._get_api_version("active_connectivity_configurations") + return ActiveConnectivityConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def active_security_admin_rules(self): + api_version = self._get_api_version("active_security_admin_rules") + return ActiveSecurityAdminRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def active_security_user_rules(self): + api_version = self._get_api_version("active_security_user_rules") + return ActiveSecurityUserRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def admin_rule_collections(self): + api_version = self._get_api_version("admin_rule_collections") + return AdminRuleCollectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def admin_rules(self): + api_version = self._get_api_version("admin_rules") + return AdminRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def connectivity_configurations(self): + api_version = self._get_api_version("connectivity_configurations") + return ConnectivityConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def effective_connectivity_configurations(self): + api_version = self._get_api_version("effective_connectivity_configurations") + return EffectiveConnectivityConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def effective_virtual_networks(self): + api_version = self._get_api_version("effective_virtual_networks") + return EffectiveVirtualNetworksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_groups(self): + api_version = self._get_api_version("network_groups") + return NetworkGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_manager_commits(self): + api_version = self._get_api_version("network_manager_commits") + return NetworkManagerCommitsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_manager_deployment_status(self): + api_version = self._get_api_version("network_manager_deployment_status") + return NetworkManagerDeploymentStatusOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def network_manager_effective_security_admin_rules(self): + api_version = self._get_api_version("network_manager_effective_security_admin_rules") + return NetworkManagerEffectiveSecurityAdminRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_managers(self): + api_version = self._get_api_version("network_managers") + return NetworkManagersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def network_security_perimeters(self): + api_version = self._get_api_version("network_security_perimeters") + return NetworkSecurityPerimetersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_access_rules(self): + api_version = self._get_api_version("nsp_access_rules") + return NspAccessRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_access_rules_reconcile(self): + api_version = self._get_api_version("nsp_access_rules_reconcile") + return NspAccessRulesReconcileOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_association_reconcile(self): + api_version = self._get_api_version("nsp_association_reconcile") + return NspAssociationReconcileOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_associations(self): + api_version = self._get_api_version("nsp_associations") + return NspAssociationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_link_references(self): + api_version = self._get_api_version("nsp_link_references") + return NspLinkReferencesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_links(self): + api_version = self._get_api_version("nsp_links") + return NspLinksOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def nsp_profiles(self): + api_version = self._get_api_version("nsp_profiles") + return NspProfilesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def perimeter_associable_resource_types(self): + api_version = self._get_api_version("perimeter_associable_resource_types") + return PerimeterAssociableResourceTypesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def security_admin_configurations(self): + api_version = self._get_api_version("security_admin_configurations") + return SecurityAdminConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def security_user_configurations(self): + api_version = self._get_api_version("security_user_configurations") + return SecurityUserConfigurationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def user_rule_collections(self): + api_version = self._get_api_version("user_rule_collections") + return UserRuleCollectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2021-02-01-preview'] + ) + def user_rules(self): + api_version = self._get_api_version("user_rules") + return UserRulesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_waf_dynamic_manifests_default(self): + api_version = self._get_api_version("application_gateway_waf_dynamic_manifests_default") + return ApplicationGatewayWafDynamicManifestsDefaultOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def application_gateway_waf_dynamic_manifests(self): + api_version = self._get_api_version("application_gateway_waf_dynamic_manifests") + return ApplicationGatewayWafDynamicManifestsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def configuration_policy_groups(self): + api_version = self._get_api_version("configuration_policy_groups") + return ConfigurationPolicyGroupsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_port_authorizations(self): + api_version = self._get_api_version("express_route_port_authorizations") + return ExpressRoutePortAuthorizationsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def express_route_provider_ports_location(self): + api_version = self._get_api_version("express_route_provider_ports_location") + return ExpressRouteProviderPortsLocationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_idps_signatures_filter_values(self): + api_version = self._get_api_version("firewall_policy_idps_signatures_filter_values") + return FirewallPolicyIdpsSignaturesFilterValuesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_idps_signatures(self): + api_version = self._get_api_version("firewall_policy_idps_signatures") + return FirewallPolicyIdpsSignaturesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def firewall_policy_idps_signatures_overrides(self): + api_version = self._get_api_version("firewall_policy_idps_signatures_overrides") + return FirewallPolicyIdpsSignaturesOverridesOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def management_group_network_manager_connections(self): + api_version = self._get_api_version("management_group_network_manager_connections") + return ManagementGroupNetworkManagerConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def route_maps(self): + api_version = self._get_api_version("route_maps") + return RouteMapsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def routing_intent(self): + api_version = self._get_api_version("routing_intent") + return RoutingIntentOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def scope_connections(self): + api_version = self._get_api_version("scope_connections") + return ScopeConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def service_tag_information(self): + api_version = self._get_api_version("service_tag_information") + return ServiceTagInformationOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def static_members(self): + api_version = self._get_api_version("static_members") + return StaticMembersOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def subscription_network_manager_connections(self): + api_version = self._get_api_version("subscription_network_manager_connections") + return SubscriptionNetworkManagerConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'] + ) + def vip_swap(self): + api_version = self._get_api_version("vip_swap") + return VipSwapOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-06-01', '2023-09-01', '2023-11-01'] + ) + def network_virtual_appliance_connections(self): + api_version = self._get_api_version("network_virtual_appliance_connections") + return NetworkVirtualApplianceConnectionsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-11-01'] + ) + def firewall_policy_deployments(self): + api_version = self._get_api_version("firewall_policy_deployments") + return FirewallPolicyDeploymentsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-11-01'] + ) + def firewall_policy_drafts(self): + api_version = self._get_api_version("firewall_policy_drafts") + return FirewallPolicyDraftsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + @property + @api_version_validation( + method_valid_on=['2023-11-01'] + ) + def firewall_policy_rule_collection_group_drafts(self): + api_version = self._get_api_version("firewall_policy_rule_collection_group_drafts") + return FirewallPolicyRuleCollectionGroupDraftsOperations( + self._client, + self._config, + Serializer(self._models_dict()), + Deserializer(self._models_dict()), + api_version=api_version, + ) + + async def close(self): + await self._client.close() + async def __aenter__(self): + await self._client.__aenter__() + return self + async def __aexit__(self, *exc_details): + await self._client.__aexit__(*exc_details) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_configuration.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_configuration.py new file mode 100644 index 00000000000..9c50c4b1006 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class NetworkManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for NetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft + Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-network/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_vendor.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_vendor.py new file mode 100644 index 00000000000..f19aae839eb --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import NetworkManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from ..._serialization import Deserializer, Serializer + + +class NetworkManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: NetworkManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/__init__.py new file mode 100644 index 00000000000..c96d32de242 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/__init__.py @@ -0,0 +1,334 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from ._operations import ( + ApplicationGatewaysOperations, + ExpressRouteCircuitAuthorizationsOperations, + ExpressRouteCircuitPeeringsOperations, + ExpressRouteCircuitsOperations, + ExpressRouteServiceProvidersOperations, + LoadBalancersOperations, + LocalNetworkGatewaysOperations, + NetworkInterfacesOperations, + NetworkSecurityGroupsOperations, + PublicIPAddressesOperations, + RouteTablesOperations, + RoutesOperations, + SecurityRulesOperations, + SubnetsOperations, + UsagesOperations, + VirtualNetworkGatewayConnectionsOperations, + VirtualNetworkGatewaysOperations, + VirtualNetworksOperations, + ApplicationSecurityGroupsOperations, + AvailableEndpointServicesOperations, + BgpServiceCommunitiesOperations, + ConnectionMonitorsOperations, + DefaultSecurityRulesOperations, + InboundNatRulesOperations, + LoadBalancerBackendAddressPoolsOperations, + LoadBalancerFrontendIPConfigurationsOperations, + LoadBalancerLoadBalancingRulesOperations, + LoadBalancerNetworkInterfacesOperations, + LoadBalancerProbesOperations, + NetworkInterfaceIPConfigurationsOperations, + NetworkInterfaceLoadBalancersOperations, + NetworkWatchersOperations, + Operations, + PacketCapturesOperations, + RouteFilterRulesOperations, + RouteFiltersOperations, + VirtualNetworkPeeringsOperations, + AzureFirewallsOperations, + DdosProtectionPlansOperations, + ExpressRouteCircuitConnectionsOperations, + ExpressRouteCrossConnectionPeeringsOperations, + ExpressRouteCrossConnectionsOperations, + HubVirtualNetworkConnectionsOperations, + VirtualHubsOperations, + VirtualWANsOperations, + VpnConnectionsOperations, + VpnGatewaysOperations, + VpnSitesConfigurationOperations, + VpnSitesOperations, + AvailableDelegationsOperations, + AvailableResourceGroupDelegationsOperations, + AzureFirewallFqdnTagsOperations, + DdosCustomPoliciesOperations, + ExpressRouteConnectionsOperations, + ExpressRouteGatewaysOperations, + ExpressRouteLinksOperations, + ExpressRoutePortsLocationsOperations, + ExpressRoutePortsOperations, + InterfaceEndpointsOperations, + LoadBalancerOutboundRulesOperations, + NetworkInterfaceTapConfigurationsOperations, + NetworkProfilesOperations, + P2SVpnGatewaysOperations, + P2SVpnServerConfigurationsOperations, + PublicIPPrefixesOperations, + ServiceEndpointPoliciesOperations, + ServiceEndpointPolicyDefinitionsOperations, + VirtualNetworkTapsOperations, + VirtualWansOperations, + PeerExpressRouteCircuitConnectionsOperations, + WebApplicationFirewallPoliciesOperations, + NatGatewaysOperations, + ResourceNavigationLinksOperations, + ServiceAssociationLinksOperations, + AvailablePrivateEndpointTypesOperations, + BastionHostsOperations, + PrivateEndpointsOperations, + PrivateLinkServicesOperations, + ServiceTagsOperations, + FirewallPoliciesOperations, + FirewallPolicyRuleGroupsOperations, + VpnLinkConnectionsOperations, + VpnSiteLinkConnectionsOperations, + VpnSiteLinksOperations, + VirtualRouterPeeringsOperations, + VirtualRoutersOperations, + AvailableServiceAliasesOperations, + VpnServerConfigurationsAssociatedWithVirtualWanOperations, + VpnServerConfigurationsOperations, + IpGroupsOperations, + VirtualHubRouteTableV2SOperations, + FlowLogsOperations, + NetworkVirtualAppliancesOperations, + IpAllocationsOperations, + PrivateDnsZoneGroupsOperations, + SecurityPartnerProvidersOperations, + HubRouteTablesOperations, + ApplicationGatewayPrivateEndpointConnectionsOperations, + ApplicationGatewayPrivateLinkResourcesOperations, + FirewallPolicyRuleCollectionGroupsOperations, + VirtualApplianceSitesOperations, + VirtualApplianceSkusOperations, + VirtualHubBgpConnectionOperations, + VirtualHubBgpConnectionsOperations, + VirtualHubIpConfigurationOperations, + CustomIPPrefixesOperations, + DscpConfigurationOperations, + InboundSecurityRuleOperations, + WebCategoriesOperations, + NatRulesOperations, + VirtualNetworkGatewayNatRulesOperations, + ActiveConnectivityConfigurationsOperations, + ActiveSecurityAdminRulesOperations, + ActiveSecurityUserRulesOperations, + AdminRuleCollectionsOperations, + AdminRulesOperations, + ConnectivityConfigurationsOperations, + EffectiveConnectivityConfigurationsOperations, + EffectiveVirtualNetworksOperations, + NetworkGroupsOperations, + NetworkManagerCommitsOperations, + NetworkManagerDeploymentStatusOperations, + NetworkManagerEffectiveSecurityAdminRulesOperations, + NetworkManagersOperations, + NetworkSecurityPerimetersOperations, + NspAccessRulesOperations, + NspAccessRulesReconcileOperations, + NspAssociationReconcileOperations, + NspAssociationsOperations, + NspLinkReferencesOperations, + NspLinksOperations, + NspProfilesOperations, + PerimeterAssociableResourceTypesOperations, + SecurityAdminConfigurationsOperations, + SecurityUserConfigurationsOperations, + UserRuleCollectionsOperations, + UserRulesOperations, + ApplicationGatewayWafDynamicManifestsDefaultOperations, + ApplicationGatewayWafDynamicManifestsOperations, + ConfigurationPolicyGroupsOperations, + ExpressRoutePortAuthorizationsOperations, + ExpressRouteProviderPortsLocationOperations, + FirewallPolicyIdpsSignaturesFilterValuesOperations, + FirewallPolicyIdpsSignaturesOperations, + FirewallPolicyIdpsSignaturesOverridesOperations, + ManagementGroupNetworkManagerConnectionsOperations, + RouteMapsOperations, + RoutingIntentOperations, + ScopeConnectionsOperations, + ServiceTagInformationOperations, + StaticMembersOperations, + SubscriptionNetworkManagerConnectionsOperations, + VipSwapOperations, + NetworkVirtualApplianceConnectionsOperations, + FirewallPolicyDeploymentsOperations, + FirewallPolicyDraftsOperations, + FirewallPolicyRuleCollectionGroupDraftsOperations, + NetworkManagementClientOperationsMixin, +) + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ApplicationGatewaysOperations", + "ExpressRouteCircuitAuthorizationsOperations", + "ExpressRouteCircuitPeeringsOperations", + "ExpressRouteCircuitsOperations", + "ExpressRouteServiceProvidersOperations", + "LoadBalancersOperations", + "LocalNetworkGatewaysOperations", + "NetworkInterfacesOperations", + "NetworkSecurityGroupsOperations", + "PublicIPAddressesOperations", + "RouteTablesOperations", + "RoutesOperations", + "SecurityRulesOperations", + "SubnetsOperations", + "UsagesOperations", + "VirtualNetworkGatewayConnectionsOperations", + "VirtualNetworkGatewaysOperations", + "VirtualNetworksOperations", + "ApplicationSecurityGroupsOperations", + "AvailableEndpointServicesOperations", + "BgpServiceCommunitiesOperations", + "ConnectionMonitorsOperations", + "DefaultSecurityRulesOperations", + "InboundNatRulesOperations", + "LoadBalancerBackendAddressPoolsOperations", + "LoadBalancerFrontendIPConfigurationsOperations", + "LoadBalancerLoadBalancingRulesOperations", + "LoadBalancerNetworkInterfacesOperations", + "LoadBalancerProbesOperations", + "NetworkInterfaceIPConfigurationsOperations", + "NetworkInterfaceLoadBalancersOperations", + "NetworkWatchersOperations", + "Operations", + "PacketCapturesOperations", + "RouteFilterRulesOperations", + "RouteFiltersOperations", + "VirtualNetworkPeeringsOperations", + "AzureFirewallsOperations", + "DdosProtectionPlansOperations", + "ExpressRouteCircuitConnectionsOperations", + "ExpressRouteCrossConnectionPeeringsOperations", + "ExpressRouteCrossConnectionsOperations", + "HubVirtualNetworkConnectionsOperations", + "VirtualHubsOperations", + "VirtualWANsOperations", + "VpnConnectionsOperations", + "VpnGatewaysOperations", + "VpnSitesConfigurationOperations", + "VpnSitesOperations", + "AvailableDelegationsOperations", + "AvailableResourceGroupDelegationsOperations", + "AzureFirewallFqdnTagsOperations", + "DdosCustomPoliciesOperations", + "ExpressRouteConnectionsOperations", + "ExpressRouteGatewaysOperations", + "ExpressRouteLinksOperations", + "ExpressRoutePortsLocationsOperations", + "ExpressRoutePortsOperations", + "InterfaceEndpointsOperations", + "LoadBalancerOutboundRulesOperations", + "NetworkInterfaceTapConfigurationsOperations", + "NetworkProfilesOperations", + "P2SVpnGatewaysOperations", + "P2SVpnServerConfigurationsOperations", + "PublicIPPrefixesOperations", + "ServiceEndpointPoliciesOperations", + "ServiceEndpointPolicyDefinitionsOperations", + "VirtualNetworkTapsOperations", + "VirtualWansOperations", + "PeerExpressRouteCircuitConnectionsOperations", + "WebApplicationFirewallPoliciesOperations", + "NatGatewaysOperations", + "ResourceNavigationLinksOperations", + "ServiceAssociationLinksOperations", + "AvailablePrivateEndpointTypesOperations", + "BastionHostsOperations", + "PrivateEndpointsOperations", + "PrivateLinkServicesOperations", + "ServiceTagsOperations", + "FirewallPoliciesOperations", + "FirewallPolicyRuleGroupsOperations", + "VpnLinkConnectionsOperations", + "VpnSiteLinkConnectionsOperations", + "VpnSiteLinksOperations", + "VirtualRouterPeeringsOperations", + "VirtualRoutersOperations", + "AvailableServiceAliasesOperations", + "VpnServerConfigurationsAssociatedWithVirtualWanOperations", + "VpnServerConfigurationsOperations", + "IpGroupsOperations", + "VirtualHubRouteTableV2SOperations", + "FlowLogsOperations", + "NetworkVirtualAppliancesOperations", + "IpAllocationsOperations", + "PrivateDnsZoneGroupsOperations", + "SecurityPartnerProvidersOperations", + "HubRouteTablesOperations", + "ApplicationGatewayPrivateEndpointConnectionsOperations", + "ApplicationGatewayPrivateLinkResourcesOperations", + "FirewallPolicyRuleCollectionGroupsOperations", + "VirtualApplianceSitesOperations", + "VirtualApplianceSkusOperations", + "VirtualHubBgpConnectionOperations", + "VirtualHubBgpConnectionsOperations", + "VirtualHubIpConfigurationOperations", + "CustomIPPrefixesOperations", + "DscpConfigurationOperations", + "InboundSecurityRuleOperations", + "WebCategoriesOperations", + "NatRulesOperations", + "VirtualNetworkGatewayNatRulesOperations", + "ActiveConnectivityConfigurationsOperations", + "ActiveSecurityAdminRulesOperations", + "ActiveSecurityUserRulesOperations", + "AdminRuleCollectionsOperations", + "AdminRulesOperations", + "ConnectivityConfigurationsOperations", + "EffectiveConnectivityConfigurationsOperations", + "EffectiveVirtualNetworksOperations", + "NetworkGroupsOperations", + "NetworkManagerCommitsOperations", + "NetworkManagerDeploymentStatusOperations", + "NetworkManagerEffectiveSecurityAdminRulesOperations", + "NetworkManagersOperations", + "NetworkSecurityPerimetersOperations", + "NspAccessRulesOperations", + "NspAccessRulesReconcileOperations", + "NspAssociationReconcileOperations", + "NspAssociationsOperations", + "NspLinkReferencesOperations", + "NspLinksOperations", + "NspProfilesOperations", + "PerimeterAssociableResourceTypesOperations", + "SecurityAdminConfigurationsOperations", + "SecurityUserConfigurationsOperations", + "UserRuleCollectionsOperations", + "UserRulesOperations", + "ApplicationGatewayWafDynamicManifestsDefaultOperations", + "ApplicationGatewayWafDynamicManifestsOperations", + "ConfigurationPolicyGroupsOperations", + "ExpressRoutePortAuthorizationsOperations", + "ExpressRouteProviderPortsLocationOperations", + "FirewallPolicyIdpsSignaturesFilterValuesOperations", + "FirewallPolicyIdpsSignaturesOperations", + "FirewallPolicyIdpsSignaturesOverridesOperations", + "ManagementGroupNetworkManagerConnectionsOperations", + "RouteMapsOperations", + "RoutingIntentOperations", + "ScopeConnectionsOperations", + "ServiceTagInformationOperations", + "StaticMembersOperations", + "SubscriptionNetworkManagerConnectionsOperations", + "VipSwapOperations", + "NetworkVirtualApplianceConnectionsOperations", + "FirewallPolicyDeploymentsOperations", + "FirewallPolicyDraftsOperations", + "FirewallPolicyRuleCollectionGroupDraftsOperations", + "NetworkManagementClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/_operations.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/_operations.py new file mode 100644 index 00000000000..a2744235997 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/_operations.py @@ -0,0 +1,72539 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Literal, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import ( + build_admin_rule_collections_create_or_update_request, + build_admin_rule_collections_delete_request, + build_admin_rule_collections_get_request, + build_admin_rule_collections_list_request, + build_admin_rules_create_or_update_request, + build_admin_rules_delete_request, + build_admin_rules_get_request, + build_admin_rules_list_request, + build_application_gateway_private_endpoint_connections_delete_request, + build_application_gateway_private_endpoint_connections_get_request, + build_application_gateway_private_endpoint_connections_list_request, + build_application_gateway_private_endpoint_connections_update_request, + build_application_gateway_private_link_resources_list_request, + build_application_gateway_waf_dynamic_manifests_default_get_request, + build_application_gateway_waf_dynamic_manifests_get_request, + build_application_gateways_backend_health_on_demand_request, + build_application_gateways_backend_health_request, + build_application_gateways_create_or_update_request, + build_application_gateways_delete_request, + build_application_gateways_get_request, + build_application_gateways_get_ssl_predefined_policy_request, + build_application_gateways_list_all_request, + build_application_gateways_list_available_request_headers_request, + build_application_gateways_list_available_response_headers_request, + build_application_gateways_list_available_server_variables_request, + build_application_gateways_list_available_ssl_options_request, + build_application_gateways_list_available_ssl_predefined_policies_request, + build_application_gateways_list_available_waf_rule_sets_request, + build_application_gateways_list_request, + build_application_gateways_start_request, + build_application_gateways_stop_request, + build_application_gateways_update_tags_request, + build_application_security_groups_create_or_update_request, + build_application_security_groups_delete_request, + build_application_security_groups_get_request, + build_application_security_groups_list_all_request, + build_application_security_groups_list_request, + build_application_security_groups_update_tags_request, + build_available_delegations_list_request, + build_available_endpoint_services_list_request, + build_available_private_endpoint_types_list_by_resource_group_request, + build_available_private_endpoint_types_list_request, + build_available_resource_group_delegations_list_request, + build_available_service_aliases_list_by_resource_group_request, + build_available_service_aliases_list_request, + build_azure_firewall_fqdn_tags_list_all_request, + build_azure_firewalls_create_or_update_request, + build_azure_firewalls_delete_request, + build_azure_firewalls_get_request, + build_azure_firewalls_list_all_request, + build_azure_firewalls_list_learned_prefixes_request, + build_azure_firewalls_list_request, + build_azure_firewalls_packet_capture_request, + build_azure_firewalls_update_tags_request, + build_bastion_hosts_create_or_update_request, + build_bastion_hosts_delete_request, + build_bastion_hosts_get_request, + build_bastion_hosts_list_by_resource_group_request, + build_bastion_hosts_list_request, + build_bastion_hosts_update_tags_request, + build_bgp_service_communities_list_request, + build_configuration_policy_groups_create_or_update_request, + build_configuration_policy_groups_delete_request, + build_configuration_policy_groups_get_request, + build_configuration_policy_groups_list_by_vpn_server_configuration_request, + build_connection_monitors_create_or_update_request, + build_connection_monitors_delete_request, + build_connection_monitors_get_request, + build_connection_monitors_list_request, + build_connection_monitors_query_request, + build_connection_monitors_start_request, + build_connection_monitors_stop_request, + build_connection_monitors_update_tags_request, + build_connectivity_configurations_create_or_update_request, + build_connectivity_configurations_delete_request, + build_connectivity_configurations_get_request, + build_connectivity_configurations_list_request, + build_custom_ip_prefixes_create_or_update_request, + build_custom_ip_prefixes_delete_request, + build_custom_ip_prefixes_get_request, + build_custom_ip_prefixes_list_all_request, + build_custom_ip_prefixes_list_request, + build_custom_ip_prefixes_update_tags_request, + build_ddos_custom_policies_create_or_update_request, + build_ddos_custom_policies_delete_request, + build_ddos_custom_policies_get_request, + build_ddos_custom_policies_update_tags_request, + build_ddos_protection_plans_create_or_update_request, + build_ddos_protection_plans_delete_request, + build_ddos_protection_plans_get_request, + build_ddos_protection_plans_list_by_resource_group_request, + build_ddos_protection_plans_list_request, + build_ddos_protection_plans_update_tags_request, + build_default_security_rules_get_request, + build_default_security_rules_list_request, + build_dscp_configuration_create_or_update_request, + build_dscp_configuration_delete_request, + build_dscp_configuration_get_request, + build_dscp_configuration_list_all_request, + build_dscp_configuration_list_request, + build_express_route_circuit_authorizations_create_or_update_request, + build_express_route_circuit_authorizations_delete_request, + build_express_route_circuit_authorizations_get_request, + build_express_route_circuit_authorizations_list_request, + build_express_route_circuit_connections_create_or_update_request, + build_express_route_circuit_connections_delete_request, + build_express_route_circuit_connections_get_request, + build_express_route_circuit_connections_list_request, + build_express_route_circuit_peerings_create_or_update_request, + build_express_route_circuit_peerings_delete_request, + build_express_route_circuit_peerings_get_request, + build_express_route_circuit_peerings_list_request, + build_express_route_circuits_create_or_update_request, + build_express_route_circuits_delete_request, + build_express_route_circuits_get_peering_stats_request, + build_express_route_circuits_get_request, + build_express_route_circuits_get_stats_request, + build_express_route_circuits_list_all_request, + build_express_route_circuits_list_arp_table_request, + build_express_route_circuits_list_request, + build_express_route_circuits_list_routes_table_request, + build_express_route_circuits_list_routes_table_summary_request, + build_express_route_circuits_update_tags_request, + build_express_route_connections_create_or_update_request, + build_express_route_connections_delete_request, + build_express_route_connections_get_request, + build_express_route_connections_list_request, + build_express_route_cross_connection_peerings_create_or_update_request, + build_express_route_cross_connection_peerings_delete_request, + build_express_route_cross_connection_peerings_get_request, + build_express_route_cross_connection_peerings_list_request, + build_express_route_cross_connections_create_or_update_request, + build_express_route_cross_connections_get_request, + build_express_route_cross_connections_list_arp_table_request, + build_express_route_cross_connections_list_by_resource_group_request, + build_express_route_cross_connections_list_request, + build_express_route_cross_connections_list_routes_table_request, + build_express_route_cross_connections_list_routes_table_summary_request, + build_express_route_cross_connections_update_tags_request, + build_express_route_gateways_create_or_update_request, + build_express_route_gateways_delete_request, + build_express_route_gateways_get_request, + build_express_route_gateways_list_by_resource_group_request, + build_express_route_gateways_list_by_subscription_request, + build_express_route_gateways_update_tags_request, + build_express_route_links_get_request, + build_express_route_links_list_request, + build_express_route_port_authorizations_create_or_update_request, + build_express_route_port_authorizations_delete_request, + build_express_route_port_authorizations_get_request, + build_express_route_port_authorizations_list_request, + build_express_route_ports_create_or_update_request, + build_express_route_ports_delete_request, + build_express_route_ports_generate_loa_request, + build_express_route_ports_get_request, + build_express_route_ports_list_by_resource_group_request, + build_express_route_ports_list_request, + build_express_route_ports_locations_get_request, + build_express_route_ports_locations_list_request, + build_express_route_ports_update_tags_request, + build_express_route_provider_ports_location_list_request, + build_express_route_service_providers_list_request, + build_firewall_policies_create_or_update_request, + build_firewall_policies_delete_request, + build_firewall_policies_get_request, + build_firewall_policies_list_all_request, + build_firewall_policies_list_request, + build_firewall_policies_update_tags_request, + build_firewall_policy_deployments_deploy_request, + build_firewall_policy_drafts_create_or_update_request, + build_firewall_policy_drafts_delete_request, + build_firewall_policy_drafts_get_request, + build_firewall_policy_idps_signatures_filter_values_list_request, + build_firewall_policy_idps_signatures_list_request, + build_firewall_policy_idps_signatures_overrides_get_request, + build_firewall_policy_idps_signatures_overrides_list_request, + build_firewall_policy_idps_signatures_overrides_patch_request, + build_firewall_policy_idps_signatures_overrides_put_request, + build_firewall_policy_rule_collection_group_drafts_create_or_update_request, + build_firewall_policy_rule_collection_group_drafts_delete_request, + build_firewall_policy_rule_collection_group_drafts_get_request, + build_firewall_policy_rule_collection_groups_create_or_update_request, + build_firewall_policy_rule_collection_groups_delete_request, + build_firewall_policy_rule_collection_groups_get_request, + build_firewall_policy_rule_collection_groups_list_request, + build_flow_logs_create_or_update_request, + build_flow_logs_delete_request, + build_flow_logs_get_request, + build_flow_logs_list_request, + build_flow_logs_update_tags_request, + build_hub_route_tables_create_or_update_request, + build_hub_route_tables_delete_request, + build_hub_route_tables_get_request, + build_hub_route_tables_list_request, + build_hub_virtual_network_connections_create_or_update_request, + build_hub_virtual_network_connections_delete_request, + build_hub_virtual_network_connections_get_request, + build_hub_virtual_network_connections_list_request, + build_inbound_nat_rules_create_or_update_request, + build_inbound_nat_rules_delete_request, + build_inbound_nat_rules_get_request, + build_inbound_nat_rules_list_request, + build_inbound_security_rule_create_or_update_request, + build_ip_allocations_create_or_update_request, + build_ip_allocations_delete_request, + build_ip_allocations_get_request, + build_ip_allocations_list_by_resource_group_request, + build_ip_allocations_list_request, + build_ip_allocations_update_tags_request, + build_ip_groups_create_or_update_request, + build_ip_groups_delete_request, + build_ip_groups_get_request, + build_ip_groups_list_by_resource_group_request, + build_ip_groups_list_request, + build_ip_groups_update_groups_request, + build_load_balancer_backend_address_pools_create_or_update_request, + build_load_balancer_backend_address_pools_delete_request, + build_load_balancer_backend_address_pools_get_request, + build_load_balancer_backend_address_pools_list_request, + build_load_balancer_frontend_ip_configurations_get_request, + build_load_balancer_frontend_ip_configurations_list_request, + build_load_balancer_load_balancing_rules_get_request, + build_load_balancer_load_balancing_rules_list_request, + build_load_balancer_network_interfaces_list_request, + build_load_balancer_outbound_rules_get_request, + build_load_balancer_outbound_rules_list_request, + build_load_balancer_probes_get_request, + build_load_balancer_probes_list_request, + build_load_balancers_create_or_update_request, + build_load_balancers_delete_request, + build_load_balancers_get_request, + build_load_balancers_list_all_request, + build_load_balancers_list_inbound_nat_rule_port_mappings_request, + build_load_balancers_list_request, + build_load_balancers_migrate_to_ip_based_request, + build_load_balancers_swap_public_ip_addresses_request, + build_load_balancers_update_tags_request, + build_local_network_gateways_create_or_update_request, + build_local_network_gateways_delete_request, + build_local_network_gateways_get_request, + build_local_network_gateways_list_request, + build_local_network_gateways_update_tags_request, + build_management_group_network_manager_connections_create_or_update_request, + build_management_group_network_manager_connections_delete_request, + build_management_group_network_manager_connections_get_request, + build_management_group_network_manager_connections_list_request, + build_nat_gateways_create_or_update_request, + build_nat_gateways_delete_request, + build_nat_gateways_get_request, + build_nat_gateways_list_all_request, + build_nat_gateways_list_request, + build_nat_gateways_update_tags_request, + build_nat_rules_create_or_update_request, + build_nat_rules_delete_request, + build_nat_rules_get_request, + build_nat_rules_list_by_vpn_gateway_request, + build_network_groups_create_or_update_request, + build_network_groups_delete_request, + build_network_groups_get_request, + build_network_groups_list_request, + build_network_interface_ip_configurations_get_request, + build_network_interface_ip_configurations_list_request, + build_network_interface_load_balancers_list_request, + build_network_interface_tap_configurations_create_or_update_request, + build_network_interface_tap_configurations_delete_request, + build_network_interface_tap_configurations_get_request, + build_network_interface_tap_configurations_list_request, + build_network_interfaces_create_or_update_request, + build_network_interfaces_delete_request, + build_network_interfaces_get_cloud_service_network_interface_request, + build_network_interfaces_get_effective_route_table_request, + build_network_interfaces_get_request, + build_network_interfaces_get_virtual_machine_scale_set_ip_configuration_request, + build_network_interfaces_get_virtual_machine_scale_set_network_interface_request, + build_network_interfaces_list_all_request, + build_network_interfaces_list_cloud_service_network_interfaces_request, + build_network_interfaces_list_cloud_service_role_instance_network_interfaces_request, + build_network_interfaces_list_effective_network_security_groups_request, + build_network_interfaces_list_request, + build_network_interfaces_list_virtual_machine_scale_set_ip_configurations_request, + build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request, + build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request, + build_network_interfaces_update_tags_request, + build_network_management_check_dns_name_availability_request, + build_network_management_delete_bastion_shareable_link_by_token_request, + build_network_management_delete_bastion_shareable_link_request, + build_network_management_disconnect_active_sessions_request, + build_network_management_express_route_provider_port_request, + build_network_management_generatevirtualwanvpnserverconfigurationvpnprofile_request, + build_network_management_get_active_sessions_request, + build_network_management_get_bastion_shareable_link_request, + build_network_management_list_active_connectivity_configurations_request, + build_network_management_list_active_security_admin_rules_request, + build_network_management_list_network_manager_effective_connectivity_configurations_request, + build_network_management_list_network_manager_effective_security_admin_rules_request, + build_network_management_put_bastion_shareable_link_request, + build_network_management_supported_security_providers_request, + build_network_manager_commits_post_request, + build_network_manager_deployment_status_list_request, + build_network_managers_create_or_update_request, + build_network_managers_delete_request, + build_network_managers_get_request, + build_network_managers_list_by_subscription_request, + build_network_managers_list_request, + build_network_managers_patch_request, + build_network_profiles_create_or_update_request, + build_network_profiles_delete_request, + build_network_profiles_get_request, + build_network_profiles_list_all_request, + build_network_profiles_list_request, + build_network_profiles_update_tags_request, + build_network_security_groups_create_or_update_request, + build_network_security_groups_delete_request, + build_network_security_groups_get_request, + build_network_security_groups_list_all_request, + build_network_security_groups_list_request, + build_network_security_groups_update_tags_request, + build_network_virtual_appliance_connections_create_or_update_request, + build_network_virtual_appliance_connections_delete_request, + build_network_virtual_appliance_connections_get_request, + build_network_virtual_appliance_connections_list_request, + build_network_virtual_appliances_create_or_update_request, + build_network_virtual_appliances_delete_request, + build_network_virtual_appliances_get_request, + build_network_virtual_appliances_list_by_resource_group_request, + build_network_virtual_appliances_list_request, + build_network_virtual_appliances_restart_request, + build_network_virtual_appliances_update_tags_request, + build_network_watchers_check_connectivity_request, + build_network_watchers_create_or_update_request, + build_network_watchers_delete_request, + build_network_watchers_get_azure_reachability_report_request, + build_network_watchers_get_flow_log_status_request, + build_network_watchers_get_network_configuration_diagnostic_request, + build_network_watchers_get_next_hop_request, + build_network_watchers_get_request, + build_network_watchers_get_topology_request, + build_network_watchers_get_troubleshooting_request, + build_network_watchers_get_troubleshooting_result_request, + build_network_watchers_get_vm_security_rules_request, + build_network_watchers_list_all_request, + build_network_watchers_list_available_providers_request, + build_network_watchers_list_request, + build_network_watchers_set_flow_log_configuration_request, + build_network_watchers_update_tags_request, + build_network_watchers_verify_ip_flow_request, + build_operations_list_request, + build_p2_svpn_gateways_create_or_update_request, + build_p2_svpn_gateways_delete_request, + build_p2_svpn_gateways_disconnect_p2_s_vpn_connections_request, + build_p2_svpn_gateways_generate_vpn_profile_request, + build_p2_svpn_gateways_get_p2_s_vpn_connection_health_detailed_request, + build_p2_svpn_gateways_get_p2_s_vpn_connection_health_request, + build_p2_svpn_gateways_get_request, + build_p2_svpn_gateways_list_by_resource_group_request, + build_p2_svpn_gateways_list_request, + build_p2_svpn_gateways_reset_request, + build_p2_svpn_gateways_update_tags_request, + build_packet_captures_create_request, + build_packet_captures_delete_request, + build_packet_captures_get_request, + build_packet_captures_get_status_request, + build_packet_captures_list_request, + build_packet_captures_stop_request, + build_peer_express_route_circuit_connections_get_request, + build_peer_express_route_circuit_connections_list_request, + build_private_dns_zone_groups_create_or_update_request, + build_private_dns_zone_groups_delete_request, + build_private_dns_zone_groups_get_request, + build_private_dns_zone_groups_list_request, + build_private_endpoints_create_or_update_request, + build_private_endpoints_delete_request, + build_private_endpoints_get_request, + build_private_endpoints_list_by_subscription_request, + build_private_endpoints_list_request, + build_private_link_services_check_private_link_service_visibility_by_resource_group_request, + build_private_link_services_check_private_link_service_visibility_request, + build_private_link_services_create_or_update_request, + build_private_link_services_delete_private_endpoint_connection_request, + build_private_link_services_delete_request, + build_private_link_services_get_private_endpoint_connection_request, + build_private_link_services_get_request, + build_private_link_services_list_auto_approved_private_link_services_by_resource_group_request, + build_private_link_services_list_auto_approved_private_link_services_request, + build_private_link_services_list_by_subscription_request, + build_private_link_services_list_private_endpoint_connections_request, + build_private_link_services_list_request, + build_private_link_services_update_private_endpoint_connection_request, + build_public_ip_addresses_create_or_update_request, + build_public_ip_addresses_ddos_protection_status_request, + build_public_ip_addresses_delete_request, + build_public_ip_addresses_get_cloud_service_public_ip_address_request, + build_public_ip_addresses_get_request, + build_public_ip_addresses_get_virtual_machine_scale_set_public_ip_address_request, + build_public_ip_addresses_list_all_request, + build_public_ip_addresses_list_cloud_service_public_ip_addresses_request, + build_public_ip_addresses_list_cloud_service_role_instance_public_ip_addresses_request, + build_public_ip_addresses_list_request, + build_public_ip_addresses_list_virtual_machine_scale_set_public_ip_addresses_request, + build_public_ip_addresses_list_virtual_machine_scale_set_vm_public_ip_addresses_request, + build_public_ip_addresses_update_tags_request, + build_public_ip_prefixes_create_or_update_request, + build_public_ip_prefixes_delete_request, + build_public_ip_prefixes_get_request, + build_public_ip_prefixes_list_all_request, + build_public_ip_prefixes_list_request, + build_public_ip_prefixes_update_tags_request, + build_resource_navigation_links_list_request, + build_route_filter_rules_create_or_update_request, + build_route_filter_rules_delete_request, + build_route_filter_rules_get_request, + build_route_filter_rules_list_by_route_filter_request, + build_route_filters_create_or_update_request, + build_route_filters_delete_request, + build_route_filters_get_request, + build_route_filters_list_by_resource_group_request, + build_route_filters_list_request, + build_route_filters_update_tags_request, + build_route_maps_create_or_update_request, + build_route_maps_delete_request, + build_route_maps_get_request, + build_route_maps_list_request, + build_route_tables_create_or_update_request, + build_route_tables_delete_request, + build_route_tables_get_request, + build_route_tables_list_all_request, + build_route_tables_list_request, + build_route_tables_update_tags_request, + build_routes_create_or_update_request, + build_routes_delete_request, + build_routes_get_request, + build_routes_list_request, + build_routing_intent_create_or_update_request, + build_routing_intent_delete_request, + build_routing_intent_get_request, + build_routing_intent_list_request, + build_scope_connections_create_or_update_request, + build_scope_connections_delete_request, + build_scope_connections_get_request, + build_scope_connections_list_request, + build_security_admin_configurations_create_or_update_request, + build_security_admin_configurations_delete_request, + build_security_admin_configurations_get_request, + build_security_admin_configurations_list_request, + build_security_partner_providers_create_or_update_request, + build_security_partner_providers_delete_request, + build_security_partner_providers_get_request, + build_security_partner_providers_list_by_resource_group_request, + build_security_partner_providers_list_request, + build_security_partner_providers_update_tags_request, + build_security_rules_create_or_update_request, + build_security_rules_delete_request, + build_security_rules_get_request, + build_security_rules_list_request, + build_service_association_links_list_request, + build_service_endpoint_policies_create_or_update_request, + build_service_endpoint_policies_delete_request, + build_service_endpoint_policies_get_request, + build_service_endpoint_policies_list_by_resource_group_request, + build_service_endpoint_policies_list_request, + build_service_endpoint_policies_update_tags_request, + build_service_endpoint_policy_definitions_create_or_update_request, + build_service_endpoint_policy_definitions_delete_request, + build_service_endpoint_policy_definitions_get_request, + build_service_endpoint_policy_definitions_list_by_resource_group_request, + build_service_tag_information_list_request, + build_service_tags_list_request, + build_static_members_create_or_update_request, + build_static_members_delete_request, + build_static_members_get_request, + build_static_members_list_request, + build_subnets_create_or_update_request, + build_subnets_delete_request, + build_subnets_get_request, + build_subnets_list_request, + build_subnets_prepare_network_policies_request, + build_subnets_unprepare_network_policies_request, + build_subscription_network_manager_connections_create_or_update_request, + build_subscription_network_manager_connections_delete_request, + build_subscription_network_manager_connections_get_request, + build_subscription_network_manager_connections_list_request, + build_usages_list_request, + build_vip_swap_create_request, + build_vip_swap_get_request, + build_vip_swap_list_request, + build_virtual_appliance_sites_create_or_update_request, + build_virtual_appliance_sites_delete_request, + build_virtual_appliance_sites_get_request, + build_virtual_appliance_sites_list_request, + build_virtual_appliance_skus_get_request, + build_virtual_appliance_skus_list_request, + build_virtual_hub_bgp_connection_create_or_update_request, + build_virtual_hub_bgp_connection_delete_request, + build_virtual_hub_bgp_connection_get_request, + build_virtual_hub_bgp_connections_list_advertised_routes_request, + build_virtual_hub_bgp_connections_list_learned_routes_request, + build_virtual_hub_bgp_connections_list_request, + build_virtual_hub_ip_configuration_create_or_update_request, + build_virtual_hub_ip_configuration_delete_request, + build_virtual_hub_ip_configuration_get_request, + build_virtual_hub_ip_configuration_list_request, + build_virtual_hub_route_table_v2_s_create_or_update_request, + build_virtual_hub_route_table_v2_s_delete_request, + build_virtual_hub_route_table_v2_s_get_request, + build_virtual_hub_route_table_v2_s_list_request, + build_virtual_hubs_create_or_update_request, + build_virtual_hubs_delete_request, + build_virtual_hubs_get_effective_virtual_hub_routes_request, + build_virtual_hubs_get_inbound_routes_request, + build_virtual_hubs_get_outbound_routes_request, + build_virtual_hubs_get_request, + build_virtual_hubs_list_by_resource_group_request, + build_virtual_hubs_list_request, + build_virtual_hubs_update_tags_request, + build_virtual_network_gateway_connections_create_or_update_request, + build_virtual_network_gateway_connections_delete_request, + build_virtual_network_gateway_connections_get_ike_sas_request, + build_virtual_network_gateway_connections_get_request, + build_virtual_network_gateway_connections_get_shared_key_request, + build_virtual_network_gateway_connections_list_request, + build_virtual_network_gateway_connections_reset_connection_request, + build_virtual_network_gateway_connections_reset_shared_key_request, + build_virtual_network_gateway_connections_set_shared_key_request, + build_virtual_network_gateway_connections_start_packet_capture_request, + build_virtual_network_gateway_connections_stop_packet_capture_request, + build_virtual_network_gateway_connections_update_tags_request, + build_virtual_network_gateway_nat_rules_create_or_update_request, + build_virtual_network_gateway_nat_rules_delete_request, + build_virtual_network_gateway_nat_rules_get_request, + build_virtual_network_gateway_nat_rules_list_by_virtual_network_gateway_request, + build_virtual_network_gateways_create_or_update_request, + build_virtual_network_gateways_delete_request, + build_virtual_network_gateways_disconnect_virtual_network_gateway_vpn_connections_request, + build_virtual_network_gateways_generate_vpn_profile_request, + build_virtual_network_gateways_generatevpnclientpackage_request, + build_virtual_network_gateways_get_advertised_routes_request, + build_virtual_network_gateways_get_bgp_peer_status_request, + build_virtual_network_gateways_get_learned_routes_request, + build_virtual_network_gateways_get_request, + build_virtual_network_gateways_get_vpn_profile_package_url_request, + build_virtual_network_gateways_get_vpnclient_connection_health_request, + build_virtual_network_gateways_get_vpnclient_ipsec_parameters_request, + build_virtual_network_gateways_list_connections_request, + build_virtual_network_gateways_list_request, + build_virtual_network_gateways_reset_request, + build_virtual_network_gateways_reset_vpn_client_shared_key_request, + build_virtual_network_gateways_set_vpnclient_ipsec_parameters_request, + build_virtual_network_gateways_start_packet_capture_request, + build_virtual_network_gateways_stop_packet_capture_request, + build_virtual_network_gateways_supported_vpn_devices_request, + build_virtual_network_gateways_update_tags_request, + build_virtual_network_gateways_vpn_device_configuration_script_request, + build_virtual_network_peerings_create_or_update_request, + build_virtual_network_peerings_delete_request, + build_virtual_network_peerings_get_request, + build_virtual_network_peerings_list_request, + build_virtual_network_taps_create_or_update_request, + build_virtual_network_taps_delete_request, + build_virtual_network_taps_get_request, + build_virtual_network_taps_list_all_request, + build_virtual_network_taps_list_by_resource_group_request, + build_virtual_network_taps_update_tags_request, + build_virtual_networks_check_ip_address_availability_request, + build_virtual_networks_create_or_update_request, + build_virtual_networks_delete_request, + build_virtual_networks_get_request, + build_virtual_networks_list_all_request, + build_virtual_networks_list_ddos_protection_status_request, + build_virtual_networks_list_request, + build_virtual_networks_list_usage_request, + build_virtual_networks_update_tags_request, + build_virtual_router_peerings_create_or_update_request, + build_virtual_router_peerings_delete_request, + build_virtual_router_peerings_get_request, + build_virtual_router_peerings_list_request, + build_virtual_routers_create_or_update_request, + build_virtual_routers_delete_request, + build_virtual_routers_get_request, + build_virtual_routers_list_by_resource_group_request, + build_virtual_routers_list_request, + build_virtual_wans_create_or_update_request, + build_virtual_wans_delete_request, + build_virtual_wans_get_request, + build_virtual_wans_list_by_resource_group_request, + build_virtual_wans_list_request, + build_virtual_wans_update_tags_request, + build_vpn_connections_create_or_update_request, + build_vpn_connections_delete_request, + build_vpn_connections_get_request, + build_vpn_connections_list_by_vpn_gateway_request, + build_vpn_connections_start_packet_capture_request, + build_vpn_connections_stop_packet_capture_request, + build_vpn_gateways_create_or_update_request, + build_vpn_gateways_delete_request, + build_vpn_gateways_get_request, + build_vpn_gateways_list_by_resource_group_request, + build_vpn_gateways_list_request, + build_vpn_gateways_reset_request, + build_vpn_gateways_start_packet_capture_request, + build_vpn_gateways_stop_packet_capture_request, + build_vpn_gateways_update_tags_request, + build_vpn_link_connections_get_ike_sas_request, + build_vpn_link_connections_list_by_vpn_connection_request, + build_vpn_link_connections_reset_connection_request, + build_vpn_server_configurations_associated_with_virtual_wan_list_request, + build_vpn_server_configurations_create_or_update_request, + build_vpn_server_configurations_delete_request, + build_vpn_server_configurations_get_request, + build_vpn_server_configurations_list_by_resource_group_request, + build_vpn_server_configurations_list_request, + build_vpn_server_configurations_update_tags_request, + build_vpn_site_link_connections_get_request, + build_vpn_site_links_get_request, + build_vpn_site_links_list_by_vpn_site_request, + build_vpn_sites_configuration_download_request, + build_vpn_sites_create_or_update_request, + build_vpn_sites_delete_request, + build_vpn_sites_get_request, + build_vpn_sites_list_by_resource_group_request, + build_vpn_sites_list_request, + build_vpn_sites_update_tags_request, + build_web_application_firewall_policies_create_or_update_request, + build_web_application_firewall_policies_delete_request, + build_web_application_firewall_policies_get_request, + build_web_application_firewall_policies_list_all_request, + build_web_application_firewall_policies_list_request, + build_web_categories_get_request, + build_web_categories_list_by_subscription_request, +) +from .._vendor import NetworkManagementClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + + +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +from ..._validation import api_version_validation + +from ...operations._operations import build_application_gateways_update_tags_request +from ...operations._operations import build_express_route_circuits_list_arp_table_request +from ...operations._operations import build_express_route_circuits_list_routes_table_request +from ...operations._operations import build_express_route_circuits_list_stats_request +from ...operations._operations import build_express_route_circuits_update_tags_request +from ...operations._operations import build_load_balancers_update_tags_request +from ...operations._operations import build_local_network_gateways_update_tags_request +from ...operations._operations import build_network_interfaces_update_tags_request +from ...operations._operations import build_network_security_groups_update_tags_request +from ...operations._operations import build_public_ip_addresses_update_tags_request +from ...operations._operations import build_route_tables_update_tags_request +from ...operations._operations import build_virtual_networks_update_tags_request +from ...operations._operations import build_virtual_networks_get_bastion_hosts_request +from ...operations._operations import build_application_security_groups_update_tags_request +from ...operations._operations import build_route_filter_rules_update_request +from ...operations._operations import build_route_filters_update_request +from ...operations._operations import build_azure_firewalls_update_tags_request +from ...operations._operations import build_ddos_protection_plans_update_tags_request +from ...operations._operations import build_express_route_cross_connections_update_tags_request +from ...operations._operations import build_virtual_hubs_update_tags_request +from ...operations._operations import build_virtual_wans_create_or_update_request +from ...operations._operations import build_virtual_wans_delete_request +from ...operations._operations import build_virtual_wans_update_tags_request +from ...operations._operations import build_virtual_wans_get_request +from ...operations._operations import build_virtual_wans_list_request +from ...operations._operations import build_virtual_wans_list_by_resource_group_request +from ...operations._operations import build_vpn_gateways_update_tags_request +from ...operations._operations import build_vpn_sites_update_tags_request +from ...operations._operations import build_ddos_custom_policies_update_tags_request +from ...operations._operations import build_express_route_ports_update_tags_request +from ...operations._operations import build_interface_endpoints_create_or_update_request +from ...operations._operations import build_interface_endpoints_delete_request +from ...operations._operations import build_interface_endpoints_get_request +from ...operations._operations import build_interface_endpoints_list_request +from ...operations._operations import build_interface_endpoints_list_by_subscription_request +from ...operations._operations import build_p2_svpn_gateways_update_tags_request +from ...operations._operations import build_p2_svpn_server_configurations_create_or_update_request +from ...operations._operations import build_p2_svpn_server_configurations_delete_request +from ...operations._operations import build_p2_svpn_server_configurations_get_request +from ...operations._operations import build_p2_svpn_server_configurations_list_by_virtual_wan_request +from ...operations._operations import build_public_ip_prefixes_update_tags_request +from ...operations._operations import build_service_endpoint_policies_update_request +from ...operations._operations import build_virtual_network_taps_update_tags_request +from ...operations._operations import build_virtual_wans_update_tags_request +from ...operations._operations import build_resource_navigation_links_get_request +from ...operations._operations import build_service_association_links_get_request +from ...operations._operations import build_firewall_policy_rule_groups_create_or_update_request +from ...operations._operations import build_firewall_policy_rule_groups_delete_request +from ...operations._operations import build_firewall_policy_rule_groups_get_request +from ...operations._operations import build_firewall_policy_rule_groups_list_request +from ...operations._operations import build_virtual_router_peerings_update_request +from ...operations._operations import build_virtual_routers_update_request +from ...operations._operations import build_vpn_server_configurations_update_tags_request +from ...operations._operations import build_active_connectivity_configurations_list_request +from ...operations._operations import build_active_security_admin_rules_list_request +from ...operations._operations import build_active_security_user_rules_list_request +from ...operations._operations import build_admin_rule_collections_delete_request +from ...operations._operations import build_admin_rules_delete_request +from ...operations._operations import build_connectivity_configurations_delete_request +from ...operations._operations import build_effective_connectivity_configurations_list_request +from ...operations._operations import build_effective_virtual_networks_list_by_network_group_request +from ...operations._operations import build_effective_virtual_networks_list_by_network_manager_request +from ...operations._operations import build_network_groups_delete_request +from ...operations._operations import build_network_manager_commits_post_request +from ...operations._operations import build_network_manager_effective_security_admin_rules_list_request +from ...operations._operations import build_network_managers_delete_request +from ...operations._operations import build_network_managers_patch_tags_request +from ...operations._operations import build_network_security_perimeters_create_or_update_request +from ...operations._operations import build_network_security_perimeters_delete_request +from ...operations._operations import build_network_security_perimeters_get_request +from ...operations._operations import build_network_security_perimeters_list_request +from ...operations._operations import build_network_security_perimeters_list_by_subscription_request +from ...operations._operations import build_network_security_perimeters_patch_request +from ...operations._operations import build_nsp_access_rules_create_or_update_request +from ...operations._operations import build_nsp_access_rules_delete_request +from ...operations._operations import build_nsp_access_rules_get_request +from ...operations._operations import build_nsp_access_rules_list_request +from ...operations._operations import build_nsp_access_rules_reconcile_post_request +from ...operations._operations import build_nsp_association_reconcile_post_request +from ...operations._operations import build_nsp_associations_delete_request +from ...operations._operations import build_nsp_associations_create_or_update_request +from ...operations._operations import build_nsp_associations_get_request +from ...operations._operations import build_nsp_associations_list_request +from ...operations._operations import build_nsp_link_references_delete_request +from ...operations._operations import build_nsp_link_references_get_request +from ...operations._operations import build_nsp_link_references_list_request +from ...operations._operations import build_nsp_links_delete_request +from ...operations._operations import build_nsp_links_create_or_update_request +from ...operations._operations import build_nsp_links_get_request +from ...operations._operations import build_nsp_links_list_request +from ...operations._operations import build_nsp_profiles_create_or_update_request +from ...operations._operations import build_nsp_profiles_delete_request +from ...operations._operations import build_nsp_profiles_get_request +from ...operations._operations import build_nsp_profiles_list_request +from ...operations._operations import build_perimeter_associable_resource_types_list_request +from ...operations._operations import build_security_admin_configurations_delete_request +from ...operations._operations import build_security_user_configurations_create_or_update_request +from ...operations._operations import build_security_user_configurations_delete_request +from ...operations._operations import build_security_user_configurations_get_request +from ...operations._operations import build_security_user_configurations_list_request +from ...operations._operations import build_user_rule_collections_create_or_update_request +from ...operations._operations import build_user_rule_collections_delete_request +from ...operations._operations import build_user_rule_collections_get_request +from ...operations._operations import build_user_rule_collections_list_request +from ...operations._operations import build_user_rules_create_or_update_request +from ...operations._operations import build_user_rules_delete_request +from ...operations._operations import build_user_rules_get_request +from ...operations._operations import build_user_rules_list_request +class ApplicationGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`application_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.ApplicationGateway, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationGateway") + + _request = build_application_gateways_create_or_update_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_delete_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_start_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_stop_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.ApplicationGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Is either a ApplicationGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ApplicationGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> _models.ApplicationGateway: + """Gets the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + _request = build_application_gateways_get_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ApplicationGateway"]: + """Lists all application gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ApplicationGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.ApplicationGateway"]: + """Gets all the application gateways in a subscription. + + :return: An iterator like instance of either ApplicationGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _backend_health_initial( + self, resource_group_name: str, application_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.ApplicationGatewayBackendHealth]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ApplicationGatewayBackendHealth]] = kwargs.pop("cls", None) + + _request = build_application_gateways_backend_health_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayBackendHealth", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_gateways_update_tags_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_backend_health( + self, resource_group_name: str, application_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayBackendHealth]: + """Gets the backend health of the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationGatewayBackendHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayBackendHealth] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._backend_health_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + expand=expand, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayBackendHealth", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGatewayBackendHealth].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGatewayBackendHealth]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGateway]: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_ssl_predefined_policy( + self, predefined_policy_name: str, **kwargs: Any + ) -> _models.ApplicationGatewaySslPredefinedPolicy: + """Gets Ssl predefined policy with the specified policy name. + + :param predefined_policy_name: Name of Ssl predefined policy. Required. + :type predefined_policy_name: str + :return: ApplicationGatewaySslPredefinedPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGatewaySslPredefinedPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewaySslPredefinedPolicy] = kwargs.pop("cls", None) + + _request = build_application_gateways_get_ssl_predefined_policy_request( + predefined_policy_name=predefined_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewaySslPredefinedPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_available_ssl_options(self, **kwargs: Any) -> _models.ApplicationGatewayAvailableSslOptions: + """Lists available Ssl options for configuring Ssl policy. + + :return: ApplicationGatewayAvailableSslOptions or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGatewayAvailableSslOptions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayAvailableSslOptions] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_ssl_options_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayAvailableSslOptions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_available_ssl_predefined_policies( + self, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationGatewaySslPredefinedPolicy"]: + """Lists all SSL predefined policies for configuring Ssl policy. + + :return: An iterator like instance of either ApplicationGatewaySslPredefinedPolicy or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationGatewaySslPredefinedPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayAvailableSslPredefinedPolicies] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_available_ssl_predefined_policies_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayAvailableSslPredefinedPolicies", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_available_waf_rule_sets(self, **kwargs: Any) -> _models.ApplicationGatewayAvailableWafRuleSetsResult: + """Lists all available web application firewall rule sets. + + :return: ApplicationGatewayAvailableWafRuleSetsResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayAvailableWafRuleSetsResult] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_waf_rule_sets_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayAvailableWafRuleSetsResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_available_request_headers(self, **kwargs: Any) -> List[str]: + """Lists all available request headers. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_request_headers_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_available_response_headers(self, **kwargs: Any) -> List[str]: + """Lists all available response headers. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_response_headers_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_available_server_variables(self, **kwargs: Any) -> List[str]: + """Lists all available server variables. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_server_variables_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _backend_health_on_demand_initial( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: Union[_models.ApplicationGatewayOnDemandProbe, IO[bytes]], + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.ApplicationGatewayBackendHealthOnDemand]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ApplicationGatewayBackendHealthOnDemand]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(probe_request, (IOBase, bytes)): + _content = probe_request + else: + _json = self._serialize.body(probe_request, "ApplicationGatewayOnDemandProbe") + + _request = build_application_gateways_backend_health_on_demand_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayBackendHealthOnDemand", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: Union[_models.ApplicationGatewayOnDemandProbe, IO[bytes]], + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Is either a + ApplicationGatewayOnDemandProbe type or a IO[bytes] type. Required. + :type probe_request: ~azure.mgmt.network.models.ApplicationGatewayOnDemandProbe or + IO[bytes] + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGatewayBackendHealthOnDemand] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._backend_health_on_demand_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + probe_request=probe_request, + expand=expand, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayBackendHealthOnDemand", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_gateways_update_tags_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteCircuitAuthorizationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_circuit_authorizations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRouteCircuitAuthorization, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitAuthorization: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(authorization_parameters, (IOBase, bytes)): + _content = authorization_parameters + else: + _json = self._serialize.body(authorization_parameters, "ExpressRouteCircuitAuthorization") + + _request = build_express_route_circuit_authorizations_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_authorizations_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRouteCircuitAuthorization, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Is either a ExpressRouteCircuitAuthorization type or a + IO[bytes] type. Required. + :type authorization_parameters: + ~azure.mgmt.network.models.ExpressRouteCircuitAuthorization or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitAuthorization].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitAuthorization]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitAuthorization: + """Gets the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuitAuthorization + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_authorizations_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitAuthorization"]: + """Gets all authorizations in an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitAuthorization or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AuthorizationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_authorizations_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AuthorizationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitPeeringsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_circuit_peerings` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCircuitPeering, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(peering_parameters, (IOBase, bytes)): + _content = peering_parameters + else: + _json = self._serialize.body(peering_parameters, "ExpressRouteCircuitPeering") + + _request = build_express_route_circuit_peerings_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_peerings_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCircuitPeering, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Is either a ExpressRouteCircuitPeering type or a IO[bytes] type. Required. + :type peering_parameters: ~azure.mgmt.network.models.ExpressRouteCircuitPeering or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitPeering: + """Gets the specified peering for the express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuitPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_peerings_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitPeering"]: + """Gets all peerings in a specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitPeering or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_peerings_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_circuits` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.ExpressRouteCircuit, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRouteCircuit") + + _request = build_express_route_circuits_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.ExpressRouteCircuit, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Is either a ExpressRouteCircuit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ExpressRouteCircuit or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> _models.ExpressRouteCircuit: + """Gets information about the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of express route circuit. Required. + :type circuit_name: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteCircuit"]: + """Gets all the express route circuits in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRouteCircuit or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteCircuit"]: + """Gets all the express route circuits in a subscription. + + :return: An iterator like instance of either ExpressRouteCircuit or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2015-06-15'], + ) + @distributed_trace + def list_arp_table( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitArpTable"]: + """The ListArpTable from ExpressRouteCircuit operation retrieves the currently advertised arp + table associated with the ExpressRouteCircuits in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitArpTable or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuitArpTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-06-15")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_arp_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2015-06-15'], + ) + @distributed_trace + def list_routes_table( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitRoutesTable"]: + """The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised + routes table associated with the ExpressRouteCircuits in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitRoutesTable or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuitRoutesTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-06-15")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_routes_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2015-06-15'], + ) + @distributed_trace + def list_stats( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitStats"]: + """The ListStats ExpressRouteCircuit operation retrieves all the stats from a ExpressRouteCircuits + in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the loadBalancer. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitStats or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuitStats] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-06-15")) + cls: ClsType[_models.ExpressRouteCircuitsStatsListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsStatsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _list_arp_table_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsArpTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsArpTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_arp_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_routes_table_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_routes_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_routes_table_summary_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_routes_table_summary_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableSummaryListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_circuits_update_tags_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_arp_table( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]: + """Gets the currently advertised ARP table associated with the express route circuit in a resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_arp_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_routes_table( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]: + """Gets the currently advertised routes table associated with the express route circuit in a + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_routes_table_summary( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]: + """Gets the currently advertised routes table summary associated with the express route circuit in + a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableSummaryListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableSummaryListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuit]: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_peering_stats( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitStats: + """Gets all stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCircuitStats or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuitStats + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitStats] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_peering_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitStats", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_stats( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitStats: + """Gets all the stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: ExpressRouteCircuitStats or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuitStats + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitStats] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitStats", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_circuits_update_tags_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteServiceProvidersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_service_providers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteServiceProvider"]: + """Gets all the available express route service providers. + + :return: An iterator like instance of either ExpressRouteServiceProvider or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteServiceProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteServiceProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_service_providers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteServiceProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LoadBalancer") + + _request = build_load_balancers_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_load_balancers_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. Is + either a LoadBalancer type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.LoadBalancer or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LoadBalancer", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LoadBalancer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LoadBalancer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_load_balancers_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.LoadBalancer"]: + """Gets all the load balancers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.LoadBalancer"]: + """Gets all the load balancers in a subscription. + + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_load_balancers_update_tags_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LoadBalancer]: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LoadBalancer", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LoadBalancer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LoadBalancer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_load_balancers_update_tags_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _swap_public_ip_addresses_initial( # pylint: disable=inconsistent-return-statements + self, location: str, parameters: Union[_models.LoadBalancerVipSwapRequest, IO[bytes]], **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LoadBalancerVipSwapRequest") + + _request = build_load_balancers_swap_public_ip_addresses_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_swap_public_ip_addresses( + self, location: str, parameters: Union[_models.LoadBalancerVipSwapRequest, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Is either a + LoadBalancerVipSwapRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.LoadBalancerVipSwapRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._swap_public_ip_addresses_initial( # type: ignore + location=location, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _list_inbound_nat_rule_port_mappings_initial( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: Union[_models.QueryInboundNatRulePortMappingRequest, IO[bytes]], + **kwargs: Any + ) -> _models.BackendAddressInboundNatRulePortMappings: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressInboundNatRulePortMappings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryInboundNatRulePortMappingRequest") + + _request = build_load_balancers_list_inbound_nat_rule_port_mappings_request( + group_name=group_name, + load_balancer_name=load_balancer_name, + backend_pool_name=backend_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: Union[_models.QueryInboundNatRulePortMappingRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Is either a + QueryInboundNatRulePortMappingRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryInboundNatRulePortMappingRequest + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + BackendAddressInboundNatRulePortMappings or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressInboundNatRulePortMappings] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_inbound_nat_rule_port_mappings_initial( + group_name=group_name, + load_balancer_name=load_balancer_name, + backend_pool_name=backend_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[Union[_models.MigrateLoadBalancerToIpBasedRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Is either a + MigrateLoadBalancerToIpBasedRequest type or a IO[bytes] type. Default value is None. + :type parameters: ~azure.mgmt.network.models.MigrateLoadBalancerToIpBasedRequest or + IO[bytes] + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MigratedPools] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "MigrateLoadBalancerToIpBasedRequest") + else: + _json = None + + _request = build_load_balancers_migrate_to_ip_based_request( + group_name=group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MigratedPools", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LocalNetworkGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`local_network_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.LocalNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LocalNetworkGateway") + + _request = build_local_network_gateways_create_or_update_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_local_network_gateways_delete_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.LocalNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Is either a LocalNetworkGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.LocalNetworkGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LocalNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LocalNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified local network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Gets the specified local network gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + _request = build_local_network_gateways_get_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.LocalNetworkGateway"]: + """Gets all the local network gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either LocalNetworkGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LocalNetworkGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_local_network_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LocalNetworkGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_local_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LocalNetworkGateway]: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LocalNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LocalNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_local_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkInterfacesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_interfaces` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.NetworkInterface, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkInterface") + + _request = build_network_interfaces_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_interfaces_delete_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.NetworkInterface, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. Is + either a NetworkInterface type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkInterface or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterface", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_interface_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkInterface: + """Gets information about the specified network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get_virtual_machine_scale_set_network_interface( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterface: + """Get the specified network interface in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_virtual_machine_scale_set_network_interface_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a subscription. + + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_virtual_machine_scale_set_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_virtual_machine_scale_set_vm_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets information about all network interfaces in a virtual machine in a virtual machine scale + set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _get_effective_route_table_initial( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Optional[_models.EffectiveRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.EffectiveRouteListResult]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_effective_route_table_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_effective_network_security_groups_initial( # pylint: disable=name-too-long + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Optional[_models.EffectiveNetworkSecurityGroupListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.EffectiveNetworkSecurityGroupListResult]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_list_effective_network_security_groups_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveNetworkSecurityGroupListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_interfaces_update_tags_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_effective_route_table( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteListResult]: + """Gets all route tables applied to a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.EffectiveRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.EffectiveRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_effective_route_table_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_effective_network_security_groups( # pylint: disable=name-too-long + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveNetworkSecurityGroupListResult]: + """Gets all network security groups applied to a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns either + EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.EffectiveNetworkSecurityGroupListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.EffectiveNetworkSecurityGroupListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_effective_network_security_groups_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveNetworkSecurityGroupListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveNetworkSecurityGroupListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveNetworkSecurityGroupListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterface", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_virtual_machine_scale_set_ip_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterfaceIPConfiguration: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration. Required. + :type ip_configuration_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterfaceIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterfaceIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceIPConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_virtual_machine_scale_set_ip_configuration_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_virtual_machine_scale_set_ip_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterfaceIPConfiguration"]: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: An iterator like instance of either NetworkInterfaceIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterfaceIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_ip_configurations_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_interfaces_update_tags_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_cloud_service_network_interface( + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterface: + """Get the specified network interface in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_cloud_service_network_interface_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_cloud_service_network_interfaces( + self, resource_group_name: str, cloud_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_cloud_service_network_interfaces_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_cloud_service_role_instance_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, cloud_service_name: str, role_instance_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets information about all network interfaces in a role instance in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_cloud_service_role_instance_network_interfaces_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkSecurityGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_security_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.NetworkSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkSecurityGroup") + + _request = build_network_security_groups_create_or_update_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_security_groups_delete_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.NetworkSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Is either a NetworkSecurityGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkSecurityGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Gets the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + _request = build_network_security_groups_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkSecurityGroup"]: + """Gets all network security groups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_groups_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkSecurityGroup"]: + """Gets all network security groups in a subscription. + + :return: An iterator like instance of either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_groups_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_security_groups_update_tags_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityGroup]: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_security_groups_update_tags_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PublicIPAddressesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`public_ip_addresses` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.PublicIPAddress, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PublicIPAddress") + + _request = build_public_ip_addresses_create_or_update_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_delete_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.PublicIPAddress, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. Is + either a PublicIPAddress type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PublicIPAddress or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIPAddress].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIPAddress]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, public_ip_address_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PublicIPAddress: + """Gets the specified public IP address in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets all public IP addresses in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets all the public IP addresses in a subscription. + + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_addresses_update_tags_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPAddress]: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIPAddress].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIPAddress]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_virtual_machine_scale_set_public_ip_address( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PublicIPAddress: + """Get the specified public IP address in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. Required. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_virtual_machine_scale_set_public_ip_address_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_virtual_machine_scale_set_public_ip_addresses( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses on a virtual machine scale set level. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_virtual_machine_scale_set_public_ip_addresses_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_virtual_machine_scale_set_vm_public_ip_addresses( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses in a virtual machine IP configuration in a + virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The network interface name. Required. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. Required. + :type ip_configuration_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_virtual_machine_scale_set_vm_public_ip_addresses_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_addresses_update_tags_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_cloud_service_public_ip_address( + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PublicIPAddress: + """Get the specified public IP address in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The role instance name. Required. + :type role_instance_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. Required. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_cloud_service_public_ip_address_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_cloud_service_public_ip_addresses( + self, resource_group_name: str, cloud_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses on a cloud service level. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_cloud_service_public_ip_addresses_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_cloud_service_role_instance_public_ip_addresses( # pylint: disable=name-too-long + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses in a role instance IP configuration in a cloud + service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :param network_interface_name: The network interface name. Required. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. Required. + :type ip_configuration_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_cloud_service_role_instance_public_ip_addresses_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _ddos_protection_status_initial( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> Optional[_models.PublicIpDdosProtectionStatusResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.PublicIpDdosProtectionStatusResult]] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_ddos_protection_status_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("PublicIpDdosProtectionStatusResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_ddos_protection_status( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIpDdosProtectionStatusResult]: + """Gets the Ddos Protection Status of a Public IP Address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :return: An instance of AsyncLROPoller that returns either PublicIpDdosProtectionStatusResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PublicIpDdosProtectionStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIpDdosProtectionStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._ddos_protection_status_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIpDdosProtectionStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIpDdosProtectionStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIpDdosProtectionStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class RouteTablesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`route_tables` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.RouteTable, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "RouteTable") + + _request = build_route_tables_create_or_update_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteTable", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_tables_delete_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.RouteTable, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Is either + a RouteTable type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.RouteTable or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_table_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_table_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.RouteTable: + """Gets the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + _request = build_route_tables_get_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.RouteTable"]: + """Gets all route tables in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either RouteTable or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_tables_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RouteTable"]: + """Gets all route tables in a subscription. + + :return: An iterator like instance of either RouteTable or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_tables_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_tables_update_tags_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteTable]: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_tables_update_tags_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RoutesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`routes` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: Union[_models.Route, IO[bytes]], + **kwargs: Any + ) -> _models.Route: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_parameters, (IOBase, bytes)): + _content = route_parameters + else: + _json = self._serialize.body(route_parameters, "Route") + + _request = build_routes_create_or_update_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Route", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Route", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_delete_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: Union[_models.Route, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Is either + a Route type or a IO[bytes] type. Required. + :type route_parameters: ~azure.mgmt.network.models.Route or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + route_parameters=route_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Route", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Route].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Route]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified route from a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> _models.Route: + """Gets the specified route from a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :return: Route or the result of cls(response) + :rtype: ~azure.mgmt.network.models.Route + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + + _request = build_routes_get_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Route", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, route_table_name: str, **kwargs: Any) -> AsyncIterable["_models.Route"]: + """Gets all routes in a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :return: An iterator like instance of either Route or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_routes_list_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`security_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: Union[_models.SecurityRule, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_rule_parameters, (IOBase, bytes)): + _content = security_rule_parameters + else: + _json = self._serialize.body(security_rule_parameters, "SecurityRule") + + _request = build_security_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_rules_delete_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: Union[_models.SecurityRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Is either a SecurityRule type or a IO[bytes] type. Required. + :type security_rule_parameters: ~azure.mgmt.network.models.SecurityRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + security_rule_parameters=security_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> _models.SecurityRule: + """Get the specified network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :return: SecurityRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + _request = build_security_rules_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityRule"]: + """Gets all security rules in a network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An iterator like instance of either SecurityRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_rules_list_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SubnetsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`subnets` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: Union[_models.Subnet, IO[bytes]], + **kwargs: Any + ) -> _models.Subnet: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(subnet_parameters, (IOBase, bytes)): + _content = subnet_parameters + else: + _json = self._serialize.body(subnet_parameters, "Subnet") + + _request = build_subnets_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Subnet", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Subnet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_subnets_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: Union[_models.Subnet, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. Is + either a Subnet type or a IO[bytes] type. Required. + :type subnet_parameters: ~azure.mgmt.network.models.Subnet or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Subnet or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subnet_parameters=subnet_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Subnet", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Subnet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Subnet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Subnet: + """Gets the specified subnet by virtual network and resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: Subnet or the result of cls(response) + :rtype: ~azure.mgmt.network.models.Subnet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + + _request = build_subnets_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Subnet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Subnet"]: + """Gets all subnets in a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either Subnet or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SubnetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subnets_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SubnetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _prepare_network_policies_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: Union[_models.PrepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(prepare_network_policies_request_parameters, (IOBase, bytes)): + _content = prepare_network_policies_request_parameters + else: + _json = self._serialize.body(prepare_network_policies_request_parameters, "PrepareNetworkPoliciesRequest") + + _request = build_subnets_prepare_network_policies_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: Union[_models.PrepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Is either a PrepareNetworkPoliciesRequest type or a IO[bytes] + type. Required. + :type prepare_network_policies_request_parameters: + ~azure.mgmt.network.models.PrepareNetworkPoliciesRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._prepare_network_policies_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + prepare_network_policies_request_parameters=prepare_network_policies_request_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _unprepare_network_policies_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: Union[_models.UnprepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(unprepare_network_policies_request_parameters, (IOBase, bytes)): + _content = unprepare_network_policies_request_parameters + else: + _json = self._serialize.body( + unprepare_network_policies_request_parameters, "UnprepareNetworkPoliciesRequest" + ) + + _request = build_subnets_unprepare_network_policies_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: Union[_models.UnprepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Is either a UnprepareNetworkPoliciesRequest type or a + IO[bytes] type. Required. + :type unprepare_network_policies_request_parameters: + ~azure.mgmt.network.models.UnprepareNetworkPoliciesRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._unprepare_network_policies_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + unprepare_network_policies_request_parameters=unprepare_network_policies_request_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class UsagesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`usages` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: + """List network usages for a subscription. + + :param location: The location where resource usage is queried. Required. + :type location: str + :return: An iterator like instance of either Usage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.Usage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_usages_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("UsagesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworkGatewayConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_network_gateway_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VirtualNetworkGatewayConnection, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGatewayConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkGatewayConnection") + + _request = build_virtual_network_gateway_connections_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _reset_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionResetSharedKey, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ConnectionResetSharedKey]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConnectionResetSharedKey]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionResetSharedKey") + + _request = build_virtual_network_gateway_connections_reset_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ConnectionResetSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _set_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionSharedKey, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectionSharedKey: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionSharedKey") + + _request = build_virtual_network_gateway_connections_set_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VirtualNetworkGatewayConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Is either a VirtualNetworkGatewayConnection type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.models.VirtualNetworkGatewayConnection or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network Gateway connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionResetSharedKey, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Is either a ConnectionResetSharedKey + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ConnectionResetSharedKey or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionResetSharedKey] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionResetSharedKey", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionResetSharedKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionResetSharedKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionSharedKey, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Is either a ConnectionSharedKey type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ConnectionSharedKey or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionSharedKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionSharedKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGatewayConnection: + """Gets the specified virtual network gateway connection by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :return: VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetworkGatewayConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get_shared_key( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> _models.ConnectionSharedKey: + """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the + specified virtual network gateway connection shared key through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection shared + key name. Required. + :type virtual_network_gateway_connection_name: str + :return: ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ConnectionSharedKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualNetworkGatewayConnection"]: + """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways + connections created. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkGatewayConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGatewayConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateway_connections_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGatewayConnection]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkGatewayConnection]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_network_gateway_connections_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnPacketCaptureStartParameters") + else: + _json = None + + _request = build_virtual_network_gateway_connections_start_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnPacketCaptureStopParameters") + + _request = build_virtual_network_gateway_connections_stop_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Is either a VpnPacketCaptureStartParameters type or a IO[bytes] + type. Default value is None. + :type parameters: ~azure.mgmt.network.models.VpnPacketCaptureStartParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Is either a VpnPacketCaptureStopParameters type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.network.models.VpnPacketCaptureStopParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _get_ike_sas_initial( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_ike_sas_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_ike_sas( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[str]: + """Lists IKE Security Associations for the virtual network gateway connection in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_ike_sas_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _reset_connection_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_reset_connection_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_reset_connection( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Resets the virtual network gateway connection specified. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_connection_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualNetworkGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_network_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VirtualNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkGateway") + + _request = build_virtual_network_gateways_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _generatevpnclientpackage_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnClientParameters") + + _request = build_virtual_network_gateways_generatevpnclientpackage_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _reset_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.VirtualNetworkGateway]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_reset_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + gateway_vip=gateway_vip, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VirtualNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Is either a VirtualNetworkGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualNetworkGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Is either a VpnClientParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VpnClientParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generatevpnclientpackage_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + params_valid_on={ + "parameters": ['2015-06-15'], + "gateway_vip": ['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def begin_reset( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Resets the primary of the virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword gateway_vip: Virtual network gateway vip address supplied to the begin reset of the + active-active feature enabled gateway. Default value is None. + :paramtype gateway_vip: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + gateway_vip=gateway_vip, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGateway: + """Gets the specified virtual network gateway by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualNetworkGateway"]: + """Gets all virtual network gateways by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _generate_vpn_profile_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnClientParameters") + + _request = build_virtual_network_gateways_generate_vpn_profile_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_advertised_routes_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: str, **kwargs: Any + ) -> Optional[_models.GatewayRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.GatewayRouteListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_advertised_routes_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + peer=peer, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_bgp_peer_status_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.BgpPeerStatusListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.BgpPeerStatusListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_bgp_peer_status_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + peer=peer, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BgpPeerStatusListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_learned_routes_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[_models.GatewayRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.GatewayRouteListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_learned_routes_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_vpn_profile_package_url_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpn_profile_package_url_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Is either a VpnClientParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VpnClientParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_advertised_routes( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: str, **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteListResult]: + """This operation retrieves a list of routes the virtual network gateway is advertising to the + specified peer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword peer: The IP address of the peer. Required. + :paramtype peer: str + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.GatewayRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_advertised_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_bgp_peer_status( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: Optional[str] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.BgpPeerStatusListResult]: + """The GetBgpPeerStatus operation retrieves the status of all BGP peers. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword peer: The IP address of the peer to retrieve the status of. Default value is None. + :paramtype peer: str + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.BgpPeerStatusListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BgpPeerStatusListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_bgp_peer_status_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BgpPeerStatusListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BgpPeerStatusListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BgpPeerStatusListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_learned_routes( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteListResult]: + """This operation retrieves a list of routes the virtual network gateway has learned, including + routes learned from BGP peers. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.GatewayRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_learned_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_vpn_profile_package_url( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[str]: + """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified + resource group. The profile needs to be generated first using generateVpnProfile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vpn_profile_package_url_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_connections( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListEntity"]: + """Gets all the connections in a virtual network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An iterator like instance of either VirtualNetworkGatewayConnectionListEntity or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkGatewayConnectionListEntity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGatewayListConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateways_list_connections_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayListConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def supported_vpn_devices( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> str: + """Gets a xml format representation for supported vpn devices. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_supported_vpn_devices_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnDeviceScriptParameters, IO[bytes]], + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Is either a + VpnDeviceScriptParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VpnDeviceScriptParameters or IO[bytes] + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnDeviceScriptParameters") + + _request = build_virtual_network_gateways_vpn_device_configuration_script_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_vpnclient_ipsec_parameters_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> _models.VpnClientIPsecParameters: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpnclient_ipsec_parameters_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _set_vpnclient_ipsec_parameters_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: Union[_models.VpnClientIPsecParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnClientIPsecParameters]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnClientIPsecParameters]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpnclient_ipsec_params, (IOBase, bytes)): + _content = vpnclient_ipsec_params + else: + _json = self._serialize.body(vpnclient_ipsec_params, "VpnClientIPsecParameters") + + _request = build_virtual_network_gateways_set_vpnclient_ipsec_parameters_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_vpnclient_ipsec_parameters( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientIPsecParameters]: + """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec + policy for P2S client of virtual network gateway in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The virtual network gateway name. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnClientIPsecParameters].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnClientIPsecParameters]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: Union[_models.VpnClientIPsecParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Is either a + VpnClientIPsecParameters type or a IO[bytes] type. Required. + :type vpnclient_ipsec_params: ~azure.mgmt.network.models.VpnClientIPsecParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + vpnclient_ipsec_params=vpnclient_ipsec_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnClientIPsecParameters].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnClientIPsecParameters]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _reset_vpn_client_shared_key_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_reset_vpn_client_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_reset_vpn_client_shared_key( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Resets the VPN client shared key of the virtual network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_vpn_client_shared_key_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _get_vpnclient_connection_health_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[_models.VpnClientConnectionHealthDetailListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.VpnClientConnectionHealthDetailListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpnclient_connection_health_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnClientConnectionHealthDetailListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_vpnclient_connection_health( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientConnectionHealthDetailListResult]: + """Get VPN client connection health detail per P2S client connection of the virtual network + gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either + VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnClientConnectionHealthDetailListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnClientConnectionHealthDetailListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vpnclient_connection_health_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientConnectionHealthDetailListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnClientConnectionHealthDetailListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnClientConnectionHealthDetailListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnPacketCaptureStartParameters") + else: + _json = None + + _request = build_virtual_network_gateways_start_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnPacketCaptureStopParameters") + + _request = build_virtual_network_gateways_stop_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Is either a VpnPacketCaptureStartParameters type or a IO[bytes] type. + Default value is None. + :type parameters: ~azure.mgmt.network.models.VpnPacketCaptureStartParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Is either a VpnPacketCaptureStopParameters type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.models.VpnPacketCaptureStopParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _disconnect_virtual_network_gateway_vpn_connections_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionRequest") + + _request = build_virtual_network_gateways_disconnect_virtual_network_gateway_vpn_connections_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Is either a + P2SVpnConnectionRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.models.P2SVpnConnectionRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disconnect_virtual_network_gateway_vpn_connections_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualNetworksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_networks` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.VirtualNetwork, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetwork") + + _request = build_virtual_networks_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_networks_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.VirtualNetwork, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. Is + either a VirtualNetwork type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualNetwork or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.VirtualNetwork: + """Gets the specified virtual network by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + _request = build_virtual_networks_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualNetwork"]: + """Gets all virtual networks in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetwork or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualNetwork"]: + """Gets all virtual networks in a subscription. + + :return: An iterator like instance of either VirtualNetwork or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_networks_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetwork]: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def check_ip_address_availability( + self, resource_group_name: str, virtual_network_name: str, *, ip_address: str, **kwargs: Any + ) -> _models.IPAddressAvailabilityResult: + """Checks whether a private IP address is available for use. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword ip_address: The private IP address to be verified. Required. + :paramtype ip_address: str + :return: IPAddressAvailabilityResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.IPAddressAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IPAddressAvailabilityResult] = kwargs.pop("cls", None) + + _request = build_virtual_networks_check_ip_address_availability_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + ip_address=ip_address, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IPAddressAvailabilityResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_usage( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkUsage"]: + """Lists usage stats. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either VirtualNetworkUsage or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkListUsageResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_usage_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListUsageResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_networks_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-05-01'], + ) + @distributed_trace_async + async def get_bastion_hosts( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> _models.BastionHostListResult: + """Get a list of bastion hosts accessible from the given network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: BastionHostListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BastionHostListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + _request = build_virtual_networks_get_bastion_hosts_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_ddos_protection_status_initial( + self, + resource_group_name: str, + virtual_network_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.VirtualNetworkDdosProtectionStatusResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.VirtualNetworkDdosProtectionStatusResult]] = kwargs.pop("cls", None) + + _request = build_virtual_networks_list_ddos_protection_status_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkDdosProtectionStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_ddos_protection_status( + self, + resource_group_name: str, + virtual_network_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.PublicIpDdosProtectionStatusResult"]]: + """Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword top: The max number of ip addresses to return. Default value is None. + :paramtype top: int + :keyword skip_token: The skipToken that is given with nextLink. Default value is None. + :paramtype skip_token: str + :return: An instance of LROPoller that returns an iterator like instance of either + VirtualNetworkDdosProtectionStatusResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIpDdosProtectionStatusResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkDdosProtectionStatusResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_ddos_protection_status_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkDdosProtectionStatusResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_ddos_protection_status_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + top=top, + skip_token=skip_token, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[AsyncIterable["_models.PublicIpDdosProtectionStatusResult"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncIterable["_models.PublicIpDdosProtectionStatusResult"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ApplicationSecurityGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`application_security_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.ApplicationSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationSecurityGroup") + + _request = build_application_security_groups_create_or_update_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_security_groups_delete_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.ApplicationSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Is either a ApplicationSecurityGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ApplicationSecurityGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Gets information about the specified application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + _request = build_application_security_groups_get_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ApplicationSecurityGroup"]: + """Gets all the application security groups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_security_groups_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.ApplicationSecurityGroup"]: + """Gets all application security groups in a subscription. + + :return: An iterator like instance of either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_security_groups_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_security_groups_update_tags_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationSecurityGroup]: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_security_groups_update_tags_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AvailableEndpointServicesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`available_endpoint_services` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.EndpointServiceResult"]: + """List what values of endpoint services are available for use. + + :param location: The location to check available endpoint services. Required. + :type location: str + :return: An iterator like instance of either EndpointServiceResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.EndpointServiceResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.EndpointServicesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_endpoint_services_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("EndpointServicesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class BgpServiceCommunitiesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`bgp_service_communities` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.BgpServiceCommunity"]: + """Gets all the available bgp service communities. + + :return: An iterator like instance of either BgpServiceCommunity or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BgpServiceCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BgpServiceCommunityListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bgp_service_communities_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BgpServiceCommunityListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ConnectionMonitorsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`connection_monitors` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.ConnectionMonitor, IO[bytes]], + *, + migrate: Optional[str] = None, + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionMonitor") + + _request = build_connection_monitors_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + migrate=migrate, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _query_initial( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> _models.ConnectionMonitorQueryResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectionMonitorQueryResult] = kwargs.pop("cls", None) + + _request = build_connection_monitors_query_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_start_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_stop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + params_valid_on={ + "migrate": ['2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.ConnectionMonitor, IO[bytes]], + *, + migrate: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. Is + either a ConnectionMonitor type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ConnectionMonitor or IO[bytes] + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + parameters=parameters, + migrate=migrate, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionMonitorResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionMonitorResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_query( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionMonitorQueryResult]: + """Query a snapshot of the most recent connection states. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name given to the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ConnectionMonitorQueryResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectionMonitorQueryResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._query_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionMonitorQueryResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionMonitorQueryResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Gets a connection monitor by name. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + _request = build_connection_monitors_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConnectionMonitorResult"]: + """Lists all connection monitors for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either ConnectionMonitorResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectionMonitorListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connection_monitors_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_connection_monitors_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DefaultSecurityRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`default_security_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_group_name: str, default_security_rule_name: str, **kwargs: Any + ) -> _models.SecurityRule: + """Get the specified default network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param default_security_rule_name: The name of the default security rule. Required. + :type default_security_rule_name: str + :return: SecurityRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + _request = build_default_security_rules_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + default_security_rule_name=default_security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityRule"]: + """Gets all default security rules in a network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An iterator like instance of either SecurityRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_default_security_rules_list_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class InboundNatRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`inbound_nat_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: Union[_models.InboundNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.InboundNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(inbound_nat_rule_parameters, (IOBase, bytes)): + _content = inbound_nat_rule_parameters + else: + _json = self._serialize.body(inbound_nat_rule_parameters, "InboundNatRule") + + _request = build_inbound_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_inbound_nat_rules_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: Union[_models.InboundNatRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Is either a InboundNatRule type or a IO[bytes] type. Required. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.models.InboundNatRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + inbound_nat_rule_parameters=inbound_nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InboundNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InboundNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InboundNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.InboundNatRule: + """Gets the specified load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: InboundNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.InboundNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + + _request = build_inbound_nat_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.InboundNatRule"]: + """Gets all the inbound NAT rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either InboundNatRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.InboundNatRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_inbound_nat_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("InboundNatRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancerBackendAddressPoolsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancer_backend_address_pools` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> _models.BackendAddressPool: + """Gets load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :return: BackendAddressPool or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BackendAddressPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + + _request = build_load_balancer_backend_address_pools_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BackendAddressPool"]: + """Gets all the load balancer backed address pools. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either BackendAddressPool or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerBackendAddressPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_backend_address_pools_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerBackendAddressPoolListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: Union[_models.BackendAddressPool, IO[bytes]], + **kwargs: Any + ) -> _models.BackendAddressPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BackendAddressPool") + + _request = build_load_balancer_backend_address_pools_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_load_balancer_backend_address_pools_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: Union[_models.BackendAddressPool, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Is either a BackendAddressPool type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.BackendAddressPool or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BackendAddressPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BackendAddressPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class LoadBalancerFrontendIPConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancer_frontend_ip_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs: Any + ) -> _models.FrontendIPConfiguration: + """Gets load balancer frontend IP configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param frontend_ip_configuration_name: The name of the frontend IP configuration. Required. + :type frontend_ip_configuration_name: str + :return: FrontendIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FrontendIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FrontendIPConfiguration] = kwargs.pop("cls", None) + + _request = build_load_balancer_frontend_ip_configurations_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + frontend_ip_configuration_name=frontend_ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FrontendIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FrontendIPConfiguration"]: + """Gets all the load balancer frontend IP configurations. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either FrontendIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.FrontendIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerFrontendIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_frontend_ip_configurations_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerFrontendIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancerLoadBalancingRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancer_load_balancing_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, load_balancing_rule_name: str, **kwargs: Any + ) -> _models.LoadBalancingRule: + """Gets the specified load balancer load balancing rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param load_balancing_rule_name: The name of the load balancing rule. Required. + :type load_balancing_rule_name: str + :return: LoadBalancingRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.LoadBalancingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancingRule] = kwargs.pop("cls", None) + + _request = build_load_balancer_load_balancing_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + load_balancing_rule_name=load_balancing_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancingRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.LoadBalancingRule"]: + """Gets all the load balancing rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either LoadBalancingRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.LoadBalancingRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerLoadBalancingRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_load_balancing_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerLoadBalancingRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancerNetworkInterfacesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancer_network_interfaces` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets associated load balancer network interfaces. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_network_interfaces_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancerProbesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancer_probes` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, probe_name: str, **kwargs: Any + ) -> _models.Probe: + """Gets load balancer probe. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param probe_name: The name of the probe. Required. + :type probe_name: str + :return: Probe or the result of cls(response) + :rtype: ~azure.mgmt.network.models.Probe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.Probe] = kwargs.pop("cls", None) + + _request = build_load_balancer_probes_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + probe_name=probe_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Probe", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, load_balancer_name: str, **kwargs: Any) -> AsyncIterable["_models.Probe"]: + """Gets all the load balancer probes. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either Probe or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.Probe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerProbeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_probes_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerProbeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkInterfaceIPConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_interface_ip_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, network_interface_name: str, ip_configuration_name: str, **kwargs: Any + ) -> _models.NetworkInterfaceIPConfiguration: + """Gets the specified network interface ip configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration name. Required. + :type ip_configuration_name: str + :return: NetworkInterfaceIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterfaceIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceIPConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interface_ip_configurations_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterfaceIPConfiguration"]: + """Get all ip configurations in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either NetworkInterfaceIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterfaceIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_ip_configurations_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkInterfaceLoadBalancersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_interface_load_balancers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterable["_models.LoadBalancer"]: + """List all load balancers in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceLoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_load_balancers_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceLoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkWatchersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_watchers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _check_connectivity_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.ConnectivityParameters, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectivityInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectivityParameters") + + _request = build_network_watchers_check_connectivity_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_watchers_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _get_azure_reachability_report_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AzureReachabilityReportParameters, IO[bytes]], + **kwargs: Any + ) -> _models.AzureReachabilityReport: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureReachabilityReport] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AzureReachabilityReportParameters") + + _request = build_network_watchers_get_azure_reachability_report_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_flow_log_status_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogStatusParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLogInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLogStatusParameters") + + _request = build_network_watchers_get_flow_log_status_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_next_hop_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NextHopParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NextHopResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NextHopResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NextHopParameters") + + _request = build_network_watchers_get_next_hop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NextHopResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("NextHopResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_troubleshooting_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> _models.TroubleshootingResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TroubleshootingParameters") + + _request = build_network_watchers_get_troubleshooting_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_troubleshooting_result_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.QueryTroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> _models.TroubleshootingResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryTroubleshootingParameters") + + _request = build_network_watchers_get_troubleshooting_result_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_vm_security_rules_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.SecurityGroupViewParameters, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityGroupViewResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityGroupViewResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SecurityGroupViewParameters") + + _request = build_network_watchers_get_vm_security_rules_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_available_providers_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AvailableProvidersListParameters, IO[bytes]], + **kwargs: Any + ) -> _models.AvailableProvidersList: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AvailableProvidersList] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AvailableProvidersListParameters") + + _request = build_network_watchers_list_available_providers_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _set_flow_log_configuration_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogInformation, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLogInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLogInformation") + + _request = build_network_watchers_set_flow_log_configuration_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _verify_ip_flow_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.VerificationIPFlowParameters, IO[bytes]], + **kwargs: Any + ) -> _models.VerificationIPFlowResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VerificationIPFlowResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VerificationIPFlowParameters") + + _request = build_network_watchers_verify_ip_flow_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.ConnectivityParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. Is + either a ConnectivityParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ConnectivityParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._check_connectivity_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectivityInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectivityInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network watcher resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AzureReachabilityReportParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Is either + a AzureReachabilityReportParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.AzureReachabilityReportParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureReachabilityReport] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_azure_reachability_report_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AzureReachabilityReport].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AzureReachabilityReport]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogStatusParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Is either a FlowLogStatusParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FlowLogStatusParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_flow_log_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowLogInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowLogInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NextHopParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Is either a + NextHopParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NextHopParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NextHopResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_next_hop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NextHopResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NextHopResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NextHopResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Is either a + TroubleshootingParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TroubleshootingParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_troubleshooting_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TroubleshootingResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TroubleshootingResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.QueryTroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. Is + either a QueryTroubleshootingParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryTroubleshootingParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_troubleshooting_result_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TroubleshootingResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TroubleshootingResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.SecurityGroupViewParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Is either a + SecurityGroupViewParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.SecurityGroupViewParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityGroupViewResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vm_security_rules_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityGroupViewResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityGroupViewResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AvailableProvidersListParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Is either a + AvailableProvidersListParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.AvailableProvidersListParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AvailableProvidersList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_available_providers_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AvailableProvidersList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AvailableProvidersList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogInformation, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Is either a + FlowLogInformation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FlowLogInformation or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_flow_log_configuration_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowLogInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowLogInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.VerificationIPFlowParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Is either a + VerificationIPFlowParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VerificationIPFlowParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VerificationIPFlowResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._verify_ip_flow_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VerificationIPFlowResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VerificationIPFlowResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkWatcher, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Is either a + NetworkWatcher type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkWatcher or IO[bytes] + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkWatcher") + + _request = build_network_watchers_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get(self, resource_group_name: str, network_watcher_name: str, **kwargs: Any) -> _models.NetworkWatcher: + """Gets the specified network watcher by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + _request = build_network_watchers_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TopologyParameters, IO[bytes]], + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Is either a + TopologyParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TopologyParameters or IO[bytes] + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Topology] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TopologyParameters") + + _request = build_network_watchers_get_topology_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Topology", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkWatcher"]: + """Gets all network watchers by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkWatcher or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkWatcher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkWatcherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_watchers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkWatcherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkWatcher"]: + """Gets all network watchers by subscription. + + :return: An iterator like instance of either NetworkWatcher or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkWatcher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkWatcherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_watchers_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkWatcherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_watchers_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_network_configuration_diagnostic_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkConfigurationDiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkConfigurationDiagnosticResponse: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConfigurationDiagnosticResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkConfigurationDiagnosticParameters") + + _request = build_network_watchers_get_network_configuration_diagnostic_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkConfigurationDiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Is either a + NetworkConfigurationDiagnosticParameters type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.models.NetworkConfigurationDiagnosticParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConfigurationDiagnosticResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_network_configuration_diagnostic_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class Operations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`operations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + """Lists all of the available Network Rest API operations. + + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PacketCapturesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`packet_captures` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: Union[_models.PacketCapture, IO[bytes]], + **kwargs: Any + ) -> _models.PacketCaptureResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PacketCapture") + + _request = build_packet_captures_create_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_packet_captures_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _get_status_initial( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> _models.PacketCaptureQueryStatusResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PacketCaptureQueryStatusResult] = kwargs.pop("cls", None) + + _request = build_packet_captures_get_status_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_packet_captures_stop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: Union[_models.PacketCapture, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Is either a + PacketCapture type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PacketCapture or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PacketCaptureResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PacketCaptureResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_get_status( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.PacketCaptureQueryStatusResult]: + """Query the status of a running packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param packet_capture_name: The name given to the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PacketCaptureQueryStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PacketCaptureQueryStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PacketCaptureQueryStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PacketCaptureQueryStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops a specified packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> _models.PacketCaptureResult: + """Gets a packet capture session by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: PacketCaptureResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PacketCaptureResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + + _request = build_packet_captures_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PacketCaptureResult"]: + """Lists all packet capture sessions within the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either PacketCaptureResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PacketCaptureListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_packet_captures_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PacketCaptureListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RouteFilterRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`route_filter_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.RouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilterRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_rule_parameters, (IOBase, bytes)): + _content = route_filter_rule_parameters + else: + _json = self._serialize.body(route_filter_rule_parameters, "RouteFilterRule") + + _request = build_route_filter_rules_create_or_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_filter_rules_delete_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_initial( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.PatchRouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilterRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_rule_parameters, (IOBase, bytes)): + _content = route_filter_rule_parameters + else: + _json = self._serialize.body(route_filter_rule_parameters, "PatchRouteFilterRule") + + _request = build_route_filter_rules_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.RouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Is either a RouteFilterRule type or a IO[bytes] type. Required. + :type route_filter_rule_parameters: ~azure.mgmt.network.models.RouteFilterRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteFilterRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteFilterRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.PatchRouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilterRule]: + """Updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the update route filter rule + operation. Is either a PatchRouteFilterRule type or a IO[bytes] type. Required. + :type route_filter_rule_parameters: ~azure.mgmt.network.models.PatchRouteFilterRule + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteFilterRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteFilterRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> _models.RouteFilterRule: + """Gets the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: RouteFilterRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RouteFilterRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + _request = build_route_filter_rules_get_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_route_filter( + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> AsyncIterable["_models.RouteFilterRule"]: + """Gets all RouteFilterRules in a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :return: An iterator like instance of either RouteFilterRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteFilterRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filter_rules_list_by_route_filter_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RouteFiltersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`route_filters` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.RouteFilter, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_parameters, (IOBase, bytes)): + _content = route_filter_parameters + else: + _json = self._serialize.body(route_filter_parameters, "RouteFilter") + + _request = build_route_filters_create_or_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_filters_delete_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_initial( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.PatchRouteFilter, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_parameters, (IOBase, bytes)): + _content = route_filter_parameters + else: + _json = self._serialize.body(route_filter_parameters, "PatchRouteFilter") + + _request = build_route_filters_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.RouteFilter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Is either a RouteFilter type or a IO[bytes] type. Required. + :type route_filter_parameters: ~azure.mgmt.network.models.RouteFilter or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteFilter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteFilter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.PatchRouteFilter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilter]: + """Updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the update route filter operation. Is + either a PatchRouteFilter type or a IO[bytes] type. Required. + :type route_filter_parameters: ~azure.mgmt.network.models.PatchRouteFilter or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteFilter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteFilter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_filter_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.RouteFilter: + """Gets the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :keyword expand: Expands referenced express route bgp peering resources. Default value is None. + :paramtype expand: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + _request = build_route_filters_get_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.RouteFilter"]: + """Gets all route filters in a subscription. + + :return: An iterator like instance of either RouteFilter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteFilterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filters_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.RouteFilter"]: + """Gets all route filters in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either RouteFilter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteFilterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_filters_update_tags_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualNetworkPeeringsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_network_peerings` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: Union[_models.VirtualNetworkPeering, IO[bytes]], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any + ) -> _models.VirtualNetworkPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_network_peering_parameters, (IOBase, bytes)): + _content = virtual_network_peering_parameters + else: + _json = self._serialize.body(virtual_network_peering_parameters, "VirtualNetworkPeering") + + _request = build_virtual_network_peerings_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + sync_remote_address_space=sync_remote_address_space, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_peerings_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + params_valid_on={ + "sync_remote_address_space": ['2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: Union[_models.VirtualNetworkPeering, IO[bytes]], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Is either a VirtualNetworkPeering type or a IO[bytes] type. + Required. + :type virtual_network_peering_parameters: + ~azure.mgmt.network.models.VirtualNetworkPeering or IO[bytes] + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.models.SyncRemoteAddressSpace + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + virtual_network_peering_parameters=virtual_network_peering_parameters, + sync_remote_address_space=sync_remote_address_space, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. Required. + :type virtual_network_peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> _models.VirtualNetworkPeering: + """Gets the specified virtual network peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. Required. + :type virtual_network_peering_name: str + :return: VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetworkPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + + _request = build_virtual_network_peerings_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkPeering"]: + """Gets all virtual network peerings in a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either VirtualNetworkPeering or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_peerings_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AzureFirewallsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`azure_firewalls` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.AzureFirewall, IO[bytes]], + **kwargs: Any + ) -> _models.AzureFirewall: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AzureFirewall") + + _request = build_azure_firewalls_create_or_update_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_delete_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.AzureFirewall, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. Is + either a AzureFirewall type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.AzureFirewall or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureFirewall", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AzureFirewall].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AzureFirewall]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get(self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any) -> _models.AzureFirewall: + """Gets the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :return: AzureFirewall or the result of cls(response) + :rtype: ~azure.mgmt.network.models.AzureFirewall + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_get_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.AzureFirewall"]: + """Lists all Azure Firewalls in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AzureFirewall or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AzureFirewallListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewalls_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.AzureFirewall"]: + """Gets all the Azure Firewalls in a subscription. + + :return: An iterator like instance of either AzureFirewall or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AzureFirewallListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewalls_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2019-11-01', '2019-12-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.AzureFirewall: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: AzureFirewall or the result of cls(response) + :rtype: ~azure.mgmt.network.models.AzureFirewall + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_azure_firewalls_update_tags_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.AzureFirewall]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AzureFirewall]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_azure_firewalls_update_tags_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureFirewall", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AzureFirewall].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AzureFirewall]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _list_learned_prefixes_initial( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> Optional[_models.IPPrefixesList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.IPPrefixesList]] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_list_learned_prefixes_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("IPPrefixesList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _packet_capture_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.FirewallPacketCaptureParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPacketCaptureParameters") + + _request = build_azure_firewalls_packet_capture_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_learned_prefixes( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.IPPrefixesList]: + """Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the azure firewall. Required. + :type azure_firewall_name: str + :return: An instance of AsyncLROPoller that returns either IPPrefixesList or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.IPPrefixesList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IPPrefixesList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_learned_prefixes_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IPPrefixesList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IPPrefixesList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IPPrefixesList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.FirewallPacketCaptureParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Is either a + FirewallPacketCaptureParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FirewallPacketCaptureParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._packet_capture_initial( # type: ignore + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class DdosProtectionPlansOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`ddos_protection_plans` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.DdosProtectionPlan, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DdosProtectionPlan") + + _request = build_ddos_protection_plans_create_or_update_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ddos_protection_plans_delete_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.DdosProtectionPlan, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Is either a + DdosProtectionPlan type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.DdosProtectionPlan or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DdosProtectionPlan].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DdosProtectionPlan]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Gets information about the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + _request = build_ddos_protection_plans_get_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.DdosProtectionPlan"]: + """Gets all DDoS protection plans in a subscription. + + :return: An iterator like instance of either DdosProtectionPlan or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DdosProtectionPlanListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ddos_protection_plans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlanListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.DdosProtectionPlan"]: + """Gets all the DDoS protection plans in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either DdosProtectionPlan or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DdosProtectionPlanListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ddos_protection_plans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlanListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_protection_plans_update_tags_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosProtectionPlan]: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DdosProtectionPlan].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DdosProtectionPlan]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_protection_plans_update_tags_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteCircuitConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_circuit_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: Union[_models.ExpressRouteCircuitConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(express_route_circuit_connection_parameters, (IOBase, bytes)): + _content = express_route_circuit_connection_parameters + else: + _json = self._serialize.body(express_route_circuit_connection_parameters, "ExpressRouteCircuitConnection") + + _request = build_express_route_circuit_connections_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_connections_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: Union[_models.ExpressRouteCircuitConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Is either a ExpressRouteCircuitConnection type or a + IO[bytes] type. Required. + :type express_route_circuit_connection_parameters: + ~azure.mgmt.network.models.ExpressRouteCircuitConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + express_route_circuit_connection_parameters=express_route_circuit_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitConnection: + """Gets the specified Express Route Circuit Connection from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :return: ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCircuitConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_connections_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitConnection"]: + """Gets all global reach connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An iterator like instance of either ExpressRouteCircuitConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_connections_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCrossConnectionPeeringsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_cross_connection_peerings` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCrossConnectionPeering, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnectionPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(peering_parameters, (IOBase, bytes)): + _content = peering_parameters + else: + _json = self._serialize.body(peering_parameters, "ExpressRouteCrossConnectionPeering") + + _request = build_express_route_cross_connection_peerings_create_or_update_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connection_peerings_delete_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCrossConnectionPeering, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Is either a ExpressRouteCrossConnectionPeering + type or a IO[bytes] type. Required. + :type peering_parameters: + ~azure.mgmt.network.models.ExpressRouteCrossConnectionPeering or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCrossConnectionPeering: + """Gets the specified peering for the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCrossConnectionPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connection_peerings_get_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, cross_connection_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeering"]: + """Gets all peerings in a specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :return: An iterator like instance of either ExpressRouteCrossConnectionPeering or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionPeeringList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connection_peerings_list_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionPeeringList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCrossConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_cross_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: Union[_models.ExpressRouteCrossConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRouteCrossConnection") + + _request = build_express_route_cross_connections_create_or_update_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_arp_table_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsArpTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsArpTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_list_arp_table_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_routes_table_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_list_routes_table_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_routes_table_summary_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]] = kwargs.pop( + "cls", None + ) + + _request = build_express_route_cross_connections_list_routes_table_summary_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize( + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cross_connection_parameters, (IOBase, bytes)): + _content = cross_connection_parameters + else: + _json = self._serialize.body(cross_connection_parameters, "TagsObject") + + _request = build_express_route_cross_connections_update_tags_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: Union[_models.ExpressRouteCrossConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Is either a ExpressRouteCrossConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ExpressRouteCrossConnection or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCrossConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_list_arp_table( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]: + """Gets the currently advertised ARP table associated with the express route cross connection in a + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_arp_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_list_routes_table( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]: + """Gets the currently advertised routes table associated with the express route cross connection + in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_list_routes_table_summary( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]: + """Gets the route table summary associated with the express route cross connection in a resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", pipeline_response + ) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[ + _models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnection]: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type cross_connection_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + cross_connection_parameters=cross_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCrossConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, cross_connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Gets details about the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group (peering location of the circuit). + Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection (service key of the + circuit). Required. + :type cross_connection_name: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_get_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteCrossConnection"]: + """Retrieves all the ExpressRouteCrossConnections in a subscription. + + :return: An iterator like instance of either ExpressRouteCrossConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connections_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCrossConnection"]: + """Retrieves all the ExpressRouteCrossConnections in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRouteCrossConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connections_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type cross_connection_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cross_connection_parameters, (IOBase, bytes)): + _content = cross_connection_parameters + else: + _json = self._serialize.body(cross_connection_parameters, "TagsObject") + + _request = build_express_route_cross_connections_update_tags_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class HubVirtualNetworkConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`hub_virtual_network_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> _models.HubVirtualNetworkConnection: + """Retrieves the details of a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: HubVirtualNetworkConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.HubVirtualNetworkConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + + _request = build_hub_virtual_network_connections_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HubVirtualNetworkConnection"]: + """Retrieves the details of all HubVirtualNetworkConnections. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubVirtualNetworkConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListHubVirtualNetworkConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_hub_virtual_network_connections_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListHubVirtualNetworkConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: Union[_models.HubVirtualNetworkConnection, IO[bytes]], + **kwargs: Any + ) -> _models.HubVirtualNetworkConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(hub_virtual_network_connection_parameters, (IOBase, bytes)): + _content = hub_virtual_network_connection_parameters + else: + _json = self._serialize.body(hub_virtual_network_connection_parameters, "HubVirtualNetworkConnection") + + _request = build_hub_virtual_network_connections_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_hub_virtual_network_connections_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: Union[_models.HubVirtualNetworkConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Is either a HubVirtualNetworkConnection type or a IO[bytes] type. + Required. + :type hub_virtual_network_connection_parameters: + ~azure.mgmt.network.models.HubVirtualNetworkConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either HubVirtualNetworkConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + hub_virtual_network_connection_parameters=hub_virtual_network_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HubVirtualNetworkConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HubVirtualNetworkConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualHubsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_hubs` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.VirtualHub, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "VirtualHub") + + _request = build_virtual_hubs_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hubs_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "TagsObject") + + _request = build_virtual_hubs_update_tags_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.VirtualHub, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Is either a + VirtualHub type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.models.VirtualHub or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + virtual_hub_parameters=virtual_hub_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHub", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHub].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHub]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHub]: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + virtual_hub_parameters=virtual_hub_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHub", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHub].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHub]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> _models.VirtualHub: + """Retrieves the details of a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + _request = build_virtual_hubs_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualHub"]: + """Lists all the VirtualHubs in a subscription. + + :return: An iterator like instance of either VirtualHub or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualHubsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hubs_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualHub"]: + """Lists all the VirtualHubs in a resource group. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualHub or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualHubsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hubs_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "TagsObject") + + _request = build_virtual_hubs_update_tags_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_effective_virtual_hub_routes_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[Union[_models.EffectiveRoutesParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[_models.VirtualHubEffectiveRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualHubEffectiveRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(effective_routes_parameters, (IOBase, bytes)): + _content = effective_routes_parameters + else: + if effective_routes_parameters is not None: + _json = self._serialize.body(effective_routes_parameters, "EffectiveRoutesParameters") + else: + _json = None + + _request = build_virtual_hubs_get_effective_virtual_hub_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualHubEffectiveRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[Union[_models.EffectiveRoutesParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Is either a EffectiveRoutesParameters type or a IO[bytes] type. Default + value is None. + :type effective_routes_parameters: + ~azure.mgmt.network.models.EffectiveRoutesParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubEffectiveRouteList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_effective_virtual_hub_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + effective_routes_parameters=effective_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHubEffectiveRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHubEffectiveRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHubEffectiveRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _get_inbound_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: Union[_models.GetInboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.EffectiveRouteMapRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EffectiveRouteMapRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(get_inbound_routes_parameters, (IOBase, bytes)): + _content = get_inbound_routes_parameters + else: + _json = self._serialize.body(get_inbound_routes_parameters, "GetInboundRoutesParameters") + + _request = build_virtual_hubs_get_inbound_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _get_outbound_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: Union[_models.GetOutboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.EffectiveRouteMapRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EffectiveRouteMapRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(get_outbound_routes_parameters, (IOBase, bytes)): + _content = get_outbound_routes_parameters + else: + _json = self._serialize.body(get_outbound_routes_parameters, "GetOutboundRoutesParameters") + + _request = build_virtual_hubs_get_outbound_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: Union[_models.GetInboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Is either a GetInboundRoutesParameters type or a IO[bytes] type. Required. + :type get_inbound_routes_parameters: + ~azure.mgmt.network.models.GetInboundRoutesParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveRouteMapRouteList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_inbound_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + get_inbound_routes_parameters=get_inbound_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveRouteMapRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveRouteMapRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: Union[_models.GetOutboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Is either a GetOutboundRoutesParameters type or a IO[bytes] type. + Required. + :type get_outbound_routes_parameters: + ~azure.mgmt.network.models.GetOutboundRoutesParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveRouteMapRouteList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_outbound_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + get_outbound_routes_parameters=get_outbound_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveRouteMapRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveRouteMapRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualWANsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_wans` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "VirtualWAN") + + _request = build_virtual_wans_create_or_update_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_wans_delete_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "TagsObject") + + _request = build_virtual_wans_update_tags_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Is either a + VirtualWAN type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.models.VirtualWAN or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualWAN", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualWAN].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualWAN]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being deleted. Required. + :type virtual_wan_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualWAN", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualWAN].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualWAN]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any) -> _models.VirtualWAN: + """Retrieves the details of a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being retrieved. Required. + :type virtual_wan_name: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + _request = build_virtual_wans_get_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a subscription. + + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a resource group. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-04-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: Union[_models.VpnConnection, IO[bytes]], + **kwargs: Any + ) -> _models.VpnConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_connection_parameters, (IOBase, bytes)): + _content = vpn_connection_parameters + else: + _json = self._serialize.body(vpn_connection_parameters, "VpnConnection") + + _request = build_vpn_connections_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_connections_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: Union[_models.VpnConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. Is + either a VpnConnection type or a IO[bytes] type. Required. + :type vpn_connection_parameters: ~azure.mgmt.network.models.VpnConnection or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + vpn_connection_parameters=vpn_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.VpnConnection: + """Retrieves the details of a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: VpnConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + + _request = build_vpn_connections_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_vpn_gateway( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnConnection"]: + """Retrieves all vpn connections for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either VpnConnection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_connections_list_by_vpn_gateway_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnConnectionPacketCaptureStartParameters") + else: + _json = None + + _request = build_vpn_connections_start_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnConnectionPacketCaptureStopParameters") + else: + _json = None + + _request = build_vpn_connections_stop_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Is either a VpnConnectionPacketCaptureStartParameters type or a IO[bytes] + type. Default value is None. + :type parameters: + ~azure.mgmt.network.models.VpnConnectionPacketCaptureStartParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Is either a VpnConnectionPacketCaptureStopParameters type or a IO[bytes] + type. Default value is None. + :type parameters: + ~azure.mgmt.network.models.VpnConnectionPacketCaptureStopParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.VpnGateway, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "VpnGateway") + + _request = build_vpn_gateways_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "TagsObject") + + _request = build_vpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.VpnGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Is either a VpnGateway type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.models.VpnGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.VpnGateway: + """Retrieves the details of a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: VpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VpnGateway"]: + """Lists all the VpnGateways in a subscription. + + :return: An iterator like instance of either VpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_gateways_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VpnGateway"]: + """Lists all the VpnGateways in a resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _reset_initial( + self, resource_group_name: str, gateway_name: str, *, ip_configuration_id: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.VpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.VpnGateway]] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_reset_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + ip_configuration_id=ip_configuration_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + params_valid_on={ + "ip_configuration_id": ['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def begin_reset( + self, resource_group_name: str, gateway_name: str, *, ip_configuration_id: Optional[str] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Resets the primary of the vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :keyword ip_configuration_id: VpnGateway ipConfigurationId to specify the gateway instance. + Default value is None. + :paramtype ip_configuration_id: str + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + ip_configuration_id=ip_configuration_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGateway: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "TagsObject") + + _request = build_vpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnGatewayPacketCaptureStartParameters") + else: + _json = None + + _request = build_vpn_gateways_start_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnGatewayPacketCaptureStopParameters") + else: + _json = None + + _request = build_vpn_gateways_stop_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Is either a VpnGatewayPacketCaptureStartParameters type or a IO[bytes] type. + Default value is None. + :type parameters: ~azure.mgmt.network.models.VpnGatewayPacketCaptureStartParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Is either a VpnGatewayPacketCaptureStopParameters type or a IO[bytes] type. Default + value is None. + :type parameters: ~azure.mgmt.network.models.VpnGatewayPacketCaptureStopParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnSitesConfigurationOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_sites_configuration` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _download_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_wan_name: str, + request: Union[_models.GetVpnSitesConfigurationRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "GetVpnSitesConfigurationRequest") + + _request = build_vpn_sites_configuration_download_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: Union[_models.GetVpnSitesConfigurationRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Is either a + GetVpnSitesConfigurationRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.models.GetVpnSitesConfigurationRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._download_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnSitesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_sites` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.VpnSite, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "VpnSite") + + _request = build_vpn_sites_create_or_update_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vpn_site_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_sites_delete_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "TagsObject") + + _request = build_vpn_sites_update_tags_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.VpnSite, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Is either a + VpnSite type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.models.VpnSite or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_parameters=vpn_site_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, vpn_site_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being deleted. Required. + :type vpn_site_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnSite]: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_parameters=vpn_site_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, vpn_site_name: str, **kwargs: Any) -> _models.VpnSite: + """Retrieves the details of a VPN site. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being retrieved. Required. + :type vpn_site_name: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + _request = build_vpn_sites_get_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VpnSite"]: + """Lists all the VpnSites in a subscription. + + :return: An iterator like instance of either VpnSite or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnSitesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_sites_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSitesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VpnSite"]: + """Lists all the vpnSites in a resource group. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnSite or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnSitesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_sites_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSitesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "TagsObject") + + _request = build_vpn_sites_update_tags_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AvailableDelegationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`available_delegations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableDelegation"]: + """Gets all of the available subnet delegations for this subscription in this region. + + :param location: The location of the subnet. Required. + :type location: str + :return: An iterator like instance of either AvailableDelegation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AvailableDelegation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AvailableDelegationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_delegations_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableDelegationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AvailableResourceGroupDelegationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`available_resource_group_delegations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list( + self, location: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AvailableDelegation"]: + """Gets all of the available subnet delegations for this resource group in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AvailableDelegation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AvailableDelegation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AvailableDelegationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_resource_group_delegations_list_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableDelegationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AzureFirewallFqdnTagsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`azure_firewall_fqdn_tags` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.AzureFirewallFqdnTag"]: + """Gets all the Azure Firewall FQDN Tags in a subscription. + + :return: An iterator like instance of either AzureFirewallFqdnTag or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AzureFirewallFqdnTag] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AzureFirewallFqdnTagListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewall_fqdn_tags_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallFqdnTagListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DdosCustomPoliciesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`ddos_custom_policies` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.DdosCustomPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DdosCustomPolicy") + + _request = build_ddos_custom_policies_create_or_update_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ddos_custom_policies_delete_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_custom_policies_update_tags_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.DdosCustomPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Is either a + DdosCustomPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.DdosCustomPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DdosCustomPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DdosCustomPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosCustomPolicy]: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the update DDoS custom policy resource tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DdosCustomPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DdosCustomPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Gets information about the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + _request = build_ddos_custom_policies_get_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_custom_policies_update_tags_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: Union[_models.ExpressRouteConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(put_express_route_connection_parameters, (IOBase, bytes)): + _content = put_express_route_connection_parameters + else: + _json = self._serialize.body(put_express_route_connection_parameters, "ExpressRouteConnection") + + _request = build_express_route_connections_create_or_update_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_connections_delete_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: Union[_models.ExpressRouteConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Is either a ExpressRouteConnection type or a IO[bytes] + type. Required. + :type put_express_route_connection_parameters: + ~azure.mgmt.network.models.ExpressRouteConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + put_express_route_connection_parameters=put_express_route_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a connection to a ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteConnection: + """Gets the specified ExpressRouteConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the ExpressRoute connection. Required. + :type connection_name: str + :return: ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + + _request = build_express_route_connections_get_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def list( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> _models.ExpressRouteConnectionList: + """Lists ExpressRouteConnections. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: ExpressRouteConnectionList or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteConnectionList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteConnectionList] = kwargs.pop("cls", None) + + _request = build_express_route_connections_list_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteConnectionList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: Union[_models.ExpressRouteGateway, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(put_express_route_gateway_parameters, (IOBase, bytes)): + _content = put_express_route_gateway_parameters + else: + _json = self._serialize.body(put_express_route_gateway_parameters, "ExpressRouteGateway") + + _request = build_express_route_gateways_create_or_update_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_delete_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: Union[_models.ExpressRouteGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Is either a ExpressRouteGateway type or a IO[bytes] type. Required. + :type put_express_route_gateway_parameters: + ~azure.mgmt.network.models.ExpressRouteGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + put_express_route_gateway_parameters=put_express_route_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway + resource can only be deleted when there are no connection subresources. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> _models.ExpressRouteGateway: + """Fetches the details of a ExpressRoute gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_get_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.ExpressRouteGatewayList: + """Lists ExpressRoute gateways in a given resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: ExpressRouteGatewayList or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteGatewayList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteGatewayList] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGatewayList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def list_by_subscription(self, **kwargs: Any) -> _models.ExpressRouteGatewayList: + """Lists ExpressRoute gateways under a given subscription. + + :return: ExpressRouteGatewayList or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteGatewayList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteGatewayList] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGatewayList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ExpressRouteGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExpressRouteGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(express_route_gateway_parameters, (IOBase, bytes)): + _content = express_route_gateway_parameters + else: + _json = self._serialize.body(express_route_gateway_parameters, "TagsObject") + + _request = build_express_route_gateways_update_tags_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type express_route_gateway_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + express_route_gateway_parameters=express_route_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExpressRouteLinksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_links` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_port_name: str, link_name: str, **kwargs: Any + ) -> _models.ExpressRouteLink: + """Retrieves the specified ExpressRouteLink resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param link_name: The name of the ExpressRouteLink resource. Required. + :type link_name: str + :return: ExpressRouteLink or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteLink] = kwargs.pop("cls", None) + + _request = build_express_route_links_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + link_name=link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteLink"]: + """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :return: An iterator like instance of either ExpressRouteLink or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRouteLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_links_list_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRoutePortsLocationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_ports_locations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get(self, location_name: str, **kwargs: Any) -> _models.ExpressRoutePortsLocation: + """Retrieves a single ExpressRoutePort peering location, including the list of available + bandwidths available at said peering location. + + :param location_name: Name of the requested ExpressRoutePort peering location. Required. + :type location_name: str + :return: ExpressRoutePortsLocation or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRoutePortsLocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePortsLocation] = kwargs.pop("cls", None) + + _request = build_express_route_ports_locations_get_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePortsLocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRoutePortsLocation"]: + """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each + location. Available bandwidths can only be obtained when retrieving a specific peering + location. + + :return: An iterator like instance of either ExpressRoutePortsLocation or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRoutePortsLocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePortsLocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_locations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortsLocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRoutePortsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_ports` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.ExpressRoutePort, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRoutePort") + + _request = build_express_route_ports_create_or_update_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_ports_delete_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_ports_update_tags_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.ExpressRoutePort, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Is either a + ExpressRoutePort type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ExpressRoutePort or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRoutePort].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRoutePort]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePort]: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRoutePort].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRoutePort]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> _models.ExpressRoutePort: + """Retrieves the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + _request = build_express_route_ports_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRoutePort"]: + """List all the ExpressRoutePort resources in the specified subscription. + + :return: An iterator like instance of either ExpressRoutePort or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePortListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRoutePort"]: + """List all the ExpressRoutePort resources in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRoutePort or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePortListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_ports_update_tags_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: Union[_models.GenerateExpressRoutePortsLOARequest, IO[bytes]], + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Is either a + GenerateExpressRoutePortsLOARequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.models.GenerateExpressRoutePortsLOARequest or + IO[bytes] + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateExpressRoutePortsLOAResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "GenerateExpressRoutePortsLOARequest") + + _request = build_express_route_ports_generate_loa_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GenerateExpressRoutePortsLOAResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InterfaceEndpointsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`interface_endpoints` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + interface_endpoint_name: str, + parameters: Union[_models.InterfaceEndpoint, IO[bytes]], + **kwargs: Any + ) -> _models.InterfaceEndpoint: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InterfaceEndpoint] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "InterfaceEndpoint") + + _request = build_interface_endpoints_create_or_update_request( + resource_group_name=resource_group_name, + interface_endpoint_name=interface_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InterfaceEndpoint", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InterfaceEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, interface_endpoint_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_interface_endpoints_delete_request( + resource_group_name=resource_group_name, + interface_endpoint_name=interface_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + interface_endpoint_name: str, + parameters: Union[_models.InterfaceEndpoint, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InterfaceEndpoint]: + """Creates or updates an interface endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param interface_endpoint_name: The name of the interface endpoint. Required. + :type interface_endpoint_name: str + :param parameters: Parameters supplied to the create or update interface endpoint operation. Is + either a InterfaceEndpoint type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.InterfaceEndpoint or IO[bytes] + :return: An instance of AsyncLROPoller that returns either InterfaceEndpoint or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.InterfaceEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InterfaceEndpoint] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + interface_endpoint_name=interface_endpoint_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InterfaceEndpoint", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InterfaceEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InterfaceEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, interface_endpoint_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified interface endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param interface_endpoint_name: The name of the interface endpoint. Required. + :type interface_endpoint_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + interface_endpoint_name=interface_endpoint_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, interface_endpoint_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.InterfaceEndpoint: + """Gets the specified interface endpoint by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param interface_endpoint_name: The name of the interface endpoint. Required. + :type interface_endpoint_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: InterfaceEndpoint or the result of cls(response) + :rtype: ~azure.mgmt.network.models.InterfaceEndpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[_models.InterfaceEndpoint] = kwargs.pop("cls", None) + + _request = build_interface_endpoints_get_request( + resource_group_name=resource_group_name, + interface_endpoint_name=interface_endpoint_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("InterfaceEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.InterfaceEndpoint"]: + """Gets all interface endpoints in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either InterfaceEndpoint or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.InterfaceEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[_models.InterfaceEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_interface_endpoints_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("InterfaceEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.InterfaceEndpoint"]: + """Gets all interface endpoints in a subscription. + + :return: An iterator like instance of either InterfaceEndpoint or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.InterfaceEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[_models.InterfaceEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_interface_endpoints_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("InterfaceEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancerOutboundRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`load_balancer_outbound_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, outbound_rule_name: str, **kwargs: Any + ) -> _models.OutboundRule: + """Gets the specified load balancer outbound rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param outbound_rule_name: The name of the outbound rule. Required. + :type outbound_rule_name: str + :return: OutboundRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.OutboundRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.OutboundRule] = kwargs.pop("cls", None) + + _request = build_load_balancer_outbound_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + outbound_rule_name=outbound_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OutboundRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OutboundRule"]: + """Gets all the outbound rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either OutboundRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.OutboundRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.LoadBalancerOutboundRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_outbound_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerOutboundRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkInterfaceTapConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_interface_tap_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: Union[_models.NetworkInterfaceTapConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterfaceTapConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_configuration_parameters, (IOBase, bytes)): + _content = tap_configuration_parameters + else: + _json = self._serialize.body(tap_configuration_parameters, "NetworkInterfaceTapConfiguration") + + _request = build_network_interface_tap_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_interface_tap_configurations_delete_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: Union[_models.NetworkInterfaceTapConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Is either a NetworkInterfaceTapConfiguration type or a IO[bytes] type. + Required. + :type tap_configuration_parameters: + ~azure.mgmt.network.models.NetworkInterfaceTapConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + tap_configuration_parameters=tap_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkInterfaceTapConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterfaceTapConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified tap configuration from the NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> _models.NetworkInterfaceTapConfiguration: + """Get the specified tap configuration on a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :return: NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkInterfaceTapConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interface_tap_configurations_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterfaceTapConfiguration"]: + """Get all Tap configurations in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either NetworkInterfaceTapConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkInterfaceTapConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_tap_configurations_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceTapConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkProfilesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_profiles` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_profile_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_profiles_delete_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_profile_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the NetworkProfile. Required. + :type network_profile_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: Union[_models.NetworkProfile, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. Is + either a NetworkProfile type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkProfile or IO[bytes] + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkProfile") + + _request = build_network_profiles_create_or_update_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_profile_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkProfile: + """Gets the specified network profile in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the public IP prefix. Required. + :type network_profile_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + _request = build_network_profiles_get_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkProfile"]: + """Gets all network profiles in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_profiles_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkProfile"]: + """Gets all the network profiles in a subscription. + + :return: An iterator like instance of either NetworkProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_profiles_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_profiles_update_tags_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class P2SVpnGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`p2_svpn_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.P2SVpnGateway, IO[bytes]], + **kwargs: Any + ) -> _models.P2SVpnGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "P2SVpnGateway") + + _request = build_p2_svpn_gateways_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _generate_vpn_profile_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.P2SVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnProfileResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnProfileResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "P2SVpnProfileParameters") + + _request = build_p2_svpn_gateways_generate_vpn_profile_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "TagsObject") + + _request = build_p2_svpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.P2SVpnGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Is either a P2SVpnGateway type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.models.P2SVpnGateway or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.P2SVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Is either a P2SVpnProfileParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.P2SVpnProfileParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnProfileResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnProfileResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnProfileResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.P2SVpnGateway: + """Retrieves the details of a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: P2SVpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.P2SVpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.P2SVpnGateway"]: + """Lists all the P2SVpnGateways in a subscription. + + :return: An iterator like instance of either P2SVpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListP2SVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_gateways_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.P2SVpnGateway"]: + """Lists all the P2SVpnGateways in a resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :return: An iterator like instance of either P2SVpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListP2SVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _get_p2_s_vpn_connection_health_initial( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_get_p2_s_vpn_connection_health_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_p2_s_vpn_connection_health( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_p2_s_vpn_connection_health_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _get_p2_s_vpn_connection_health_detailed_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: Union[_models.P2SVpnConnectionHealthRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.P2SVpnConnectionHealth]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.P2SVpnConnectionHealth]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionHealthRequest") + + _request = build_p2_svpn_gateways_get_p2_s_vpn_connection_health_detailed_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnConnectionHealth", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: Union[_models.P2SVpnConnectionHealthRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. Is + either a P2SVpnConnectionHealthRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.models.P2SVpnConnectionHealthRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnConnectionHealth] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_p2_s_vpn_connection_health_detailed_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnConnectionHealth", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnConnectionHealth].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnConnectionHealth]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.P2SVpnGateway: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: P2SVpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.P2SVpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "TagsObject") + + _request = build_p2_svpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _disconnect_p2_s_vpn_connections_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionRequest") + + _request = build_p2_svpn_gateways_disconnect_p2_s_vpn_connections_request( + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Is either a + P2SVpnConnectionRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.models.P2SVpnConnectionRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disconnect_p2_s_vpn_connections_initial( # type: ignore + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + async def _reset_initial( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_reset_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_reset( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Resets the primary of the p2s vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class P2SVpnServerConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`p2_svpn_server_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + p2_s_vpn_server_configuration_name: str, + p2_s_vpn_server_configuration_parameters: Union[_models.P2SVpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.P2SVpnServerConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_server_configuration_parameters, (IOBase, bytes)): + _content = p2_s_vpn_server_configuration_parameters + else: + _json = self._serialize.body(p2_s_vpn_server_configuration_parameters, "P2SVpnServerConfiguration") + + _request = build_p2_svpn_server_configurations_create_or_update_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + p2_s_vpn_server_configuration_name=p2_s_vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnServerConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("P2SVpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_p2_svpn_server_configurations_delete_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + p2_s_vpn_server_configuration_name=p2_s_vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + p2_s_vpn_server_configuration_name: str, + p2_s_vpn_server_configuration_parameters: Union[_models.P2SVpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnServerConfiguration]: + """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else + updates the existing P2SVpnServerConfiguration. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWan. Required. + :type virtual_wan_name: str + :param p2_s_vpn_server_configuration_name: The name of the P2SVpnServerConfiguration. Required. + :type p2_s_vpn_server_configuration_name: str + :param p2_s_vpn_server_configuration_parameters: Parameters supplied to create or Update a + P2SVpnServerConfiguration. Is either a P2SVpnServerConfiguration type or a IO[bytes] type. + Required. + :type p2_s_vpn_server_configuration_parameters: + ~azure.mgmt.network.models.P2SVpnServerConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.P2SVpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnServerConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + p2_s_vpn_server_configuration_name=p2_s_vpn_server_configuration_name, + p2_s_vpn_server_configuration_parameters=p2_s_vpn_server_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnServerConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnServerConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnServerConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a P2SVpnServerConfiguration. + + :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWan. Required. + :type virtual_wan_name: str + :param p2_s_vpn_server_configuration_name: The name of the P2SVpnServerConfiguration. Required. + :type p2_s_vpn_server_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + p2_s_vpn_server_configuration_name=p2_s_vpn_server_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs: Any + ) -> _models.P2SVpnServerConfiguration: + """Retrieves the details of a P2SVpnServerConfiguration. + + :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWan. Required. + :type virtual_wan_name: str + :param p2_s_vpn_server_configuration_name: The name of the P2SVpnServerConfiguration. Required. + :type p2_s_vpn_server_configuration_name: str + :return: P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.P2SVpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) + cls: ClsType[_models.P2SVpnServerConfiguration] = kwargs.pop("cls", None) + + _request = build_p2_svpn_server_configurations_get_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + p2_s_vpn_server_configuration_name=p2_s_vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("P2SVpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_virtual_wan( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> AsyncIterable["_models.P2SVpnServerConfiguration"]: + """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWan. Required. + :type virtual_wan_name: str + :return: An iterator like instance of either P2SVpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.P2SVpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) + cls: ClsType[_models.ListP2SVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_server_configurations_list_by_virtual_wan_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PublicIPPrefixesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`public_ip_prefixes` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.PublicIPPrefix, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PublicIPPrefix") + + _request = build_public_ip_prefixes_create_or_update_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_prefix_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_public_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.PublicIPPrefix, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. Is + either a PublicIPPrefix type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PublicIPPrefix or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIPPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIPPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, public_ip_prefix_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIpPrefix. Required. + :type public_ip_prefix_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPPrefix]: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIPPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIPPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, public_ip_prefix_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PublicIPPrefix: + """Gets the specified public IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + _request = build_public_ip_prefixes_get_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PublicIPPrefix"]: + """Gets all public IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PublicIPPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_prefixes_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.PublicIPPrefix"]: + """Gets all the public IP prefixes in a subscription. + + :return: An iterator like instance of either PublicIPPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PublicIPPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_prefixes_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceEndpointPoliciesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`service_endpoint_policies` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.ServiceEndpointPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ServiceEndpointPolicy") + + _request = build_service_endpoint_policies_create_or_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policies_delete_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_service_endpoint_policies_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.ServiceEndpointPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Is either a ServiceEndpointPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ServiceEndpointPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceEndpointPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceEndpointPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicy]: + """Updates service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceEndpointPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceEndpointPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Gets the specified service Endpoint Policies in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policies_get_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ServiceEndpointPolicy"]: + """Gets all the service endpoint policies in a subscription. + + :return: An iterator like instance of either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceEndpointPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policies_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ServiceEndpointPolicy"]: + """Gets all service endpoint Policies in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceEndpointPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policies_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_service_endpoint_policies_update_tags_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceEndpointPolicyDefinitionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`service_endpoint_policy_definitions` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: Union[_models.ServiceEndpointPolicyDefinition, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicyDefinition: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_endpoint_policy_definitions, (IOBase, bytes)): + _content = service_endpoint_policy_definitions + else: + _json = self._serialize.body(service_endpoint_policy_definitions, "ServiceEndpointPolicyDefinition") + + _request = build_service_endpoint_policy_definitions_create_or_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policy_definitions_delete_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: Union[_models.ServiceEndpointPolicyDefinition, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Is either a ServiceEndpointPolicyDefinition type or a IO[bytes] + type. Required. + :type service_endpoint_policy_definitions: + ~azure.mgmt.network.models.ServiceEndpointPolicyDefinition or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + service_endpoint_policy_definitions=service_endpoint_policy_definitions, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceEndpointPolicyDefinition].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceEndpointPolicyDefinition]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified ServiceEndpoint policy definitions. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the Service Endpoint Policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition. Required. + :type service_endpoint_policy_definition_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> _models.ServiceEndpointPolicyDefinition: + """Get the specified service endpoint policy definitions from service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :return: ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ServiceEndpointPolicyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policy_definitions_get_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinition"]: + """Gets all service endpoint policy definitions in a service end point policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. Required. + :type service_endpoint_policy_name: str + :return: An iterator like instance of either ServiceEndpointPolicyDefinition or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceEndpointPolicyDefinitionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policy_definitions_list_by_resource_group_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyDefinitionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworkTapsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_network_taps` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + tap_name: str, + parameters: Union[_models.VirtualNetworkTap, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkTap") + + _request = build_virtual_network_taps_create_or_update_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, tap_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_taps_delete_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_parameters, (IOBase, bytes)): + _content = tap_parameters + else: + _json = self._serialize.body(tap_parameters, "TagsObject") + + _request = build_virtual_network_taps_update_tags_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: Union[_models.VirtualNetworkTap, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Is either a VirtualNetworkTap type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualNetworkTap or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, tap_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified virtual network tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + tap_name=tap_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkTap]: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type tap_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + tap_parameters=tap_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, tap_name: str, **kwargs: Any) -> _models.VirtualNetworkTap: + """Gets information about the specified virtual network tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of virtual network tap. Required. + :type tap_name: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + _request = build_virtual_network_taps_get_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualNetworkTap"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :return: An iterator like instance of either VirtualNetworkTap or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkTapListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_taps_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTapListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkTap"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkTap or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkTapListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_taps_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTapListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type tap_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_parameters, (IOBase, bytes)): + _content = tap_parameters + else: + _json = self._serialize.body(tap_parameters, "TagsObject") + + _request = build_virtual_network_taps_update_tags_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualWansOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_wans` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "VirtualWAN") + + _request = build_virtual_wans_create_or_update_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_wans_delete_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "TagsObject") + + _request = build_virtual_wans_update_tags_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Is either a + VirtualWAN type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.models.VirtualWAN or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualWAN", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualWAN].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualWAN]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being deleted. Required. + :type virtual_wan_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualWAN", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualWAN].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualWAN]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get(self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any) -> _models.VirtualWAN: + """Retrieves the details of a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being retrieved. Required. + :type virtual_wan_name: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + _request = build_virtual_wans_get_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a subscription. + + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a resource group. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "TagsObject") + + _request = build_virtual_wans_update_tags_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PeerExpressRouteCircuitConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`peer_express_route_circuit_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> _models.PeerExpressRouteCircuitConnection: + """Gets the specified Peer Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the peer express route circuit connection. Required. + :type connection_name: str + :return: PeerExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PeerExpressRouteCircuitConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PeerExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + _request = build_peer_express_route_circuit_connections_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PeerExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnection"]: + """Gets all global reach peer connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An iterator like instance of either PeerExpressRouteCircuitConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PeerExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PeerExpressRouteCircuitConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_peer_express_route_circuit_connections_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PeerExpressRouteCircuitConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class WebApplicationFirewallPoliciesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`web_application_firewall_policies` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_web_application_firewall_policies_delete_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, policy_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + policy_name=policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: Union[_models.WebApplicationFirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Is either a WebApplicationFirewallPolicy type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.WebApplicationFirewallPolicy or + IO[bytes] + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WebApplicationFirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "WebApplicationFirewallPolicy") + + _request = build_web_application_firewall_policies_create_or_update_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, policy_name: str, **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Retrieve protection policy with specified name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.WebApplicationFirewallPolicy] = kwargs.pop("cls", None) + + _request = build_web_application_firewall_policies_get_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.WebApplicationFirewallPolicy"]: + """Lists all of the protection policies within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either WebApplicationFirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.WebApplicationFirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.WebApplicationFirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_application_firewall_policies_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WebApplicationFirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.WebApplicationFirewallPolicy"]: + """Gets all the WAF policies in a subscription. + + :return: An iterator like instance of either WebApplicationFirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.WebApplicationFirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.WebApplicationFirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_application_firewall_policies_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WebApplicationFirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NatGatewaysOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nat_gateways` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.NatGateway, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.NatGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NatGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NatGateway") + + _request = build_nat_gateways_create_or_update_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("NatGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, nat_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nat_gateways_delete_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.NatGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Is either + a NatGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NatGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NatGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NatGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NatGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, nat_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, nat_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NatGateway: + """Gets the specified nat gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + + _request = build_nat_gateways_get_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NatGateway"]: + """Gets all nat gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NatGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NatGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NatGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NatGateway"]: + """Gets all the Nat Gateways in a subscription. + + :return: An iterator like instance of either NatGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NatGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_gateways_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NatGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_nat_gateways_update_tags_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ResourceNavigationLinksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`resource_navigation_links` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @api_version_validation( + method_valid_on=['2019-02-01'], + ) + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ResourceNavigationLinksListResult: + """Gets a list of resource navigation links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ResourceNavigationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ResourceNavigationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[_models.ResourceNavigationLinksListResult] = kwargs.pop("cls", None) + + _request = build_resource_navigation_links_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceNavigationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ResourceNavigationLinksListResult: + """Gets a list of resource navigation links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ResourceNavigationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ResourceNavigationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ResourceNavigationLinksListResult] = kwargs.pop("cls", None) + + _request = build_resource_navigation_links_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceNavigationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceAssociationLinksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`service_association_links` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @api_version_validation( + method_valid_on=['2019-02-01'], + ) + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ServiceAssociationLinksListResult: + """Gets a list of service association links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ServiceAssociationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ServiceAssociationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) + cls: ClsType[_models.ServiceAssociationLinksListResult] = kwargs.pop("cls", None) + + _request = build_service_association_links_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceAssociationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ServiceAssociationLinksListResult: + """Gets a list of service association links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ServiceAssociationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ServiceAssociationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceAssociationLinksListResult] = kwargs.pop("cls", None) + + _request = build_service_association_links_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceAssociationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AvailablePrivateEndpointTypesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`available_private_endpoint_types` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailablePrivateEndpointType"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. Required. + :type location: str + :return: An iterator like instance of either AvailablePrivateEndpointType or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AvailablePrivateEndpointType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AvailablePrivateEndpointTypesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_private_endpoint_types_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailablePrivateEndpointTypesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, location: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AvailablePrivateEndpointType"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AvailablePrivateEndpointType or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AvailablePrivateEndpointType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AvailablePrivateEndpointTypesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_private_endpoint_types_list_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailablePrivateEndpointTypesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class BastionHostsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`bastion_hosts` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.BastionHost, IO[bytes]], + **kwargs: Any + ) -> _models.BastionHost: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BastionHost") + + _request = build_bastion_hosts_create_or_update_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_bastion_hosts_delete_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.BastionHost, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. Is + either a BastionHost type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.BastionHost or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BastionHost", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BastionHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BastionHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get(self, resource_group_name: str, bastion_host_name: str, **kwargs: Any) -> _models.BastionHost: + """Gets the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: BastionHost or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BastionHost + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + + _request = build_bastion_hosts_get_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.BastionHost"]: + """Lists all Bastion Hosts in a subscription. + + :return: An iterator like instance of either BastionHost or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bastion_hosts_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.BastionHost"]: + """Lists all Bastion Hosts in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either BastionHost or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bastion_hosts_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _update_tags_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.BastionHost]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BastionHost]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_bastion_hosts_update_tags_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-06-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + params_valid_on={ + "bastion_host_parameters": ['2019-06-01'], + "parameters": ['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BastionHost", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BastionHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BastionHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class PrivateEndpointsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`private_endpoints` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: Union[_models.PrivateEndpoint, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpoint: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateEndpoint") + + _request = build_private_endpoints_create_or_update_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_endpoint_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_endpoints_delete_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: Union[_models.PrivateEndpoint, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. Is + either a PrivateEndpoint type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PrivateEndpoint or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, private_endpoint_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_endpoint_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PrivateEndpoint: + """Gets the specified private endpoint by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateEndpoint or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PrivateEndpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + + _request = build_private_endpoints_get_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PrivateEndpoint"]: + """Gets all private endpoints in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateEndpoint or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoints_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateEndpoint"]: + """Gets all private endpoints in a subscription. + + :return: An iterator like instance of either PrivateEndpoint or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoints_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateLinkServicesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`private_link_services` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _check_private_link_service_visibility_by_resource_group_initial( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.PrivateLinkServiceVisibility]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateLinkServiceVisibility]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CheckPrivateLinkServiceVisibilityRequest") + + _request = build_private_link_services_check_private_link_service_visibility_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _check_private_link_service_visibility_initial( # pylint: disable=name-too-long + self, + location: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.PrivateLinkServiceVisibility]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateLinkServiceVisibility]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CheckPrivateLinkServiceVisibilityRequest") + + _request = build_private_link_services_check_private_link_service_visibility_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + parameters: Union[_models.PrivateLinkService, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkService: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateLinkService") + + _request = build_private_link_services_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_link_services_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _delete_private_endpoint_connection_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, service_name: str, pe_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_link_services_delete_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, + location: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Is either a + CheckPrivateLinkServiceVisibilityRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.models.CheckPrivateLinkServiceVisibilityRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkServiceVisibility] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._check_private_link_service_visibility_initial( + location=location, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateLinkServiceVisibility].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateLinkServiceVisibility]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Is either a + CheckPrivateLinkServiceVisibilityRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.models.CheckPrivateLinkServiceVisibilityRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkServiceVisibility] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._check_private_link_service_visibility_by_resource_group_initial( + location=location, + resource_group_name=resource_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateLinkServiceVisibility].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateLinkServiceVisibility]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: Union[_models.PrivateLinkService, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Is either a PrivateLinkService type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PrivateLinkService or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateLinkService].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateLinkService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified private link service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_delete_private_endpoint_connection( + self, resource_group_name: str, service_name: str, pe_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PrivateLinkService: + """Gets the specified private link service by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateLinkService or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PrivateLinkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + + _request = build_private_link_services_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PrivateLinkService"]: + """Gets all private link services in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateLinkService or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateLinkServiceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_auto_approved_private_link_services( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkService"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. Required. + :type location: str + :return: An iterator like instance of either AutoApprovedPrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AutoApprovedPrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AutoApprovedPrivateLinkServicesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_auto_approved_private_link_services_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AutoApprovedPrivateLinkServicesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_auto_approved_private_link_services_by_resource_group( # pylint: disable=name-too-long + self, location: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkService"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AutoApprovedPrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AutoApprovedPrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AutoApprovedPrivateLinkServicesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_private_link_services_list_auto_approved_private_link_services_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AutoApprovedPrivateLinkServicesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateLinkService"]: + """Gets all private link service in a subscription. + + :return: An iterator like instance of either PrivateLinkService or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateLinkServiceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateEndpointConnection") + + _request = build_private_link_services_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def get_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get the specific private end point connection by specific private link service in the resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_link_services_get_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def list_private_endpoint_connections( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnection"]: + """Gets all private end point connections for a specific private link service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :return: An iterator like instance of either PrivateEndpointConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_private_endpoint_connections_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServiceTagsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`service_tags` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list(self, location: str, **kwargs: Any) -> _models.ServiceTagsListResult: + """Gets a list of service tag information resources. + + :param location: The location that will be used as a reference for version (not as a filter + based on location, you will get the list of service tags with prefix details across all regions + but limited to the cloud that your subscription belongs to). Required. + :type location: str + :return: ServiceTagsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ServiceTagsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceTagsListResult] = kwargs.pop("cls", None) + + _request = build_service_tags_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceTagsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPoliciesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policies` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicy") + + _request = build_firewall_policies_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policies_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. Is + either a FirewallPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FirewallPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FirewallPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FirewallPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.FirewallPolicy: + """Gets the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + _request = build_firewall_policies_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.FirewallPolicy"]: + """Lists all Firewall Policies in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either FirewallPolicy or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policies_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FirewallPolicy"]: + """Gets all the Firewall Policies in a subscription. + + :return: An iterator like instance of either FirewallPolicy or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policies_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-06-01', '2019-07-01', '2019-08-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + params_valid_on={ + "firewall_policy_parameters": ['2019-06-01', '2019-07-01', '2019-08-01'], + "parameters": ['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_firewall_policies_update_tags_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyRuleGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_rule_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_group_name: str, + parameters: Union[_models.FirewallPolicyRuleGroup, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicyRuleGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicyRuleGroup") + + _request = build_firewall_policy_rule_groups_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_group_name=rule_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicyRuleGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicyRuleGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, rule_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_groups_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_group_name=rule_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_group_name: str, + parameters: Union[_models.FirewallPolicyRuleGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicyRuleGroup]: + """Creates or updates the specified FirewallPolicyRuleGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_group_name: The name of the FirewallPolicyRuleGroup. Required. + :type rule_group_name: str + :param parameters: Parameters supplied to the create or update FirewallPolicyRuleGroup + operation. Is either a FirewallPolicyRuleGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FirewallPolicyRuleGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.FirewallPolicyRuleGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_group_name=rule_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FirewallPolicyRuleGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FirewallPolicyRuleGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, firewall_policy_name: str, rule_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified FirewallPolicyRuleGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_group_name: The name of the FirewallPolicyRuleGroup. Required. + :type rule_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_group_name=rule_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, rule_group_name: str, **kwargs: Any + ) -> _models.FirewallPolicyRuleGroup: + """Gets the specified FirewallPolicyRuleGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_group_name: The name of the FirewallPolicyRuleGroup. Required. + :type rule_group_name: str + :return: FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicyRuleGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) + cls: ClsType[_models.FirewallPolicyRuleGroup] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_groups_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_group_name=rule_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicyRuleGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FirewallPolicyRuleGroup"]: + """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An iterator like instance of either FirewallPolicyRuleGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.FirewallPolicyRuleGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) + cls: ClsType[_models.FirewallPolicyRuleGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policy_rule_groups_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnLinkConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_link_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list_by_vpn_connection( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnSiteLinkConnection"]: + """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn + connection. + + :param resource_group_name: The resource group name of the vpn gateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: An iterator like instance of either VpnSiteLinkConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnSiteLinkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnSiteLinkConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_link_connections_list_by_vpn_connection_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSiteLinkConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _get_ike_sas_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_vpn_link_connections_get_ike_sas_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _reset_connection_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_link_connections_reset_connection_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_ike_sas( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn link connection. Required. + :type link_connection_name: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_ike_sas_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_reset_connection( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Resets the VpnLink connection specified. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn link connection. Required. + :type link_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_connection_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnSiteLinkConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_site_link_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> _models.VpnSiteLinkConnection: + """Retrieves the details of a vpn site link connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn connection. Required. + :type link_connection_name: str + :return: VpnSiteLinkConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnSiteLinkConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnSiteLinkConnection] = kwargs.pop("cls", None) + + _request = build_vpn_site_link_connections_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSiteLinkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VpnSiteLinksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_site_links` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, vpn_site_name: str, vpn_site_link_name: str, **kwargs: Any + ) -> _models.VpnSiteLink: + """Retrieves the details of a VPN site link. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. Required. + :type vpn_site_name: str + :param vpn_site_link_name: The name of the VpnSiteLink being retrieved. Required. + :type vpn_site_link_name: str + :return: VpnSiteLink or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnSiteLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnSiteLink] = kwargs.pop("cls", None) + + _request = build_vpn_site_links_get_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_link_name=vpn_site_link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSiteLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_vpn_site( + self, resource_group_name: str, vpn_site_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnSiteLink"]: + """Lists all the vpnSiteLinks in a resource group for a vpn site. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. Required. + :type vpn_site_name: str + :return: An iterator like instance of either VpnSiteLink or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnSiteLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnSiteLinksResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_site_links_list_by_vpn_site_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSiteLinksResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualRouterPeeringsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_router_peerings` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouterPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouterPeering") + + _request = build_virtual_router_peerings_create_or_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_router_peerings_delete_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Is either a VirtualRouterPeering type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualRouterPeering or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualRouterPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualRouterPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from a Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> _models.VirtualRouterPeering: + """Gets the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :return: VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualRouterPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + _request = build_virtual_router_peerings_get_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualRouterPeering"]: + """Lists all Virtual Router Peerings in a Virtual Router resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :return: An iterator like instance of either VirtualRouterPeering or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualRouterPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_router_peerings_list_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouterPeering: + """Updates a Virtual Router Peering. + + :param resource_group_name: The resource group name of the Virtual Router Peering. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering being updated. Required. + :type peering_name: str + :param parameters: Parameters supplied to update Virtual Router Peering operation. Is either a + VirtualRouterPeering type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualRouterPeering or IO[bytes] + :return: VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualRouterPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouterPeering") + + _request = build_virtual_router_peerings_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualRoutersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_routers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.VirtualRouter, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouter") + + _request = build_virtual_routers_create_or_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_routers_delete_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.VirtualRouter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Is either a + VirtualRouter type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualRouter or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualRouter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualRouter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualRouter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_router_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.VirtualRouter: + """Gets the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: VirtualRouter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualRouter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + _request = build_virtual_routers_get_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualRouter"]: + """Gets all the Virtual Routers in a subscription. + + :return: An iterator like instance of either VirtualRouter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualRouterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_routers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualRouter"]: + """Lists all Virtual Routers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualRouter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualRouterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_routers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-07-01', '2019-08-01'], + ) + @distributed_trace_async + async def update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouter: + """Updates a Virtual Router. + + :param resource_group_name: The resource group name of the Virtual Router. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router being updated. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to Update Virtual Router Tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: VirtualRouter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualRouter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_routers_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AvailableServiceAliasesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`available_service_aliases` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableServiceAlias"]: + """Gets all available service aliases for this subscription in this region. + + :param location: The location. Required. + :type location: str + :return: An iterator like instance of either AvailableServiceAlias or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AvailableServiceAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AvailableServiceAliasesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_service_aliases_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableServiceAliasesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, location: str, **kwargs: Any + ) -> AsyncIterable["_models.AvailableServiceAlias"]: + """Gets all available service aliases for this resource group in this region. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param location: The location. Required. + :type location: str + :return: An iterator like instance of either AvailableServiceAlias or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AvailableServiceAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AvailableServiceAliasesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_service_aliases_list_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableServiceAliasesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnServerConfigurationsAssociatedWithVirtualWanOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_server_configurations_associated_with_virtual_wan` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _list_initial( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> Optional[_models.VpnServerConfigurationsResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[_models.VpnServerConfigurationsResponse]] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_associated_with_virtual_wan_list_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfigurationsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_list( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfigurationsResponse]: + """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnServerConfigurationsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnServerConfigurationsResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfigurationsResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfigurationsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfigurationsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VpnServerConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vpn_server_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.VpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "VpnServerConfiguration") + + _request = build_vpn_server_configurations_create_or_update_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_delete_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_tags_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "TagsObject") + + _request = build_vpn_server_configurations_update_tags_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.VpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Is either a VpnServerConfiguration type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: + ~azure.mgmt.network.models.VpnServerConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + vpn_server_configuration_parameters=vpn_server_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being deleted. + Required. + :type vpn_server_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-08-01'], + ) + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfiguration]: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + vpn_server_configuration_parameters=vpn_server_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Retrieves the details of a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being retrieved. + Required. + :type vpn_server_configuration_name: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_get_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VpnServerConfiguration"]: + """Lists all the VpnServerConfigurations in a subscription. + + :return: An iterator like instance of either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_server_configurations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnServerConfiguration"]: + """Lists all the vpnServerConfigurations in a resource group. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_server_configurations_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.models.TagsObject or + IO[bytes] + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "TagsObject") + + _request = build_vpn_server_configurations_update_tags_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class IpGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`ip_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.IpGroup, IO[bytes]], + **kwargs: Any + ) -> _models.IpGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IpGroup") + + _request = build_ip_groups_create_or_update_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("IpGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ip_groups_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ip_groups_delete_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.IpGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Is either a + IpGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.IpGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IpGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, ip_groups_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified ipGroups. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, ip_groups_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.IpGroup: + """Gets the specified ipGroups. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :keyword expand: Expands resourceIds (of Firewalls/Network Security Groups etc.) back + referenced by the IpGroups resource. Default value is None. + :paramtype expand: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + _request = build_ip_groups_get_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.IpGroup"]: + """Gets all IpGroups in a subscription. + + :return: An iterator like instance of either IpGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IpGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_groups_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.IpGroup"]: + """Gets all IpGroups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either IpGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IpGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ip_groups_update_groups_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualHubRouteTableV2SOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_hub_route_table_v2_s` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: Union[_models.VirtualHubRouteTableV2, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHubRouteTableV2: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_route_table_v2_parameters, (IOBase, bytes)): + _content = virtual_hub_route_table_v2_parameters + else: + _json = self._serialize.body(virtual_hub_route_table_v2_parameters, "VirtualHubRouteTableV2") + + _request = build_virtual_hub_route_table_v2_s_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_route_table_v2_s_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: Union[_models.VirtualHubRouteTableV2, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Is either a VirtualHubRouteTableV2 type or a IO[bytes] type. Required. + :type virtual_hub_route_table_v2_parameters: + ~azure.mgmt.network.models.VirtualHubRouteTableV2 or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + virtual_hub_route_table_v2_parameters=virtual_hub_route_table_v2_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHubRouteTableV2].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHubRouteTableV2]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> _models.VirtualHubRouteTableV2: + """Retrieves the details of a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :return: VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualHubRouteTableV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + + _request = build_virtual_hub_route_table_v2_s_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualHubRouteTableV2"]: + """Retrieves the details of all VirtualHubRouteTableV2s. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either VirtualHubRouteTableV2 or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualHubRouteTableV2SResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_route_table_v2_s_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubRouteTableV2SResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FlowLogsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`flow_logs` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.FlowLog, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLog: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLog") + + _request = build_flow_logs_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLog", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_flow_logs_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.FlowLog, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Is either a + FlowLog type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FlowLog or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLog", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowLog].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowLog]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified flow log resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. Required. + :type flow_log_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> _models.FlowLog: + """Gets a flow log resource by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. Required. + :type flow_log_name: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + _request = build_flow_logs_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FlowLog"]: + """Lists all flow log resources for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either FlowLog or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FlowLogListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flow_logs_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FlowLogListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Is either a TagsObject type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_flow_logs_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkVirtualAppliancesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_virtual_appliances` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.NetworkVirtualAppliance, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkVirtualAppliance") + + _request = build_network_virtual_appliances_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliances_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.NetworkVirtualAppliance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. Is + either a NetworkVirtualAppliance type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkVirtualAppliance or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkVirtualAppliance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkVirtualAppliance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Gets the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliances_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.NetworkVirtualAppliance"]: + """Gets all Network Virtual Appliances in a subscription. + + :return: An iterator like instance of either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliances_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkVirtualAppliance"]: + """Lists all Network Virtual Appliances in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliances_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_virtual_appliances_update_tags_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _restart_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + network_virtual_appliance_instance_ids: Optional[ + Union[_models.NetworkVirtualApplianceInstanceIds, IO[bytes]] + ] = None, + **kwargs: Any + ) -> Optional[_models.NetworkVirtualApplianceInstanceIds]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkVirtualApplianceInstanceIds]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(network_virtual_appliance_instance_ids, (IOBase, bytes)): + _content = network_virtual_appliance_instance_ids + else: + if network_virtual_appliance_instance_ids is not None: + _json = self._serialize.body( + network_virtual_appliance_instance_ids, "NetworkVirtualApplianceInstanceIds" + ) + else: + _json = None + + _request = build_network_virtual_appliances_restart_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualApplianceInstanceIds", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-11-01'], + ) + @distributed_trace_async + async def begin_restart( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + network_virtual_appliance_instance_ids: Optional[ + Union[_models.NetworkVirtualApplianceInstanceIds, IO[bytes]] + ] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualApplianceInstanceIds]: + """Restarts one or more VMs belonging to the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param network_virtual_appliance_instance_ids: Specifies a list of virtual machine instance IDs + from the Network Virtual Appliance VM instances. Is either a NetworkVirtualApplianceInstanceIds + type or a IO[bytes] type. Default value is None. + :type network_virtual_appliance_instance_ids: + ~azure.mgmt.network.models.NetworkVirtualApplianceInstanceIds or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkVirtualApplianceInstanceIds + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkVirtualApplianceInstanceIds] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceInstanceIds] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._restart_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + network_virtual_appliance_instance_ids=network_virtual_appliance_instance_ids, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceInstanceIds", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkVirtualApplianceInstanceIds].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkVirtualApplianceInstanceIds]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class IpAllocationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`ip_allocations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.IpAllocation, IO[bytes]], + **kwargs: Any + ) -> _models.IpAllocation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IpAllocation") + + _request = build_ip_allocations_create_or_update_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ip_allocation_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ip_allocations_delete_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.IpAllocation, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. Is + either a IpAllocation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.IpAllocation or IO[bytes] + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IpAllocation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpAllocation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpAllocation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ip_allocation_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified IpAllocation. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, ip_allocation_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.IpAllocation: + """Gets the specified IpAllocation by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + _request = build_ip_allocations_get_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.IpAllocation"]: + """Gets all IpAllocations in a subscription. + + :return: An iterator like instance of either IpAllocation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IpAllocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_allocations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpAllocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.IpAllocation"]: + """Gets all IpAllocations in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either IpAllocation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.IpAllocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_allocations_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpAllocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ip_allocations_update_tags_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PrivateDnsZoneGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`private_dns_zone_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: Union[_models.PrivateDnsZoneGroup, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateDnsZoneGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateDnsZoneGroup") + + _request = build_private_dns_zone_groups_create_or_update_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_dns_zone_groups_delete_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: Union[_models.PrivateDnsZoneGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Is either a PrivateDnsZoneGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PrivateDnsZoneGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateDnsZoneGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateDnsZoneGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private dns zone group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> _models.PrivateDnsZoneGroup: + """Gets the private dns zone group resource by specified private dns zone group name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :return: PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.PrivateDnsZoneGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + + _request = build_private_dns_zone_groups_get_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, private_endpoint_name: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PrivateDnsZoneGroup"]: + """Gets all private dns zone groups in a private endpoint. + + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateDnsZoneGroup or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.PrivateDnsZoneGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_dns_zone_groups_list_request( + private_endpoint_name=private_endpoint_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateDnsZoneGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityPartnerProvidersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`security_partner_providers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.SecurityPartnerProvider, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SecurityPartnerProvider") + + _request = build_security_partner_providers_create_or_update_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_partner_providers_delete_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.SecurityPartnerProvider, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Is either a SecurityPartnerProvider type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.SecurityPartnerProvider or IO[bytes] + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityPartnerProvider].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityPartnerProvider]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Gets the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + _request = build_security_partner_providers_get_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityPartnerProvider"]: + """Gets all the Security Partner Providers in a subscription. + + :return: An iterator like instance of either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityPartnerProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_partner_providers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityPartnerProvider"]: + """Lists all Security Partner Providers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityPartnerProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_partner_providers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_security_partner_providers_update_tags_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class HubRouteTablesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`hub_route_tables` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: Union[_models.HubRouteTable, IO[bytes]], + **kwargs: Any + ) -> _models.HubRouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_table_parameters, (IOBase, bytes)): + _content = route_table_parameters + else: + _json = self._serialize.body(route_table_parameters, "HubRouteTable") + + _request = build_hub_route_tables_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_hub_route_tables_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: Union[_models.HubRouteTable, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Is either a + HubRouteTable type or a IO[bytes] type. Required. + :type route_table_parameters: ~azure.mgmt.network.models.HubRouteTable or IO[bytes] + :return: An instance of AsyncLROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + route_table_parameters=route_table_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubRouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HubRouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HubRouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a RouteTable. + + :param resource_group_name: The resource group name of the RouteTable. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> _models.HubRouteTable: + """Retrieves the details of a RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :return: HubRouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.models.HubRouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + + _request = build_hub_route_tables_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HubRouteTable"]: + """Retrieves the details of all RouteTables. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubRouteTable or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListHubRouteTablesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_hub_route_tables_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListHubRouteTablesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ApplicationGatewayPrivateEndpointConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`application_gateway_private_endpoint_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateway_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: Union[_models.ApplicationGatewayPrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ApplicationGatewayPrivateEndpointConnection]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ApplicationGatewayPrivateEndpointConnection]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationGatewayPrivateEndpointConnection") + + _request = build_application_gateway_private_endpoint_connections_update_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: Union[_models.ApplicationGatewayPrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Is either a ApplicationGatewayPrivateEndpointConnection type or a + IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.models.ApplicationGatewayPrivateEndpointConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def get( + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.ApplicationGatewayPrivateEndpointConnection: + """Gets the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :return: ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGatewayPrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_application_gateway_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationGatewayPrivateEndpointConnection"]: + """Lists all private endpoint connections on an application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An iterator like instance of either ApplicationGatewayPrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ApplicationGatewayPrivateLinkResourcesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`application_gateway_private_link_resources` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationGatewayPrivateLinkResource"]: + """Lists all private link resources on an application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An iterator like instance of either ApplicationGatewayPrivateLinkResource or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationGatewayPrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayPrivateLinkResourceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_private_link_resources_list_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateLinkResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FirewallPolicyRuleCollectionGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_rule_collection_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroup, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicyRuleCollectionGroup") + + _request = build_firewall_policy_rule_collection_groups_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_groups_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Is either a FirewallPolicyRuleCollectionGroup type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroup or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleCollectionGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroup: + """Gets the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: FirewallPolicyRuleCollectionGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_groups_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FirewallPolicyRuleCollectionGroup"]: + """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An iterator like instance of either FirewallPolicyRuleCollectionGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policy_rule_collection_groups_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualApplianceSitesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_appliance_sites` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: Union[_models.VirtualApplianceSite, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualApplianceSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualApplianceSite") + + _request = build_virtual_appliance_sites_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_sites_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: Union[_models.VirtualApplianceSite, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Is either a VirtualApplianceSite type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.VirtualApplianceSite or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualApplianceSite or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualApplianceSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualApplianceSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified site from a Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> _models.VirtualApplianceSite: + """Gets the specified Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :return: VirtualApplianceSite or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualApplianceSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_sites_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualApplianceSite"]: + """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An iterator like instance of either VirtualApplianceSite or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceSiteListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_appliance_sites_list_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceSiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualApplianceSkusOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_appliance_skus` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get(self, sku_name: str, **kwargs: Any) -> _models.NetworkVirtualApplianceSku: + """Retrieves a single available sku for network virtual appliance. + + :param sku_name: Name of the Sku. Required. + :type sku_name: str + :return: NetworkVirtualApplianceSku or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkVirtualApplianceSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceSku] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_skus_get_request( + sku_name=sku_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualApplianceSku", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.NetworkVirtualApplianceSku"]: + """List all SKUs available for a virtual appliance. + + :return: An iterator like instance of either NetworkVirtualApplianceSku or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkVirtualApplianceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceSkuListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_appliance_skus_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceSkuListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualHubBgpConnectionOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_hub_bgp_connection` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: Union[_models.BgpConnection, IO[bytes]], + **kwargs: Any + ) -> _models.BgpConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BgpConnection") + + _request = build_virtual_hub_bgp_connection_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connection_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: Union[_models.BgpConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Is either a BgpConnection type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.network.models.BgpConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BgpConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BgpConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BgpConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> _models.BgpConnection: + """Retrieves the details of a Virtual Hub Bgp Connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: BgpConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BgpConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connection_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualHubBgpConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_hub_bgp_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BgpConnection"]: + """Retrieves the details of all VirtualHubBgpConnections. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either BgpConnection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualHubBgpConnectionResults] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_bgp_connections_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubBgpConnectionResults", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _list_advertised_routes_initial( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> Optional[Dict[str, List[_models.PeerRoute]]]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[Dict[str, List[_models.PeerRoute]]]] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connections_list_advertised_routes_request( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _list_learned_routes_initial( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> Optional[Dict[str, List[_models.PeerRoute]]]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Optional[Dict[str, List[_models.PeerRoute]]]] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connections_list_learned_routes_request( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_advertised_routes( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]: + """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. Required. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either dict mapping str to list of + PeerRoute or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[dict[str, + list[~azure.mgmt.network.models.PeerRoute]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Dict[str, List[_models.PeerRoute]]] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_advertised_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_list_learned_routes( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]: + """Retrieves a list of routes the virtual hub bgp connection has learned. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. Required. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either dict mapping str to list of + PeerRoute or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[dict[str, + list[~azure.mgmt.network.models.PeerRoute]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[Dict[str, List[_models.PeerRoute]]] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_learned_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualHubIpConfigurationOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_hub_ip_configuration` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: Union[_models.HubIpConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.HubIpConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "HubIpConfiguration") + + _request = build_virtual_hub_ip_configuration_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_ip_configuration_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: Union[_models.HubIpConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Is either a HubIpConfiguration type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.HubIpConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HubIpConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HubIpConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> _models.HubIpConfiguration: + """Retrieves the details of a Virtual Hub Ip configuration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :return: HubIpConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.HubIpConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + + _request = build_virtual_hub_ip_configuration_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HubIpConfiguration"]: + """Retrieves the details of all VirtualHubIpConfigurations. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubIpConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualHubIpConfigurationResults] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_ip_configuration_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubIpConfigurationResults", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class CustomIPPrefixesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`custom_ip_prefixes` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.CustomIpPrefix, IO[bytes]], + **kwargs: Any + ) -> _models.CustomIpPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CustomIpPrefix") + + _request = build_custom_ip_prefixes_create_or_update_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, custom_ip_prefix_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_custom_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.CustomIpPrefix, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. Is + either a CustomIpPrefix type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.CustomIpPrefix or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CustomIpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CustomIpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, custom_ip_prefix_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the CustomIpPrefix. Required. + :type custom_ip_prefix_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, custom_ip_prefix_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.CustomIpPrefix: + """Gets the specified custom IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + _request = build_custom_ip_prefixes_get_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.CustomIpPrefix"]: + """Gets all custom IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either CustomIpPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.CustomIpPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_custom_ip_prefixes_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomIpPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CustomIpPrefix"]: + """Gets all the custom IP prefixes in a subscription. + + :return: An iterator like instance of either CustomIpPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.CustomIpPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_custom_ip_prefixes_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomIpPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_custom_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DscpConfigurationOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`dscp_configuration` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: Union[_models.DscpConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.DscpConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DscpConfiguration") + + _request = build_dscp_configuration_create_or_update_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_dscp_configuration_delete_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: Union[_models.DscpConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. Is + either a DscpConfiguration type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.DscpConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DscpConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DscpConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> _models.DscpConfiguration: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :return: DscpConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.DscpConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + + _request = build_dscp_configuration_get_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.DscpConfiguration"]: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either DscpConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DscpConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_dscp_configuration_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DscpConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.DscpConfiguration"]: + """Gets all dscp configurations in a subscription. + + :return: An iterator like instance of either DscpConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.DscpConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_dscp_configuration_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DscpConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class InboundSecurityRuleOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`inbound_security_rule` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: Union[_models.InboundSecurityRule, IO[bytes]], + **kwargs: Any + ) -> _models.InboundSecurityRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundSecurityRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "InboundSecurityRule") + + _request = build_inbound_security_rule_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: Union[_models.InboundSecurityRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Is either a InboundSecurityRule type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.models.InboundSecurityRule or IO[bytes] + :return: An instance of AsyncLROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundSecurityRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InboundSecurityRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InboundSecurityRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class WebCategoriesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`web_categories` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get(self, name: str, *, expand: Optional[str] = None, **kwargs: Any) -> _models.AzureWebCategory: + """Gets the specified Azure Web Category. + + :param name: The name of the azureWebCategory. Required. + :type name: str + :keyword expand: Expands resourceIds back referenced by the azureWebCategory resource. Default + value is None. + :paramtype expand: str + :return: AzureWebCategory or the result of cls(response) + :rtype: ~azure.mgmt.network.models.AzureWebCategory + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AzureWebCategory] = kwargs.pop("cls", None) + + _request = build_web_categories_get_request( + name=name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureWebCategory", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AzureWebCategory"]: + """Gets all the Azure Web Categories in a subscription. + + :return: An iterator like instance of either AzureWebCategory or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AzureWebCategory] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AzureWebCategoryListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_categories_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureWebCategoryListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NatRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nat_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VpnGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGatewayNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(nat_rule_parameters, (IOBase, bytes)): + _content = nat_rule_parameters + else: + _json = self._serialize.body(nat_rule_parameters, "VpnGatewayNatRule") + + _request = build_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nat_rules_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VpnGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Is either a + VpnGatewayNatRule type or a IO[bytes] type. Required. + :type nat_rule_parameters: ~azure.mgmt.network.models.VpnGatewayNatRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + nat_rule_parameters=nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGatewayNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGatewayNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a nat rule. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> _models.VpnGatewayNatRule: + """Retrieves the details of a nat ruleGet. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: VpnGatewayNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnGatewayNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + + _request = build_nat_rules_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_vpn_gateway( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnGatewayNatRule"]: + """Retrieves all nat rules for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either VpnGatewayNatRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnGatewayNatRulesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_rules_list_by_vpn_gateway_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewayNatRulesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworkGatewayNatRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`virtual_network_gateway_nat_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VirtualNetworkGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGatewayNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(nat_rule_parameters, (IOBase, bytes)): + _content = nat_rule_parameters + else: + _json = self._serialize.body(nat_rule_parameters, "VirtualNetworkGatewayNatRule") + + _request = build_virtual_network_gateway_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_nat_rules_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VirtualNetworkGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Is either a + VirtualNetworkGatewayNatRule type or a IO[bytes] type. Required. + :type nat_rule_parameters: ~azure.mgmt.network.models.VirtualNetworkGatewayNatRule + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + nat_rule_parameters=nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGatewayNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGatewayNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a nat rule. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGatewayNatRule: + """Retrieves the details of a nat rule. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: VirtualNetworkGatewayNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualNetworkGatewayNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_nat_rules_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_virtual_network_gateway( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkGatewayNatRule"]: + """Retrieves all nat rules for a particular virtual network gateway. + + :param resource_group_name: The resource group name of the virtual network gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :return: An iterator like instance of either VirtualNetworkGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVirtualNetworkGatewayNatRulesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateway_nat_rules_list_by_virtual_network_gateway_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualNetworkGatewayNatRulesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ActiveConnectivityConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`active_connectivity_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ActiveConfigurationParameter + or IO[bytes] + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveConnectivityConfigurationsListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_active_connectivity_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveConnectivityConfigurationsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ActiveSecurityAdminRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`active_security_admin_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ActiveConfigurationParameter + or IO[bytes] + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_active_security_admin_rules_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ActiveSecurityUserRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`active_security_user_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + **kwargs: Any + ) -> _models.ActiveSecurityUserRulesListResult: + """Lists Active Security User Rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ActiveConfigurationParameter + or IO[bytes] + :return: ActiveSecurityUserRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ActiveSecurityUserRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveSecurityUserRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_active_security_user_rules_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveSecurityUserRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AdminRuleCollectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`admin_rule_collections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: Union[_models.AdminRuleCollection, IO[bytes]], + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Is either a + AdminRuleCollection type or a IO[bytes] type. Required. + :type rule_collection: ~azure.mgmt.network.models.AdminRuleCollection or IO[bytes] + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdminRuleCollection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(rule_collection, (IOBase, bytes)): + _content = rule_collection + else: + _json = self._serialize.body(rule_collection, "AdminRuleCollection") + + _request = build_admin_rule_collections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + **kwargs: Any + ) -> None: + """Deletes an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Gets a network manager security admin configuration rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AdminRuleCollection] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.AdminRuleCollection"]: + """Lists all the rule collections in a security admin configuration, in a paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either AdminRuleCollection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.AdminRuleCollection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AdminRuleCollectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_admin_rule_collections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AdminRuleCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AdminRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`admin_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: Union[_models.BaseAdminRule, IO[bytes]], + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Is either a BaseAdminRule type or a + IO[bytes] type. Required. + :type admin_rule: ~azure.mgmt.network.models.BaseAdminRule or IO[bytes] + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BaseAdminRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(admin_rule, (IOBase, bytes)): + _content = admin_rule + else: + _json = self._serialize.body(admin_rule, "BaseAdminRule") + + _request = build_admin_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + **kwargs: Any + ) -> None: + """Deletes an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rules_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + **kwargs: Any + ) -> _models.BaseAdminRule: + """Gets a network manager security configuration admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.BaseAdminRule] = kwargs.pop("cls", None) + + _request = build_admin_rules_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.BaseAdminRule"]: + """List all network manager security configuration admin rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either BaseAdminRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BaseAdminRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.AdminRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_admin_rules_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AdminRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rules_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ConnectivityConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`connectivity_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: Union[_models.ConnectivityConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Is either a ConnectivityConfiguration type or a IO[bytes] type. + Required. + :type connectivity_configuration: + ~azure.mgmt.network.models.ConnectivityConfiguration or IO[bytes] + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(connectivity_configuration, (IOBase, bytes)): + _content = connectivity_configuration + else: + _json = self._serialize.body(connectivity_configuration, "ConnectivityConfiguration") + + _request = build_connectivity_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> None: + """Deletes a network manager connectivity configuration, specified by the resource group, network + manager name, and connectivity configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Gets a Network Connectivity Configuration, specified by the resource group, network manager + name, and connectivity Configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectivityConfiguration] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ConnectivityConfiguration"]: + """Lists all the network manager connectivity configuration in a specified network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either ConnectivityConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ConnectivityConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connectivity_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectivityConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network manager connectivity configuration, specified by the resource group, network + manager name, and connectivity configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class EffectiveConnectivityConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`effective_connectivity_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryRequestOptions or + IO[bytes] + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_effective_connectivity_configurations_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize( + "NetworkManagerEffectiveConnectivityConfigurationListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class EffectiveVirtualNetworksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`effective_virtual_networks` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list_by_network_group( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + **kwargs: Any + ) -> _models.EffectiveVirtualNetworksListResult: + """Lists all effective virtual networks by specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group to get. Required. + :type network_group_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryRequestOptions or + IO[bytes] + :return: EffectiveVirtualNetworksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.EffectiveVirtualNetworksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveVirtualNetworksListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_effective_virtual_networks_list_by_network_group_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EffectiveVirtualNetworksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def list_by_network_manager( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.EffectiveVirtualNetworksParameter, IO[bytes]], + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> _models.EffectiveVirtualNetworksListResult: + """List effective virtual networks in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Effective Virtual Networks Parameter. Is either a + EffectiveVirtualNetworksParameter type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.models.EffectiveVirtualNetworksParameter or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: EffectiveVirtualNetworksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.EffectiveVirtualNetworksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveVirtualNetworksListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "EffectiveVirtualNetworksParameter") + + _request = build_effective_virtual_networks_list_by_network_manager_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EffectiveVirtualNetworksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: Union[_models.NetworkGroup, IO[bytes]], + *, + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. Is + either a NetworkGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkGroup or IO[bytes] + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkGroup") + + _request = build_network_groups_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if response.status_code == 201: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, network_group_name: str, **kwargs: Any + ) -> None: + """Deletes a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group to get. Required. + :type network_group_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_groups_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, network_group_name: str, **kwargs: Any + ) -> _models.NetworkGroup: + """Gets the specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkGroup] = kwargs.pop("cls", None) + + _request = build_network_groups_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkGroup"]: + """Lists the specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkGroup or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_groups_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_groups_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NetworkManagerCommitsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_manager_commits` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerCommit: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Is either a + NetworkManagerCommit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkManagerCommit or + IO[bytes] + :return: NetworkManagerCommit or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManagerCommit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerCommit") + + _request = build_network_manager_commits_post_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _post_initial( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerCommit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerCommit") + + _request = build_network_manager_commits_post_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Is either a + NetworkManagerCommit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkManagerCommit or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkManagerCommit or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._post_initial( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkManagerCommit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkManagerCommit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkManagerDeploymentStatusOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_manager_deployment_status` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @api_version_validation( + params_valid_on={ + "top": ['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + } + ) + @distributed_trace_async + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerDeploymentStatusParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Is either a NetworkManagerDeploymentStatusParameter type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.models.NetworkManagerDeploymentStatusParameter or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerDeploymentStatusListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerDeploymentStatusParameter") + + _request = build_network_manager_deployment_status_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerDeploymentStatusListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkManagerEffectiveSecurityAdminRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_manager_effective_security_admin_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryRequestOptions or + IO[bytes] + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_manager_effective_security_admin_rules_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerEffectiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkManagersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_managers` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManager, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Is either a + NetworkManager type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkManager or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManager") + + _request = build_network_managers_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, **kwargs: Any + ) -> None: + """Deletes a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_managers_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get(self, resource_group_name: str, network_manager_name: str, **kwargs: Any) -> _models.NetworkManager: + """Gets the specified Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + _request = build_network_managers_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManager"]: + """List network managers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManager or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManagerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_managers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_subscription( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManager"]: + """List all network managers in a subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManager or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManagerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_managers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def patch_tags( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Patch a NetworkManager Tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to update network manager tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.TagsObject or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_managers_patch_tags_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_managers_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_manager_name: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.PatchObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Is either a + PatchObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.PatchObject or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PatchObject") + + _request = build_network_managers_patch_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkSecurityPerimetersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_security_perimeters` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_security_perimeter_name: str, + parameters: Union[_models.NetworkSecurityPerimeter, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityPerimeter: + """Creates or updates a Network Security Perimeter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param parameters: Parameter supplied to create or update the network security perimeter. Is + either a NetworkSecurityPerimeter type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkSecurityPerimeter or + IO[bytes] + :return: NetworkSecurityPerimeter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkSecurityPerimeter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityPerimeter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkSecurityPerimeter") + + _request = build_network_security_perimeters_create_or_update_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkSecurityPerimeter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkSecurityPerimeter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_perimeter_name: str, **kwargs: Any + ) -> None: + """Deletes a network security perimeter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_security_perimeters_delete_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_perimeter_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeter: + """Gets the specified network security perimeter by the name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :return: NetworkSecurityPerimeter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkSecurityPerimeter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NetworkSecurityPerimeter] = kwargs.pop("cls", None) + + _request = build_network_security_perimeters_get_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityPerimeter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkSecurityPerimeter"]: + """List network security perimeters in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkSecurityPerimeter or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkSecurityPerimeter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NetworkSecurityPerimeterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_perimeters_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityPerimeterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace + def list_by_subscription( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkSecurityPerimeter"]: + """List all network security perimeters in a subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkSecurityPerimeter or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkSecurityPerimeter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NetworkSecurityPerimeterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_perimeters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityPerimeterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @distributed_trace_async + async def patch( + self, + resource_group_name: str, + network_security_perimeter_name: str, + parameters: Union[_models.UpdateTagsRequest, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityPerimeter: + """Patch Tags for a Network Security Perimeter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param parameters: Parameter supplied to the network security perimeter. Is either a + UpdateTagsRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.UpdateTagsRequest or IO[bytes] + :return: NetworkSecurityPerimeter or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkSecurityPerimeter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityPerimeter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "UpdateTagsRequest") + + _request = build_network_security_perimeters_patch_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityPerimeter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NspAccessRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_access_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_security_perimeter_name: str, + profile_name: str, + access_rule_name: str, + parameters: Union[_models.NspAccessRule, IO[bytes]], + **kwargs: Any + ) -> _models.NspAccessRule: + """Creates or updates a network access rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :param access_rule_name: The name of the NSP access rule. Required. + :type access_rule_name: str + :param parameters: Parameters that hold the NspAccessRule resource to be created/updated. Is + either a NspAccessRule type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NspAccessRule or IO[bytes] + :return: NspAccessRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspAccessRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NspAccessRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NspAccessRule") + + _request = build_nsp_access_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + access_rule_name=access_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NspAccessRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NspAccessRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_security_perimeter_name: str, + profile_name: str, + access_rule_name: str, + **kwargs: Any + ) -> None: + """Deletes an NSP access rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :param access_rule_name: The name of the NSP access rule. Required. + :type access_rule_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nsp_access_rules_delete_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + access_rule_name=access_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_security_perimeter_name: str, + profile_name: str, + access_rule_name: str, + **kwargs: Any + ) -> _models.NspAccessRule: + """Gets the specified NSP access rule by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :param access_rule_name: The name of the NSP access rule. Required. + :type access_rule_name: str + :return: NspAccessRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspAccessRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspAccessRule] = kwargs.pop("cls", None) + + _request = build_nsp_access_rules_get_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + access_rule_name=access_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NspAccessRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_security_perimeter_name: str, + profile_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NspAccessRule"]: + """Lists the NSP access rules in the specified NSP profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NspAccessRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NspAccessRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspAccessRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nsp_access_rules_list_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NspAccessRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NspAccessRulesReconcileOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_access_rules_reconcile` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def post( + self, + resource_group_name: str, + network_security_perimeter_name: str, + profile_name: str, + access_rule_name: str, + parameters: JSON, + **kwargs: Any + ) -> JSON: + """Reconcile NSP access rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :param access_rule_name: The name of the NSP access rule. Required. + :type access_rule_name: str + :param parameters: Parameters for NSP access rule reconcile. Required. + :type parameters: JSON + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = self._serialize.body(parameters, "object") + + _request = build_nsp_access_rules_reconcile_post_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + access_rule_name=access_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("object", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NspAssociationReconcileOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_association_reconcile` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def post( + self, + resource_group_name: str, + network_security_perimeter_name: str, + association_name: str, + parameters: JSON, + **kwargs: Any + ) -> JSON: + """Reconcile NSP association. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param association_name: The name of the NSP association. Required. + :type association_name: str + :param parameters: Parameters for NSP association reconcile. Required. + :type parameters: JSON + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = self._serialize.body(parameters, "object") + + _request = build_nsp_association_reconcile_post_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("object", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NspAssociationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_associations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_perimeter_name: str, association_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nsp_associations_delete_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_perimeter_name: str, association_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an NSP association resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param association_name: The name of the NSP association. Required. + :type association_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + association_name=association_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_security_perimeter_name: str, + association_name: str, + parameters: Union[_models.NspAssociation, IO[bytes]], + **kwargs: Any + ) -> _models.NspAssociation: + """Creates or updates a NSP resource association. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param association_name: The name of the NSP association. Required. + :type association_name: str + :param parameters: Parameters that hold the NspAssociation resource to be created/updated. Is + either a NspAssociation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NspAssociation or IO[bytes] + :return: NspAssociation or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspAssociation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NspAssociation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NspAssociation") + + _request = build_nsp_associations_create_or_update_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NspAssociation", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NspAssociation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_perimeter_name: str, association_name: str, **kwargs: Any + ) -> _models.NspAssociation: + """Gets the specified NSP association by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param association_name: The name of the NSP association. Required. + :type association_name: str + :return: NspAssociation or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspAssociation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspAssociation] = kwargs.pop("cls", None) + + _request = build_nsp_associations_get_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NspAssociation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_security_perimeter_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NspAssociation"]: + """Lists the NSP resource associations. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NspAssociation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NspAssociation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspAssociationsListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nsp_associations_list_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NspAssociationsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NspLinkReferencesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_link_references` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_perimeter_name: str, link_reference_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nsp_link_references_delete_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_reference_name=link_reference_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_perimeter_name: str, link_reference_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an NSP LinkReference resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param link_reference_name: The name of the NSP linkReference. Required. + :type link_reference_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_reference_name=link_reference_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_perimeter_name: str, link_reference_name: str, **kwargs: Any + ) -> _models.NspLinkReference: + """Gets the specified NSP linkReference resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param link_reference_name: The name of the NSP linkReference. Required. + :type link_reference_name: str + :return: NspLinkReference or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspLinkReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspLinkReference] = kwargs.pop("cls", None) + + _request = build_nsp_link_references_get_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_reference_name=link_reference_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NspLinkReference", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_security_perimeter_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NspLinkReference"]: + """Lists the NSP LinkReference resources in the specified network security perimeter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NspLinkReference or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NspLinkReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspLinkReferenceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nsp_link_references_list_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NspLinkReferenceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NspLinksOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_links` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_perimeter_name: str, link_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nsp_links_delete_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_name=link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_perimeter_name: str, link_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an NSP Link resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param link_name: The name of the NSP link. Required. + :type link_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_name=link_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_security_perimeter_name: str, + link_name: str, + parameters: Union[_models.NspLink, IO[bytes]], + **kwargs: Any + ) -> _models.NspLink: + """Creates or updates NSP link resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param link_name: The name of the NSP link. Required. + :type link_name: str + :param parameters: Parameters that hold the NspLink resource to be created/updated. Is either a + NspLink type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NspLink or IO[bytes] + :return: NspLink or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NspLink] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NspLink") + + _request = build_nsp_links_create_or_update_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_name=link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NspLink", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NspLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_perimeter_name: str, link_name: str, **kwargs: Any + ) -> _models.NspLink: + """Gets the specified NSP link resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param link_name: The name of the NSP link. Required. + :type link_name: str + :return: NspLink or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspLink] = kwargs.pop("cls", None) + + _request = build_nsp_links_get_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + link_name=link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NspLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_security_perimeter_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NspLink"]: + """Lists the NSP Link resources in the specified network security perimeter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NspLink or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NspLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nsp_links_list_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NspLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NspProfilesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`nsp_profiles` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_security_perimeter_name: str, + profile_name: str, + parameters: Union[_models.NspProfile, IO[bytes]], + **kwargs: Any + ) -> _models.NspProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :param parameters: Parameters that hold the NspProfile resource to be created/updated. Is + either a NspProfile type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NspProfile or IO[bytes] + :return: NspProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NspProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NspProfile") + + _request = build_nsp_profiles_create_or_update_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NspProfile", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NspProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_perimeter_name: str, profile_name: str, **kwargs: Any + ) -> None: + """Deletes an NSP profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nsp_profiles_delete_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_perimeter_name: str, profile_name: str, **kwargs: Any + ) -> _models.NspProfile: + """Gets the specified NSP profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :param profile_name: The name of the NSP profile. Required. + :type profile_name: str + :return: NspProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NspProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspProfile] = kwargs.pop("cls", None) + + _request = build_nsp_profiles_get_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + profile_name=profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NspProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_security_perimeter_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NspProfile"]: + """Lists the NSP profiles in the specified network security perimeter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_perimeter_name: The name of the network security perimeter. Required. + :type network_security_perimeter_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NspProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NspProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.NspProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nsp_profiles_list_request( + resource_group_name=resource_group_name, + network_security_perimeter_name=network_security_perimeter_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NspProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PerimeterAssociableResourceTypesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`perimeter_associable_resource_types` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.PerimeterAssociableResource"]: + """Gets the list of resources that are onboarded with NSP. These resources can be associated with + a network security perimeter. + + :param location: The location of network security perimeter. Required. + :type location: str + :return: An iterator like instance of either PerimeterAssociableResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.PerimeterAssociableResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.PerimeterAssociableResourcesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_perimeter_associable_resource_types_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PerimeterAssociableResourcesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityAdminConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`security_admin_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: Union[_models.SecurityAdminConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. Is + either a SecurityAdminConfiguration type or a IO[bytes] type. Required. + :type security_admin_configuration: + ~azure.mgmt.network.models.SecurityAdminConfiguration or IO[bytes] + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAdminConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_admin_configuration, (IOBase, bytes)): + _content = security_admin_configuration + else: + _json = self._serialize.body(security_admin_configuration, "SecurityAdminConfiguration") + + _request = build_security_admin_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2021-02-01-preview'], + ) + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> None: + """Deletes a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Retrieves a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityAdminConfiguration] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SecurityAdminConfiguration"]: + """Lists all the network manager security admin configurations in a network manager, in a + paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either SecurityAdminConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.SecurityAdminConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SecurityAdminConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_admin_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityAdminConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class SecurityUserConfigurationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`security_user_configurations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_user_configuration: Union[_models.SecurityConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityConfiguration: + """Creates or updates a network manager security user configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param security_user_configuration: The security user configuration to create or update. Is + either a SecurityConfiguration type or a IO[bytes] type. Required. + :type security_user_configuration: + ~azure.mgmt.network.models.SecurityConfiguration or IO[bytes] + :return: SecurityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_user_configuration, (IOBase, bytes)): + _content = security_user_configuration + else: + _json = self._serialize.body(security_user_configuration, "SecurityConfiguration") + + _request = build_security_user_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> None: + """Deletes a network manager security user configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_user_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.SecurityConfiguration: + """Retrieves a network manager security user configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :return: SecurityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SecurityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.SecurityConfiguration] = kwargs.pop("cls", None) + + _request = build_security_user_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SecurityConfiguration"]: + """Lists all the network manager security user configurations in a network manager, in a paginated + format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either SecurityConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.SecurityConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.SecurityConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_user_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class UserRuleCollectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`user_rule_collections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + user_rule_collection: Union[_models.RuleCollection, IO[bytes]], + **kwargs: Any + ) -> _models.RuleCollection: + """Creates or updates a user rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param user_rule_collection: The User Rule Collection to create or update. Is either a + RuleCollection type or a IO[bytes] type. Required. + :type user_rule_collection: ~azure.mgmt.network.models.RuleCollection or + IO[bytes] + :return: RuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RuleCollection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(user_rule_collection, (IOBase, bytes)): + _content = user_rule_collection + else: + _json = self._serialize.body(user_rule_collection, "RuleCollection") + + _request = build_user_rule_collections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RuleCollection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + **kwargs: Any + ) -> None: + """Deletes a user rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_user_rule_collections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + **kwargs: Any + ) -> _models.RuleCollection: + """Gets a network manager security user configuration rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :return: RuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.RuleCollection] = kwargs.pop("cls", None) + + _request = build_user_rule_collections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.RuleCollection"]: + """Lists all the user rule collections in a security configuration, in a paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either RuleCollection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RuleCollection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.RuleCollectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_user_rule_collections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RuleCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class UserRulesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`user_rules` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + user_rule: Union[_models.BaseUserRule, IO[bytes]], + **kwargs: Any + ) -> _models.BaseUserRule: + """Creates or updates a user rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param user_rule: The user rule to create or update. Is either a BaseUserRule type or a + IO[bytes] type. Required. + :type user_rule: ~azure.mgmt.network.models.BaseUserRule or IO[bytes] + :return: BaseUserRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BaseUserRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BaseUserRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(user_rule, (IOBase, bytes)): + _content = user_rule + else: + _json = self._serialize.body(user_rule, "BaseUserRule") + + _request = build_user_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BaseUserRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BaseUserRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + **kwargs: Any + ) -> None: + """Deletes a user rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_user_rules_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + **kwargs: Any + ) -> _models.BaseUserRule: + """Gets a user rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: BaseUserRule or the result of cls(response) + :rtype: ~azure.mgmt.network.models.BaseUserRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.BaseUserRule] = kwargs.pop("cls", None) + + _request = build_user_rules_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BaseUserRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.BaseUserRule"]: + """Lists all user rules in a rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either BaseUserRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BaseUserRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") + ) + cls: ClsType[_models.UserRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_user_rules_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("UserRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ApplicationGatewayWafDynamicManifestsDefaultOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`application_gateway_waf_dynamic_manifests_default` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get(self, location: str, **kwargs: Any) -> _models.ApplicationGatewayWafDynamicManifestResult: + """Gets the regional application gateway waf manifest. + + :param location: The region where the nrp are located at. Required. + :type location: str + :return: ApplicationGatewayWafDynamicManifestResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ApplicationGatewayWafDynamicManifestResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayWafDynamicManifestResult] = kwargs.pop("cls", None) + + _request = build_application_gateway_waf_dynamic_manifests_default_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayWafDynamicManifestResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ApplicationGatewayWafDynamicManifestsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`application_gateway_waf_dynamic_manifests` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def get(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ApplicationGatewayWafDynamicManifestResult"]: + """Gets the regional application gateway waf manifest. + + :param location: The region where the nrp are located at. Required. + :type location: str + :return: An iterator like instance of either ApplicationGatewayWafDynamicManifestResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ApplicationGatewayWafDynamicManifestResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ApplicationGatewayWafDynamicManifestResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_waf_dynamic_manifests_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayWafDynamicManifestResultList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ConfigurationPolicyGroupsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`configuration_policy_groups` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: Union[_models.VpnServerConfigurationPolicyGroup, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfigurationPolicyGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_policy_group_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_policy_group_parameters + else: + _json = self._serialize.body( + vpn_server_configuration_policy_group_parameters, "VpnServerConfigurationPolicyGroup" + ) + + _request = build_configuration_policy_groups_create_or_update_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_configuration_policy_groups_delete_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: Union[_models.VpnServerConfigurationPolicyGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Is either a VpnServerConfigurationPolicyGroup type + or a IO[bytes] type. Required. + :type vpn_server_configuration_policy_group_parameters: + ~azure.mgmt.network.models.VpnServerConfigurationPolicyGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationPolicyGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + vpn_server_configuration_policy_group_parameters=vpn_server_configuration_policy_group_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a ConfigurationPolicyGroup. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> _models.VpnServerConfigurationPolicyGroup: + """Retrieves the details of a ConfigurationPolicyGroup. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup being + retrieved. Required. + :type configuration_policy_group_name: str + :return: VpnServerConfigurationPolicyGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VpnServerConfigurationPolicyGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + + _request = build_configuration_policy_groups_get_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list_by_vpn_server_configuration( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnServerConfigurationPolicyGroup"]: + """Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :return: An iterator like instance of either VpnServerConfigurationPolicyGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListVpnServerConfigurationPolicyGroupsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_configuration_policy_groups_list_by_vpn_server_configuration_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationPolicyGroupsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRoutePortAuthorizationsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_port_authorizations` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRoutePortAuthorization, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePortAuthorization: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(authorization_parameters, (IOBase, bytes)): + _content = authorization_parameters + else: + _json = self._serialize.body(authorization_parameters, "ExpressRoutePortAuthorization") + + _request = build_express_route_port_authorizations_create_or_update_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_port_authorizations_delete_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRoutePortAuthorization, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Is either a ExpressRoutePortAuthorization type or a IO[bytes] type. + Required. + :type authorization_parameters: + ~azure.mgmt.network.models.ExpressRoutePortAuthorization or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRoutePortAuthorization].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRoutePortAuthorization]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified authorization from the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> _models.ExpressRoutePortAuthorization: + """Gets the specified authorization from the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: ExpressRoutePortAuthorization or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRoutePortAuthorization + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + + _request = build_express_route_port_authorizations_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRoutePortAuthorization"]: + """Gets all authorizations in an express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :return: An iterator like instance of either ExpressRoutePortAuthorization or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRoutePortAuthorizationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_port_authorizations_list_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortAuthorizationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteProviderPortsLocationOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`express_route_provider_ports_location` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list(self, *, filter: Optional[str] = None, **kwargs: Any) -> _models.ExpressRouteProviderPortListResult: + """Retrieves all the ExpressRouteProviderPorts in a subscription. + + :keyword filter: The filter to apply on the operation. For example, you can use + $filter=location eq '{state}'. Default value is None. + :paramtype filter: str + :return: ExpressRouteProviderPortListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteProviderPortListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ExpressRouteProviderPortListResult] = kwargs.pop("cls", None) + + _request = build_express_route_provider_ports_location_list_request( + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteProviderPortListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesFilterValuesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures_filter_values` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignatureOverridesFilterValuesQuery, IO[bytes]], + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Is either a SignatureOverridesFilterValuesQuery type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.models.SignatureOverridesFilterValuesQuery or + IO[bytes] + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignatureOverridesFilterValuesResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignatureOverridesFilterValuesQuery") + + _request = build_firewall_policy_idps_signatures_filter_values_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignatureOverridesFilterValuesResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.IDPSQueryObject, IO[bytes]], + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Is either a IDPSQueryObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.IDPSQueryObject or IO[bytes] + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResults] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IDPSQueryObject") + + _request = build_firewall_policy_idps_signatures_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("QueryResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesOverridesOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures_overrides` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> _models.SignaturesOverrides: + """Returns all signatures overrides for a specific policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + _request = build_firewall_policy_idps_signatures_overrides_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> _models.SignaturesOverridesList: + """Returns all signatures overrides objects for a specific policy as a list containing a single + value. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: SignaturesOverridesList or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SignaturesOverridesList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SignaturesOverridesList] = kwargs.pop("cls", None) + + _request = build_firewall_policy_idps_signatures_overrides_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverridesList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignaturesOverrides, IO[bytes]], + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Is either a + SignaturesOverrides type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.SignaturesOverrides or IO[bytes] + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignaturesOverrides") + + _request = build_firewall_policy_idps_signatures_overrides_patch_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignaturesOverrides, IO[bytes]], + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Is either a + SignaturesOverrides type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.SignaturesOverrides or IO[bytes] + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignaturesOverrides") + + _request = build_firewall_policy_idps_signatures_overrides_put_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ManagementGroupNetworkManagerConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`management_group_network_manager_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: Union[_models.NetworkManagerConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Is either a + NetworkManagerConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkManagerConnection or IO[bytes] + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerConnection") + + _request = build_management_group_network_manager_connections_create_or_update_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, management_group_id: str, network_manager_connection_name: str, **kwargs: Any + ) -> None: + """Delete specified pending connection created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_management_group_network_manager_connections_delete_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, management_group_id: str, network_manager_connection_name: str, **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Get a specified connection created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + _request = build_management_group_network_manager_connections_get_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, management_group_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManagerConnection"]: + """List all network manager connections created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManagerConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkManagerConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManagerConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_management_group_network_manager_connections_list_request( + management_group_id=management_group_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RouteMapsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`route_maps` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: Union[_models.RouteMap, IO[bytes]], + **kwargs: Any + ) -> _models.RouteMap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_map_parameters, (IOBase, bytes)): + _content = route_map_parameters + else: + _json = self._serialize.body(route_map_parameters, "RouteMap") + + _request = build_route_maps_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteMap", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteMap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_maps_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: Union[_models.RouteMap, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Is either a + RouteMap type or a IO[bytes] type. Required. + :type route_map_parameters: ~azure.mgmt.network.models.RouteMap or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteMap or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + route_map_parameters=route_map_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteMap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteMap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteMap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a RouteMap. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> _models.RouteMap: + """Retrieves the details of a RouteMap. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :return: RouteMap or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RouteMap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + + _request = build_route_maps_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteMap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> AsyncIterable["_models.RouteMap"]: + """Retrieves the details of all RouteMaps. + + :param resource_group_name: The resource group name of the RouteMap's resource group'. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either RouteMap or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListRouteMapsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_maps_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListRouteMapsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RoutingIntentOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`routing_intent` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: Union[_models.RoutingIntent, IO[bytes]], + **kwargs: Any + ) -> _models.RoutingIntent: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(routing_intent_parameters, (IOBase, bytes)): + _content = routing_intent_parameters + else: + _json = self._serialize.body(routing_intent_parameters, "RoutingIntent") + + _request = build_routing_intent_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routing_intent_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: Union[_models.RoutingIntent, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. Is + either a RoutingIntent type or a IO[bytes] type. Required. + :type routing_intent_parameters: ~azure.mgmt.network.models.RoutingIntent or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + routing_intent_parameters=routing_intent_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RoutingIntent", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RoutingIntent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RoutingIntent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the RoutingIntent. Required. + :type routing_intent_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> _models.RoutingIntent: + """Retrieves the details of a RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the RoutingIntent. Required. + :type routing_intent_name: str + :return: RoutingIntent or the result of cls(response) + :rtype: ~azure.mgmt.network.models.RoutingIntent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + + _request = build_routing_intent_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.RoutingIntent"]: + """Retrieves the details of all RoutingIntent child resources of the VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either RoutingIntent or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ListRoutingIntentResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_routing_intent_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListRoutingIntentResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ScopeConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`scope_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: Union[_models.ScopeConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Is either a ScopeConnection type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ScopeConnection or IO[bytes] + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScopeConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ScopeConnection") + + _request = build_scope_connections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, scope_connection_name: str, **kwargs: Any + ) -> None: + """Delete the pending scope connection created by this network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_scope_connections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, scope_connection_name: str, **kwargs: Any + ) -> _models.ScopeConnection: + """Get specified scope connection created by this Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ScopeConnection] = kwargs.pop("cls", None) + + _request = build_scope_connections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ScopeConnection"]: + """List all scope connections created by this network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either ScopeConnection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ScopeConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ScopeConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_scope_connections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ScopeConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServiceTagInformationOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`service_tag_information` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace + def list( + self, + location: str, + *, + no_address_prefixes: Optional[bool] = None, + tag_name: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ServiceTagInformation"]: + """Gets a list of service tag information resources with pagination. + + :param location: The location that will be used as a reference for cloud (not as a filter based + on location, you will get the list of service tags with prefix details across all regions but + limited to the cloud that your subscription belongs to). Required. + :type location: str + :keyword no_address_prefixes: Do not return address prefixes for the tag(s). Default value is + None. + :paramtype no_address_prefixes: bool + :keyword tag_name: Return tag information for a particular tag. Default value is None. + :paramtype tag_name: str + :return: An iterator like instance of either ServiceTagInformation or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.ServiceTagInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.ServiceTagInformationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_tag_information_list_request( + location=location, + subscription_id=self._config.subscription_id, + no_address_prefixes=no_address_prefixes, + tag_name=tag_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceTagInformationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class StaticMembersOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`static_members` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: Union[_models.StaticMember, IO[bytes]], + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Is either a + StaticMember type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.StaticMember or IO[bytes] + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StaticMember] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "StaticMember") + + _request = build_static_members_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("StaticMember", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("StaticMember", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + **kwargs: Any + ) -> None: + """Deletes a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_static_members_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + **kwargs: Any + ) -> _models.StaticMember: + """Gets the specified static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.StaticMember] = kwargs.pop("cls", None) + + _request = build_static_members_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("StaticMember", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.StaticMember"]: + """Lists the specified static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either StaticMember or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.StaticMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.StaticMemberListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_static_members_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("StaticMemberListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SubscriptionNetworkManagerConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`subscription_network_manager_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + network_manager_connection_name: str, + parameters: Union[_models.NetworkManagerConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Is either a + NetworkManagerConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.NetworkManagerConnection or IO[bytes] + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerConnection") + + _request = build_subscription_network_manager_connections_create_or_update_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, network_manager_connection_name: str, **kwargs: Any + ) -> None: + """Delete specified connection created by this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_subscription_network_manager_connections_delete_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get(self, network_manager_connection_name: str, **kwargs: Any) -> _models.NetworkManagerConnection: + """Get a specified connection created by this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + _request = build_subscription_network_manager_connections_get_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManagerConnection"]: + """List all network manager connections created by this subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManagerConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkManagerConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkManagerConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subscription_network_manager_connections_list_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VipSwapOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`vip_swap` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_initial( # pylint: disable=inconsistent-return-statements + self, group_name: str, resource_name: str, parameters: Union[_models.SwapResource, IO[bytes]], **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SwapResource") + + _request = build_vip_swap_create_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + singleton_resource=singleton_resource, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def begin_create( + self, group_name: str, resource_name: str, parameters: Union[_models.SwapResource, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Is either a SwapResource type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.SwapResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + group_name=group_name, + resource_name=resource_name, + parameters=parameters, + singleton_resource=singleton_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get(self, group_name: str, resource_name: str, **kwargs: Any) -> _models.SwapResource: + """Gets the SwapResource which identifies the slot type for the specified cloud service. The slot + type on a cloud service can either be Staging or Production. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :return: SwapResource or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SwapResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SwapResource] = kwargs.pop("cls", None) + + _request = build_vip_swap_get_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + singleton_resource=singleton_resource, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SwapResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def list(self, group_name: str, resource_name: str, **kwargs: Any) -> _models.SwapResourceListResult: + """Gets the list of SwapResource which identifies the slot type for the specified cloud service. + The slot type on a cloud service can either be Staging or Production. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :return: SwapResourceListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.SwapResourceListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.SwapResourceListResult] = kwargs.pop("cls", None) + + _request = build_vip_swap_list_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SwapResourceListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkVirtualApplianceConnectionsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`network_virtual_appliance_connections` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: Union[_models.NetworkVirtualApplianceConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualApplianceConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(network_virtual_appliance_connection_parameters, (IOBase, bytes)): + _content = network_virtual_appliance_connection_parameters + else: + _json = self._serialize.body( + network_virtual_appliance_connection_parameters, "NetworkVirtualApplianceConnection" + ) + + _request = build_network_virtual_appliance_connections_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliance_connections_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: Union[_models.NetworkVirtualApplianceConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Is either a NetworkVirtualApplianceConnection + type or a IO[bytes] type. Required. + :type network_virtual_appliance_connection_parameters: + ~azure.mgmt.network.models.NetworkVirtualApplianceConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkVirtualApplianceConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + network_virtual_appliance_connection_parameters=network_virtual_appliance_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkVirtualApplianceConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkVirtualApplianceConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a NVA connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> _models.NetworkVirtualApplianceConnection: + """Retrieves the details of specified NVA connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :return: NetworkVirtualApplianceConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.models.NetworkVirtualApplianceConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliance_connections_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace + def list( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkVirtualApplianceConnection"]: + """Lists NetworkVirtualApplianceConnections under the NVA. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An iterator like instance of either NetworkVirtualApplianceConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.NetworkVirtualApplianceConnectionList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliance_connections_list_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceConnectionList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FirewallPolicyDeploymentsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_deployments` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + async def _deploy_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_deployments_deploy_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @distributed_trace_async + async def begin_deploy( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deploys the firewall policy draft and child rule collection group drafts. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._deploy_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class FirewallPolicyDraftsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_drafts` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicyDraft, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicyDraft: + """Create or update a draft Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy Draft operation. + Is either a FirewallPolicyDraft type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FirewallPolicyDraft or IO[bytes] + :return: FirewallPolicyDraft or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicyDraft + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyDraft] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicyDraft") + + _request = build_firewall_policy_drafts_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicyDraft", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicyDraft", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> None: + """Delete a draft policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_drafts_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> _models.FirewallPolicyDraft: + """Get a draft Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: FirewallPolicyDraft or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicyDraft + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicyDraft] = kwargs.pop("cls", None) + + _request = build_firewall_policy_drafts_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicyDraft", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyRuleCollectionGroupDraftsOperations: + """ + + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.aio.NetworkManagementClient`'s + :attr:`firewall_policy_rule_collection_group_drafts` attribute. + + """ + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroupDraft, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroupDraft: + """Create or Update Rule Collection Group Draft. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Is either a FirewallPolicyRuleCollectionGroupDraft + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroupDraft + or IO[bytes] + :return: FirewallPolicyRuleCollectionGroupDraft or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroupDraft + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroupDraft] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicyRuleCollectionGroupDraft") + + _request = build_firewall_policy_rule_collection_group_drafts_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroupDraft", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroupDraft", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> None: + """Delete Rule Collection Group Draft. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_group_drafts_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroupDraft: + """Get Rule Collection Group Draft. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: FirewallPolicyRuleCollectionGroupDraft or the result of cls(response) + :rtype: ~azure.mgmt.network.models.FirewallPolicyRuleCollectionGroupDraft + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroupDraft] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_group_drafts_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroupDraft", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkManagementClientOperationsMixin(NetworkManagementClientMixinABC): + def _api_version(self, op_name: str) -> str: + return self._get_api_version(op_name) + + @api_version_validation( + method_valid_on=['2015-06-15', '2017-10-01', '2018-04-01', '2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def check_dns_name_availability( + self, location: str, *, domain_name_label: str, **kwargs: Any + ) -> _models.DnsNameAvailabilityResult: + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + + :param location: The location of the domain name. Required. + :type location: str + :keyword domain_name_label: The domain name to be verified. It must conform to the following + regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Required. + :paramtype domain_name_label: str + :return: DnsNameAvailabilityResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.DnsNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_dns_name_availability") or "2023-11-01") + ) + cls: ClsType[_models.DnsNameAvailabilityResult] = kwargs.pop("cls", None) + + _request = build_network_management_check_dns_name_availability_request( + location=location, + subscription_id=self._config.subscription_id, + domain_name_label=domain_name_label, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DnsNameAvailabilityResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2018-11-01', '2018-12-01', '2019-02-01', '2019-04-01', '2019-06-01', '2019-07-01', '2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def supported_security_providers( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> _models.VirtualWanSecurityProviders: + """Gives the supported security providers for the virtual wan. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which supported security providers are + needed. Required. + :type virtual_wan_name: str + :return: VirtualWanSecurityProviders or the result of cls(response) + :rtype: ~azure.mgmt.network.models.VirtualWanSecurityProviders + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("supported_security_providers") or "2023-11-01") + ) + cls: ClsType[_models.VirtualWanSecurityProviders] = kwargs.pop("cls", None) + + _request = build_network_management_supported_security_providers_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWanSecurityProviders", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnProfileResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("_generatevirtualwanvpnserverconfigurationvpnprofile_initial") or "2023-11-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnProfileResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_client_params, (IOBase, bytes)): + _content = vpn_client_params + else: + _json = self._serialize.body(vpn_client_params, "VirtualWanVpnProfileParameters") + + _request = build_network_management_generatevirtualwanvpnserverconfigurationvpnprofile_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-08-01', '2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required. + :type vpn_client_params: ~azure.mgmt.network.models.VirtualWanVpnProfileParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("begin_generatevirtualwanvpnserverconfigurationvpnprofile") or "2023-11-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnProfileResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generatevirtualwanvpnserverconfigurationvpnprofile_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + vpn_client_params=vpn_client_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnProfileResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnProfileResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + async def _delete_bastion_shareable_link_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("_delete_bastion_shareable_link_initial") or "2023-11-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + _request = build_network_management_delete_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + + async def _get_active_sessions_initial( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> Optional[_models.BastionActiveSessionListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("_get_active_sessions_initial") or "2023-11-01") + ) + cls: ClsType[Optional[_models.BastionActiveSessionListResult]] = kwargs.pop("cls", None) + + _request = build_network_management_get_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionActiveSessionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _put_bastion_shareable_link_initial( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.BastionShareableLinkListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("_put_bastion_shareable_link_initial") or "2023-11-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BastionShareableLinkListResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + _request = build_network_management_put_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("begin_delete_bastion_shareable_link") or "2023-11-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_bastion_shareable_link_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_get_active_sessions( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.BastionActiveSession"]]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionActiveSessionListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BastionActiveSession]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("begin_get_active_sessions") or "2023-11-01") + ) + cls: ClsType[_models.BastionActiveSessionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_get_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionActiveSessionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_active_sessions_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[AsyncIterable["_models.BastionActiveSession"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncIterable["_models.BastionActiveSession"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("begin_put_bastion_shareable_link") or "2023-11-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionShareableLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_put_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._put_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: Union[_models.SessionIds, IO[bytes]], + **kwargs: Any + ) -> AsyncIterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Is either a SessionIds type or a + IO[bytes] type. Required. + :type session_ids: ~azure.mgmt.network.models.SessionIds or IO[bytes] + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("disconnect_active_sessions") or "2023-11-01") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionSessionDeleteResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(session_ids, (IOBase, bytes)): + _content = session_ids + else: + _json = self._serialize.body(session_ids, "SessionIds") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_disconnect_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionSessionDeleteResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2019-09-01', '2019-11-01', '2019-12-01', '2020-03-01', '2020-04-01', '2020-05-01', '2020-06-01', '2020-07-01', '2020-08-01', '2020-11-01', '2021-02-01', '2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncIterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("get_bastion_shareable_link") or "2023-11-01") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionShareableLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_get_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def express_route_provider_port(self, providerport: str, **kwargs: Any) -> _models.ExpressRouteProviderPort: + """Retrieves detail of a provider port. + + :param providerport: The name of the provider port. Required. + :type providerport: str + :return: ExpressRouteProviderPort or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ExpressRouteProviderPort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("express_route_provider_port") or "2023-11-01") + ) + cls: ClsType[_models.ExpressRouteProviderPort] = kwargs.pop("cls", None) + + _request = build_network_management_express_route_provider_port_request( + providerport=providerport, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteProviderPort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ActiveConfigurationParameter or + IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("list_active_connectivity_configurations") or "2023-11-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveConnectivityConfigurationsListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_network_management_list_active_connectivity_configurations_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveConnectivityConfigurationsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.ActiveConfigurationParameter or + IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("list_active_security_admin_rules") or "2023-11-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_network_management_list_active_security_admin_rules_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryRequestOptions or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("list_network_manager_effective_connectivity_configurations") or "2023-11-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_management_list_network_manager_effective_connectivity_configurations_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize( + "NetworkManagerEffectiveConnectivityConfigurationListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + @api_version_validation( + method_valid_on=['2023-02-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.models.QueryRequestOptions or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("list_network_manager_effective_security_admin_rules") or "2023-11-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_management_list_network_manager_effective_security_admin_rules_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerEffectiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + + async def _delete_bastion_shareable_link_by_token_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("_delete_bastion_shareable_link_by_token_initial") or "2023-11-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_token_request, (IOBase, bytes)): + _content = bsl_token_request + else: + _json = self._serialize.body(bsl_token_request, "BastionShareableLinkTokenListRequest") + + _request = build_network_management_delete_bastion_shareable_link_by_token_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + + @api_version_validation( + method_valid_on=['2023-06-01', '2023-09-01', '2023-11-01'], + ) + @distributed_trace_async + async def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is + either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required. + :type bsl_token_request: + ~azure.mgmt.network.models.BastionShareableLinkTokenListRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("begin_delete_bastion_shareable_link_by_token") or "2023-11-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_bastion_shareable_link_by_token_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_token_request=bsl_token_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/py.typed b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/__init__.py new file mode 100644 index 00000000000..22f85294640 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._network_management_client import NetworkManagementClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NetworkManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_configuration.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_configuration.py new file mode 100644 index 00000000000..3966cf6871e --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class NetworkManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for NetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft + Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-network/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_metadata.json b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_metadata.json new file mode 100644 index 00000000000..033988bc0f2 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_metadata.json @@ -0,0 +1,496 @@ +{ + "chosen_version": "2023-09-01", + "total_api_version_list": ["2018-10-01", "2023-09-01"], + "client": { + "name": "NetworkManagementClient", + "filename": "_network_management_client", + "description": "Network Client.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, + "azure_arm": true, + "has_public_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"NetworkManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"NetworkManagementClientOperationsMixin\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"NetworkManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"NetworkManagementClientOperationsMixin\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true, + "method_location": "positional" + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.", + "docstring_type": "str", + "required": true, + "method_location": "positional" + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version: Optional[str]=None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles=KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "application_gateways": "ApplicationGatewaysOperations", + "application_gateway_private_link_resources": "ApplicationGatewayPrivateLinkResourcesOperations", + "application_gateway_private_endpoint_connections": "ApplicationGatewayPrivateEndpointConnectionsOperations", + "application_gateway_waf_dynamic_manifests_default": "ApplicationGatewayWafDynamicManifestsDefaultOperations", + "application_gateway_waf_dynamic_manifests": "ApplicationGatewayWafDynamicManifestsOperations", + "application_security_groups": "ApplicationSecurityGroupsOperations", + "available_delegations": "AvailableDelegationsOperations", + "available_resource_group_delegations": "AvailableResourceGroupDelegationsOperations", + "available_service_aliases": "AvailableServiceAliasesOperations", + "azure_firewalls": "AzureFirewallsOperations", + "azure_firewall_fqdn_tags": "AzureFirewallFqdnTagsOperations", + "web_categories": "WebCategoriesOperations", + "bastion_hosts": "BastionHostsOperations", + "network_interfaces": "NetworkInterfacesOperations", + "public_ip_addresses": "PublicIPAddressesOperations", + "vip_swap": "VipSwapOperations", + "custom_ip_prefixes": "CustomIPPrefixesOperations", + "ddos_custom_policies": "DdosCustomPoliciesOperations", + "ddos_protection_plans": "DdosProtectionPlansOperations", + "dscp_configuration": "DscpConfigurationOperations", + "available_endpoint_services": "AvailableEndpointServicesOperations", + "express_route_circuit_authorizations": "ExpressRouteCircuitAuthorizationsOperations", + "express_route_circuit_peerings": "ExpressRouteCircuitPeeringsOperations", + "express_route_circuit_connections": "ExpressRouteCircuitConnectionsOperations", + "peer_express_route_circuit_connections": "PeerExpressRouteCircuitConnectionsOperations", + "express_route_circuits": "ExpressRouteCircuitsOperations", + "express_route_service_providers": "ExpressRouteServiceProvidersOperations", + "express_route_cross_connections": "ExpressRouteCrossConnectionsOperations", + "express_route_cross_connection_peerings": "ExpressRouteCrossConnectionPeeringsOperations", + "express_route_ports_locations": "ExpressRoutePortsLocationsOperations", + "express_route_ports": "ExpressRoutePortsOperations", + "express_route_links": "ExpressRouteLinksOperations", + "express_route_port_authorizations": "ExpressRoutePortAuthorizationsOperations", + "express_route_provider_ports_location": "ExpressRouteProviderPortsLocationOperations", + "firewall_policies": "FirewallPoliciesOperations", + "firewall_policy_rule_collection_groups": "FirewallPolicyRuleCollectionGroupsOperations", + "firewall_policy_idps_signatures": "FirewallPolicyIdpsSignaturesOperations", + "firewall_policy_idps_signatures_overrides": "FirewallPolicyIdpsSignaturesOverridesOperations", + "firewall_policy_idps_signatures_filter_values": "FirewallPolicyIdpsSignaturesFilterValuesOperations", + "ip_allocations": "IpAllocationsOperations", + "ip_groups": "IpGroupsOperations", + "load_balancers": "LoadBalancersOperations", + "load_balancer_backend_address_pools": "LoadBalancerBackendAddressPoolsOperations", + "load_balancer_frontend_ip_configurations": "LoadBalancerFrontendIPConfigurationsOperations", + "inbound_nat_rules": "InboundNatRulesOperations", + "load_balancer_load_balancing_rules": "LoadBalancerLoadBalancingRulesOperations", + "load_balancer_outbound_rules": "LoadBalancerOutboundRulesOperations", + "load_balancer_network_interfaces": "LoadBalancerNetworkInterfacesOperations", + "load_balancer_probes": "LoadBalancerProbesOperations", + "nat_gateways": "NatGatewaysOperations", + "network_interface_ip_configurations": "NetworkInterfaceIPConfigurationsOperations", + "network_interface_load_balancers": "NetworkInterfaceLoadBalancersOperations", + "network_interface_tap_configurations": "NetworkInterfaceTapConfigurationsOperations", + "network_managers": "NetworkManagersOperations", + "network_manager_commits": "NetworkManagerCommitsOperations", + "network_manager_deployment_status": "NetworkManagerDeploymentStatusOperations", + "subscription_network_manager_connections": "SubscriptionNetworkManagerConnectionsOperations", + "management_group_network_manager_connections": "ManagementGroupNetworkManagerConnectionsOperations", + "connectivity_configurations": "ConnectivityConfigurationsOperations", + "network_groups": "NetworkGroupsOperations", + "static_members": "StaticMembersOperations", + "scope_connections": "ScopeConnectionsOperations", + "security_admin_configurations": "SecurityAdminConfigurationsOperations", + "admin_rule_collections": "AdminRuleCollectionsOperations", + "admin_rules": "AdminRulesOperations", + "network_profiles": "NetworkProfilesOperations", + "network_security_groups": "NetworkSecurityGroupsOperations", + "security_rules": "SecurityRulesOperations", + "default_security_rules": "DefaultSecurityRulesOperations", + "network_virtual_appliances": "NetworkVirtualAppliancesOperations", + "virtual_appliance_sites": "VirtualApplianceSitesOperations", + "virtual_appliance_skus": "VirtualApplianceSkusOperations", + "inbound_security_rule": "InboundSecurityRuleOperations", + "network_watchers": "NetworkWatchersOperations", + "packet_captures": "PacketCapturesOperations", + "connection_monitors": "ConnectionMonitorsOperations", + "flow_logs": "FlowLogsOperations", + "operations": "Operations", + "private_endpoints": "PrivateEndpointsOperations", + "available_private_endpoint_types": "AvailablePrivateEndpointTypesOperations", + "private_dns_zone_groups": "PrivateDnsZoneGroupsOperations", + "private_link_services": "PrivateLinkServicesOperations", + "public_ip_prefixes": "PublicIPPrefixesOperations", + "route_filters": "RouteFiltersOperations", + "route_filter_rules": "RouteFilterRulesOperations", + "route_tables": "RouteTablesOperations", + "routes": "RoutesOperations", + "security_partner_providers": "SecurityPartnerProvidersOperations", + "bgp_service_communities": "BgpServiceCommunitiesOperations", + "service_endpoint_policies": "ServiceEndpointPoliciesOperations", + "service_endpoint_policy_definitions": "ServiceEndpointPolicyDefinitionsOperations", + "service_tags": "ServiceTagsOperations", + "service_tag_information": "ServiceTagInformationOperations", + "usages": "UsagesOperations", + "virtual_networks": "VirtualNetworksOperations", + "subnets": "SubnetsOperations", + "resource_navigation_links": "ResourceNavigationLinksOperations", + "service_association_links": "ServiceAssociationLinksOperations", + "virtual_network_peerings": "VirtualNetworkPeeringsOperations", + "virtual_network_gateways": "VirtualNetworkGatewaysOperations", + "virtual_network_gateway_connections": "VirtualNetworkGatewayConnectionsOperations", + "local_network_gateways": "LocalNetworkGatewaysOperations", + "virtual_network_gateway_nat_rules": "VirtualNetworkGatewayNatRulesOperations", + "virtual_network_taps": "VirtualNetworkTapsOperations", + "virtual_routers": "VirtualRoutersOperations", + "virtual_router_peerings": "VirtualRouterPeeringsOperations", + "virtual_wans": "VirtualWansOperations", + "vpn_sites": "VpnSitesOperations", + "vpn_site_links": "VpnSiteLinksOperations", + "vpn_sites_configuration": "VpnSitesConfigurationOperations", + "vpn_server_configurations": "VpnServerConfigurationsOperations", + "configuration_policy_groups": "ConfigurationPolicyGroupsOperations", + "virtual_hubs": "VirtualHubsOperations", + "route_maps": "RouteMapsOperations", + "hub_virtual_network_connections": "HubVirtualNetworkConnectionsOperations", + "vpn_gateways": "VpnGatewaysOperations", + "vpn_link_connections": "VpnLinkConnectionsOperations", + "vpn_connections": "VpnConnectionsOperations", + "vpn_site_link_connections": "VpnSiteLinkConnectionsOperations", + "nat_rules": "NatRulesOperations", + "p2_svpn_gateways": "P2SVpnGatewaysOperations", + "vpn_server_configurations_associated_with_virtual_wan": "VpnServerConfigurationsAssociatedWithVirtualWanOperations", + "virtual_hub_route_table_v2_s": "VirtualHubRouteTableV2SOperations", + "express_route_gateways": "ExpressRouteGatewaysOperations", + "express_route_connections": "ExpressRouteConnectionsOperations", + "network_virtual_appliance_connections": "NetworkVirtualApplianceConnectionsOperations", + "virtual_hub_bgp_connection": "VirtualHubBgpConnectionOperations", + "virtual_hub_bgp_connections": "VirtualHubBgpConnectionsOperations", + "virtual_hub_ip_configuration": "VirtualHubIpConfigurationOperations", + "hub_route_tables": "HubRouteTablesOperations", + "routing_intent": "RoutingIntentOperations", + "web_application_firewall_policies": "WebApplicationFirewallPoliciesOperations" + }, + "operation_mixins": { + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}}}", + "sync_mixin_typing_definitions": "", + "async_mixin_typing_definitions": "", + "operations": { + "_put_bastion_shareable_link_initial" : { + "sync": { + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e Optional[_models.BastionShareableLinkListResult]:\n", + "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: BastionShareableLinkListResult or None or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListResult or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e Optional[_models.BastionShareableLinkListResult]:\n", + "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: BastionShareableLinkListResult or None or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListResult or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + } + }, + "begin_put_bastion_shareable_link" : { + "sync": { + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.BastionShareableLink\"]]:\n", + "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: An instance of LROPoller that returns an iterator like instance of either\n BastionShareableLinkListResult or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.BastionShareableLink\"]]:\n", + "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: An instance of LROPoller that returns an iterator like instance of either\n BastionShareableLinkListResult or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + } + }, + "_delete_bastion_shareable_link_initial" : { + "sync": { + "signature": "def _delete_bastion_shareable_link_initial( # pylint: disable=inconsistent-return-statements\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def _delete_bastion_shareable_link_initial( # pylint: disable=inconsistent-return-statements\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + } + }, + "begin_delete_bastion_shareable_link" : { + "sync": { + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + } + }, + "_delete_bastion_shareable_link_by_token_initial" : { + "sync": { + "signature": "def _delete_bastion_shareable_link_by_token_initial( # pylint: disable=inconsistent-return-statements,name-too-long\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the tokens specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is\n either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required.\n:type bsl_token_request:\n ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest or IO[bytes]\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_token_request, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def _delete_bastion_shareable_link_by_token_initial( # pylint: disable=inconsistent-return-statements,name-too-long\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the tokens specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is\n either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required.\n:type bsl_token_request:\n ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest or IO[bytes]\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_token_request, **kwargs" + } + }, + "begin_delete_bastion_shareable_link_by_token" : { + "sync": { + "signature": "def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the tokens specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is\n either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required.\n:type bsl_token_request:\n ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest or IO[bytes]\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_token_request, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the tokens specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is\n either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required.\n:type bsl_token_request:\n ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest or IO[bytes]\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_token_request, **kwargs" + } + }, + "get_bastion_shareable_link" : { + "sync": { + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e Iterable[\"_models.BastionShareableLink\"]:\n", + "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: An iterator like instance of either BastionShareableLink or the result of\n cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + }, + "async": { + "coroutine": false, + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]],\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.BastionShareableLink\"]:\n", + "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is\n either a BastionShareableLinkListRequest type or a IO[bytes] type. Required.\n:type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or\n IO[bytes]\n:return: An iterator like instance of either BastionShareableLink or the result of\n cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, bsl_request, **kwargs" + } + }, + "_get_active_sessions_initial" : { + "sync": { + "signature": "def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs: Any\n) -\u003e Optional[_models.BastionActiveSessionListResult]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:return: BastionActiveSessionListResult or None or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.BastionActiveSessionListResult or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs: Any\n) -\u003e Optional[_models.BastionActiveSessionListResult]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:return: BastionActiveSessionListResult or None or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.BastionActiveSessionListResult or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, **kwargs" + } + }, + "begin_get_active_sessions" : { + "sync": { + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.BastionActiveSession\"]]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:return: An instance of LROPoller that returns an iterator like instance of either\n BastionActiveSessionListResult or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionActiveSession]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.BastionActiveSession\"]]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:return: An instance of LROPoller that returns an iterator like instance of either\n BastionActiveSessionListResult or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionActiveSession]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, **kwargs" + } + }, + "disconnect_active_sessions" : { + "sync": { + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: Union[_models.SessionIds, IO[bytes]],\n **kwargs: Any\n) -\u003e Iterable[\"_models.BastionSessionState\"]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect. Is either a SessionIds type or a\n IO[bytes] type. Required.\n:type session_ids: ~azure.mgmt.network.v2023_09_01.models.SessionIds or IO[bytes]\n:return: An iterator like instance of either BastionSessionState or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, session_ids, **kwargs" + }, + "async": { + "coroutine": false, + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: Union[_models.SessionIds, IO[bytes]],\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.BastionSessionState\"]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host. Required.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect. Is either a SessionIds type or a\n IO[bytes] type. Required.\n:type session_ids: ~azure.mgmt.network.v2023_09_01.models.SessionIds or IO[bytes]\n:return: An iterator like instance of either BastionSessionState or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, bastion_host_name, session_ids, **kwargs" + } + }, + "check_dns_name_availability" : { + "sync": { + "signature": "def check_dns_name_availability(\n self,\n location: str,\n *,\n domain_name_label: str,\n **kwargs: Any\n) -\u003e _models.DnsNameAvailabilityResult:\n", + "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name. Required.\n:type location: str\n:keyword domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Required.\n:paramtype domain_name_label: str\n:return: DnsNameAvailabilityResult or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.DnsNameAvailabilityResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "location, domain_name_label=domain_name_label, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n *,\n domain_name_label: str,\n **kwargs: Any\n) -\u003e _models.DnsNameAvailabilityResult:\n", + "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name. Required.\n:type location: str\n:keyword domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Required.\n:paramtype domain_name_label: str\n:return: DnsNameAvailabilityResult or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.DnsNameAvailabilityResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "location, domain_name_label=domain_name_label, **kwargs" + } + }, + "express_route_provider_port" : { + "sync": { + "signature": "def express_route_provider_port(\n self,\n providerport: str,\n **kwargs: Any\n) -\u003e _models.ExpressRouteProviderPort:\n", + "doc": "\"\"\"Retrieves detail of a provider port.\n\n:param providerport: The name of the provider port. Required.\n:type providerport: str\n:return: ExpressRouteProviderPort or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPort\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "providerport, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def express_route_provider_port(\n self,\n providerport: str,\n **kwargs: Any\n) -\u003e _models.ExpressRouteProviderPort:\n", + "doc": "\"\"\"Retrieves detail of a provider port.\n\n:param providerport: The name of the provider port. Required.\n:type providerport: str\n:return: ExpressRouteProviderPort or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPort\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "providerport, **kwargs" + } + }, + "list_active_connectivity_configurations" : { + "sync": { + "signature": "def list_active_connectivity_configurations(\n self,\n resource_group_name: str,\n network_manager_name: str,\n parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.ActiveConnectivityConfigurationsListResult:\n", + "doc": "\"\"\"Lists active connectivity configurations in a network manager.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param network_manager_name: The name of the network manager. Required.\n:type network_manager_name: str\n:param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or\n IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: ActiveConnectivityConfigurationsListResult or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, network_manager_name, parameters, top=top, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def list_active_connectivity_configurations(\n self,\n resource_group_name: str,\n network_manager_name: str,\n parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.ActiveConnectivityConfigurationsListResult:\n", + "doc": "\"\"\"Lists active connectivity configurations in a network manager.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param network_manager_name: The name of the network manager. Required.\n:type network_manager_name: str\n:param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or\n IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: ActiveConnectivityConfigurationsListResult or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, network_manager_name, parameters, top=top, **kwargs" + } + }, + "list_active_security_admin_rules" : { + "sync": { + "signature": "def list_active_security_admin_rules(\n self,\n resource_group_name: str,\n network_manager_name: str,\n parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.ActiveSecurityAdminRulesListResult:\n", + "doc": "\"\"\"Lists active security admin rules in a network manager.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param network_manager_name: The name of the network manager. Required.\n:type network_manager_name: str\n:param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or\n IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: ActiveSecurityAdminRulesListResult or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, network_manager_name, parameters, top=top, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def list_active_security_admin_rules(\n self,\n resource_group_name: str,\n network_manager_name: str,\n parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.ActiveSecurityAdminRulesListResult:\n", + "doc": "\"\"\"Lists active security admin rules in a network manager.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param network_manager_name: The name of the network manager. Required.\n:type network_manager_name: str\n:param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or\n IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: ActiveSecurityAdminRulesListResult or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, network_manager_name, parameters, top=top, **kwargs" + } + }, + "list_network_manager_effective_connectivity_configurations" : { + "sync": { + "signature": "def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_network_name: str,\n parameters: Union[_models.QueryRequestOptions, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.NetworkManagerEffectiveConnectivityConfigurationListResult:\n", + "doc": "\"\"\"List all effective connectivity configurations applied on a virtual network.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param virtual_network_name: The name of the virtual network. Required.\n:type virtual_network_name: str\n:param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of\n cls(response)\n:rtype:\n ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_network_name, parameters, top=top, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_network_name: str,\n parameters: Union[_models.QueryRequestOptions, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.NetworkManagerEffectiveConnectivityConfigurationListResult:\n", + "doc": "\"\"\"List all effective connectivity configurations applied on a virtual network.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param virtual_network_name: The name of the virtual network. Required.\n:type virtual_network_name: str\n:param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of\n cls(response)\n:rtype:\n ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_network_name, parameters, top=top, **kwargs" + } + }, + "list_network_manager_effective_security_admin_rules" : { + "sync": { + "signature": "def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_network_name: str,\n parameters: Union[_models.QueryRequestOptions, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.NetworkManagerEffectiveSecurityAdminRulesListResult:\n", + "doc": "\"\"\"List all effective security admin rules applied on a virtual network.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param virtual_network_name: The name of the virtual network. Required.\n:type virtual_network_name: str\n:param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response)\n:rtype:\n ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_network_name, parameters, top=top, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_network_name: str,\n parameters: Union[_models.QueryRequestOptions, IO[bytes]],\n *,\n top: Optional[int] = None,\n **kwargs: Any\n) -\u003e _models.NetworkManagerEffectiveSecurityAdminRulesListResult:\n", + "doc": "\"\"\"List all effective security admin rules applied on a virtual network.\n\n:param resource_group_name: The name of the resource group. Required.\n:type resource_group_name: str\n:param virtual_network_name: The name of the virtual network. Required.\n:type virtual_network_name: str\n:param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions\n type or a IO[bytes] type. Required.\n:type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes]\n:keyword top: An optional query parameter which specifies the maximum number of records to be\n returned by the server. Default value is None.\n:paramtype top: int\n:return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response)\n:rtype:\n ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_network_name, parameters, top=top, **kwargs" + } + }, + "supported_security_providers" : { + "sync": { + "signature": "def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs: Any\n) -\u003e _models.VirtualWanSecurityProviders:\n", + "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name. Required.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed. Required.\n:type virtual_wan_name: str\n:return: VirtualWanSecurityProviders or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProviders\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_wan_name, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs: Any\n) -\u003e _models.VirtualWanSecurityProviders:\n", + "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name. Required.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed. Required.\n:type virtual_wan_name: str\n:return: VirtualWanSecurityProviders or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProviders\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_wan_name, **kwargs" + } + }, + "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { + "sync": { + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]],\n **kwargs: Any\n) -\u003e Optional[_models.VpnProfileResponse]:\n", + "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name. Required.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed. Required.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required.\n:type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters\n or IO[bytes]\n:return: VpnProfileResponse or None or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_wan_name, vpn_client_params, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]],\n **kwargs: Any\n) -\u003e Optional[_models.VpnProfileResponse]:\n", + "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name. Required.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed. Required.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required.\n:type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters\n or IO[bytes]\n:return: VpnProfileResponse or None or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_wan_name, vpn_client_params, **kwargs" + } + }, + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { + "sync": { + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]],\n **kwargs: Any\n) -\u003e LROPoller[_models.VpnProfileResponse]:\n", + "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name. Required.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed. Required.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required.\n:type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters\n or IO[bytes]\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_wan_name, vpn_client_params, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.VpnProfileResponse]:\n", + "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name. Required.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed. Required.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required.\n:type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters\n or IO[bytes]\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, virtual_wan_name, vpn_client_params, **kwargs" + } + } + } + } +} diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_network_management_client.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_network_management_client.py new file mode 100644 index 00000000000..7b66f839e06 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_network_management_client.py @@ -0,0 +1,1009 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import NetworkManagementClientConfiguration +from .operations import ( + AdminRuleCollectionsOperations, + AdminRulesOperations, + ApplicationGatewayPrivateEndpointConnectionsOperations, + ApplicationGatewayPrivateLinkResourcesOperations, + ApplicationGatewayWafDynamicManifestsDefaultOperations, + ApplicationGatewayWafDynamicManifestsOperations, + ApplicationGatewaysOperations, + ApplicationSecurityGroupsOperations, + AvailableDelegationsOperations, + AvailableEndpointServicesOperations, + AvailablePrivateEndpointTypesOperations, + AvailableResourceGroupDelegationsOperations, + AvailableServiceAliasesOperations, + AzureFirewallFqdnTagsOperations, + AzureFirewallsOperations, + BastionHostsOperations, + BgpServiceCommunitiesOperations, + ConfigurationPolicyGroupsOperations, + ConnectionMonitorsOperations, + ConnectivityConfigurationsOperations, + CustomIPPrefixesOperations, + DdosCustomPoliciesOperations, + DdosProtectionPlansOperations, + DefaultSecurityRulesOperations, + DscpConfigurationOperations, + ExpressRouteCircuitAuthorizationsOperations, + ExpressRouteCircuitConnectionsOperations, + ExpressRouteCircuitPeeringsOperations, + ExpressRouteCircuitsOperations, + ExpressRouteConnectionsOperations, + ExpressRouteCrossConnectionPeeringsOperations, + ExpressRouteCrossConnectionsOperations, + ExpressRouteGatewaysOperations, + ExpressRouteLinksOperations, + ExpressRoutePortAuthorizationsOperations, + ExpressRoutePortsLocationsOperations, + ExpressRoutePortsOperations, + ExpressRouteProviderPortsLocationOperations, + ExpressRouteServiceProvidersOperations, + FirewallPoliciesOperations, + FirewallPolicyIdpsSignaturesFilterValuesOperations, + FirewallPolicyIdpsSignaturesOperations, + FirewallPolicyIdpsSignaturesOverridesOperations, + FirewallPolicyRuleCollectionGroupsOperations, + FlowLogsOperations, + HubRouteTablesOperations, + HubVirtualNetworkConnectionsOperations, + InboundNatRulesOperations, + InboundSecurityRuleOperations, + IpAllocationsOperations, + IpGroupsOperations, + LoadBalancerBackendAddressPoolsOperations, + LoadBalancerFrontendIPConfigurationsOperations, + LoadBalancerLoadBalancingRulesOperations, + LoadBalancerNetworkInterfacesOperations, + LoadBalancerOutboundRulesOperations, + LoadBalancerProbesOperations, + LoadBalancersOperations, + LocalNetworkGatewaysOperations, + ManagementGroupNetworkManagerConnectionsOperations, + NatGatewaysOperations, + NatRulesOperations, + NetworkGroupsOperations, + NetworkInterfaceIPConfigurationsOperations, + NetworkInterfaceLoadBalancersOperations, + NetworkInterfaceTapConfigurationsOperations, + NetworkInterfacesOperations, + NetworkManagementClientOperationsMixin, + NetworkManagerCommitsOperations, + NetworkManagerDeploymentStatusOperations, + NetworkManagersOperations, + NetworkProfilesOperations, + NetworkSecurityGroupsOperations, + NetworkVirtualApplianceConnectionsOperations, + NetworkVirtualAppliancesOperations, + NetworkWatchersOperations, + Operations, + P2SVpnGatewaysOperations, + PacketCapturesOperations, + PeerExpressRouteCircuitConnectionsOperations, + PrivateDnsZoneGroupsOperations, + PrivateEndpointsOperations, + PrivateLinkServicesOperations, + PublicIPAddressesOperations, + PublicIPPrefixesOperations, + ResourceNavigationLinksOperations, + RouteFilterRulesOperations, + RouteFiltersOperations, + RouteMapsOperations, + RouteTablesOperations, + RoutesOperations, + RoutingIntentOperations, + ScopeConnectionsOperations, + SecurityAdminConfigurationsOperations, + SecurityPartnerProvidersOperations, + SecurityRulesOperations, + ServiceAssociationLinksOperations, + ServiceEndpointPoliciesOperations, + ServiceEndpointPolicyDefinitionsOperations, + ServiceTagInformationOperations, + ServiceTagsOperations, + StaticMembersOperations, + SubnetsOperations, + SubscriptionNetworkManagerConnectionsOperations, + UsagesOperations, + VipSwapOperations, + VirtualApplianceSitesOperations, + VirtualApplianceSkusOperations, + VirtualHubBgpConnectionOperations, + VirtualHubBgpConnectionsOperations, + VirtualHubIpConfigurationOperations, + VirtualHubRouteTableV2SOperations, + VirtualHubsOperations, + VirtualNetworkGatewayConnectionsOperations, + VirtualNetworkGatewayNatRulesOperations, + VirtualNetworkGatewaysOperations, + VirtualNetworkPeeringsOperations, + VirtualNetworkTapsOperations, + VirtualNetworksOperations, + VirtualRouterPeeringsOperations, + VirtualRoutersOperations, + VirtualWansOperations, + VpnConnectionsOperations, + VpnGatewaysOperations, + VpnLinkConnectionsOperations, + VpnServerConfigurationsAssociatedWithVirtualWanOperations, + VpnServerConfigurationsOperations, + VpnSiteLinkConnectionsOperations, + VpnSiteLinksOperations, + VpnSitesConfigurationOperations, + VpnSitesOperations, + WebApplicationFirewallPoliciesOperations, + WebCategoriesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class NetworkManagementClient( + NetworkManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """Network Client. + + :ivar application_gateways: ApplicationGatewaysOperations operations + :vartype application_gateways: + azure.mgmt.network.v2023_09_01.operations.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: + ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: + azure.mgmt.network.v2023_09_01.operations.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: + ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: + azure.mgmt.network.v2023_09_01.operations.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_gateway_waf_dynamic_manifests_default: + ApplicationGatewayWafDynamicManifestsDefaultOperations operations + :vartype application_gateway_waf_dynamic_manifests_default: + azure.mgmt.network.v2023_09_01.operations.ApplicationGatewayWafDynamicManifestsDefaultOperations + :ivar application_gateway_waf_dynamic_manifests: + ApplicationGatewayWafDynamicManifestsOperations operations + :vartype application_gateway_waf_dynamic_manifests: + azure.mgmt.network.v2023_09_01.operations.ApplicationGatewayWafDynamicManifestsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: + azure.mgmt.network.v2023_09_01.operations.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: + azure.mgmt.network.v2023_09_01.operations.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations + operations + :vartype available_resource_group_delegations: + azure.mgmt.network.v2023_09_01.operations.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: + azure.mgmt.network.v2023_09_01.operations.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2023_09_01.operations.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: + azure.mgmt.network.v2023_09_01.operations.AzureFirewallFqdnTagsOperations + :ivar web_categories: WebCategoriesOperations operations + :vartype web_categories: azure.mgmt.network.v2023_09_01.operations.WebCategoriesOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2023_09_01.operations.BastionHostsOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: + azure.mgmt.network.v2023_09_01.operations.NetworkInterfacesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: + azure.mgmt.network.v2023_09_01.operations.PublicIPAddressesOperations + :ivar vip_swap: VipSwapOperations operations + :vartype vip_swap: azure.mgmt.network.v2023_09_01.operations.VipSwapOperations + :ivar custom_ip_prefixes: CustomIPPrefixesOperations operations + :vartype custom_ip_prefixes: + azure.mgmt.network.v2023_09_01.operations.CustomIPPrefixesOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: + azure.mgmt.network.v2023_09_01.operations.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: + azure.mgmt.network.v2023_09_01.operations.DdosProtectionPlansOperations + :ivar dscp_configuration: DscpConfigurationOperations operations + :vartype dscp_configuration: + azure.mgmt.network.v2023_09_01.operations.DscpConfigurationOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: + azure.mgmt.network.v2023_09_01.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations + operations + :vartype express_route_circuit_authorizations: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations + operations + :vartype peer_express_route_circuit_connections: + azure.mgmt.network.v2023_09_01.operations.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations + operations + :vartype express_route_cross_connection_peerings: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: + azure.mgmt.network.v2023_09_01.operations.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: + azure.mgmt.network.v2023_09_01.operations.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteLinksOperations + :ivar express_route_port_authorizations: ExpressRoutePortAuthorizationsOperations operations + :vartype express_route_port_authorizations: + azure.mgmt.network.v2023_09_01.operations.ExpressRoutePortAuthorizationsOperations + :ivar express_route_provider_ports_location: ExpressRouteProviderPortsLocationOperations + operations + :vartype express_route_provider_ports_location: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteProviderPortsLocationOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: + azure.mgmt.network.v2023_09_01.operations.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations + operations + :vartype firewall_policy_rule_collection_groups: + azure.mgmt.network.v2023_09_01.operations.FirewallPolicyRuleCollectionGroupsOperations + :ivar firewall_policy_idps_signatures: FirewallPolicyIdpsSignaturesOperations operations + :vartype firewall_policy_idps_signatures: + azure.mgmt.network.v2023_09_01.operations.FirewallPolicyIdpsSignaturesOperations + :ivar firewall_policy_idps_signatures_overrides: + FirewallPolicyIdpsSignaturesOverridesOperations operations + :vartype firewall_policy_idps_signatures_overrides: + azure.mgmt.network.v2023_09_01.operations.FirewallPolicyIdpsSignaturesOverridesOperations + :ivar firewall_policy_idps_signatures_filter_values: + FirewallPolicyIdpsSignaturesFilterValuesOperations operations + :vartype firewall_policy_idps_signatures_filter_values: + azure.mgmt.network.v2023_09_01.operations.FirewallPolicyIdpsSignaturesFilterValuesOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2023_09_01.operations.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2023_09_01.operations.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2023_09_01.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: + azure.mgmt.network.v2023_09_01.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations + operations + :vartype load_balancer_frontend_ip_configurations: + azure.mgmt.network.v2023_09_01.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2023_09_01.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: + azure.mgmt.network.v2023_09_01.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: + azure.mgmt.network.v2023_09_01.operations.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: + azure.mgmt.network.v2023_09_01.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: + azure.mgmt.network.v2023_09_01.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2023_09_01.operations.NatGatewaysOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations + operations + :vartype network_interface_ip_configurations: + azure.mgmt.network.v2023_09_01.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: + azure.mgmt.network.v2023_09_01.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations + operations + :vartype network_interface_tap_configurations: + azure.mgmt.network.v2023_09_01.operations.NetworkInterfaceTapConfigurationsOperations + :ivar network_managers: NetworkManagersOperations operations + :vartype network_managers: azure.mgmt.network.v2023_09_01.operations.NetworkManagersOperations + :ivar network_manager_commits: NetworkManagerCommitsOperations operations + :vartype network_manager_commits: + azure.mgmt.network.v2023_09_01.operations.NetworkManagerCommitsOperations + :ivar network_manager_deployment_status: NetworkManagerDeploymentStatusOperations operations + :vartype network_manager_deployment_status: + azure.mgmt.network.v2023_09_01.operations.NetworkManagerDeploymentStatusOperations + :ivar subscription_network_manager_connections: SubscriptionNetworkManagerConnectionsOperations + operations + :vartype subscription_network_manager_connections: + azure.mgmt.network.v2023_09_01.operations.SubscriptionNetworkManagerConnectionsOperations + :ivar management_group_network_manager_connections: + ManagementGroupNetworkManagerConnectionsOperations operations + :vartype management_group_network_manager_connections: + azure.mgmt.network.v2023_09_01.operations.ManagementGroupNetworkManagerConnectionsOperations + :ivar connectivity_configurations: ConnectivityConfigurationsOperations operations + :vartype connectivity_configurations: + azure.mgmt.network.v2023_09_01.operations.ConnectivityConfigurationsOperations + :ivar network_groups: NetworkGroupsOperations operations + :vartype network_groups: azure.mgmt.network.v2023_09_01.operations.NetworkGroupsOperations + :ivar static_members: StaticMembersOperations operations + :vartype static_members: azure.mgmt.network.v2023_09_01.operations.StaticMembersOperations + :ivar scope_connections: ScopeConnectionsOperations operations + :vartype scope_connections: + azure.mgmt.network.v2023_09_01.operations.ScopeConnectionsOperations + :ivar security_admin_configurations: SecurityAdminConfigurationsOperations operations + :vartype security_admin_configurations: + azure.mgmt.network.v2023_09_01.operations.SecurityAdminConfigurationsOperations + :ivar admin_rule_collections: AdminRuleCollectionsOperations operations + :vartype admin_rule_collections: + azure.mgmt.network.v2023_09_01.operations.AdminRuleCollectionsOperations + :ivar admin_rules: AdminRulesOperations operations + :vartype admin_rules: azure.mgmt.network.v2023_09_01.operations.AdminRulesOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2023_09_01.operations.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: + azure.mgmt.network.v2023_09_01.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2023_09_01.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: + azure.mgmt.network.v2023_09_01.operations.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: + azure.mgmt.network.v2023_09_01.operations.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: + azure.mgmt.network.v2023_09_01.operations.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: + azure.mgmt.network.v2023_09_01.operations.VirtualApplianceSkusOperations + :ivar inbound_security_rule: InboundSecurityRuleOperations operations + :vartype inbound_security_rule: + azure.mgmt.network.v2023_09_01.operations.InboundSecurityRuleOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2023_09_01.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2023_09_01.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: + azure.mgmt.network.v2023_09_01.operations.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2023_09_01.operations.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2023_09_01.operations.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: + azure.mgmt.network.v2023_09_01.operations.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: + azure.mgmt.network.v2023_09_01.operations.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: + azure.mgmt.network.v2023_09_01.operations.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: + azure.mgmt.network.v2023_09_01.operations.PrivateLinkServicesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: + azure.mgmt.network.v2023_09_01.operations.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2023_09_01.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: + azure.mgmt.network.v2023_09_01.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2023_09_01.operations.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2023_09_01.operations.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: + azure.mgmt.network.v2023_09_01.operations.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: + azure.mgmt.network.v2023_09_01.operations.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: + azure.mgmt.network.v2023_09_01.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations + operations + :vartype service_endpoint_policy_definitions: + azure.mgmt.network.v2023_09_01.operations.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2023_09_01.operations.ServiceTagsOperations + :ivar service_tag_information: ServiceTagInformationOperations operations + :vartype service_tag_information: + azure.mgmt.network.v2023_09_01.operations.ServiceTagInformationOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2023_09_01.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2023_09_01.operations.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2023_09_01.operations.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: + azure.mgmt.network.v2023_09_01.operations.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: + azure.mgmt.network.v2023_09_01.operations.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: + azure.mgmt.network.v2023_09_01.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: + azure.mgmt.network.v2023_09_01.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations + operations + :vartype virtual_network_gateway_connections: + azure.mgmt.network.v2023_09_01.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: + azure.mgmt.network.v2023_09_01.operations.LocalNetworkGatewaysOperations + :ivar virtual_network_gateway_nat_rules: VirtualNetworkGatewayNatRulesOperations operations + :vartype virtual_network_gateway_nat_rules: + azure.mgmt.network.v2023_09_01.operations.VirtualNetworkGatewayNatRulesOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: + azure.mgmt.network.v2023_09_01.operations.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2023_09_01.operations.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: + azure.mgmt.network.v2023_09_01.operations.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2023_09_01.operations.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2023_09_01.operations.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2023_09_01.operations.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: + azure.mgmt.network.v2023_09_01.operations.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: + azure.mgmt.network.v2023_09_01.operations.VpnServerConfigurationsOperations + :ivar configuration_policy_groups: ConfigurationPolicyGroupsOperations operations + :vartype configuration_policy_groups: + azure.mgmt.network.v2023_09_01.operations.ConfigurationPolicyGroupsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2023_09_01.operations.VirtualHubsOperations + :ivar route_maps: RouteMapsOperations operations + :vartype route_maps: azure.mgmt.network.v2023_09_01.operations.RouteMapsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: + azure.mgmt.network.v2023_09_01.operations.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2023_09_01.operations.VpnGatewaysOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: + azure.mgmt.network.v2023_09_01.operations.VpnLinkConnectionsOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2023_09_01.operations.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: + azure.mgmt.network.v2023_09_01.operations.VpnSiteLinkConnectionsOperations + :ivar nat_rules: NatRulesOperations operations + :vartype nat_rules: azure.mgmt.network.v2023_09_01.operations.NatRulesOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2023_09_01.operations.P2SVpnGatewaysOperations + :ivar vpn_server_configurations_associated_with_virtual_wan: + VpnServerConfigurationsAssociatedWithVirtualWanOperations operations + :vartype vpn_server_configurations_associated_with_virtual_wan: + azure.mgmt.network.v2023_09_01.operations.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: + azure.mgmt.network.v2023_09_01.operations.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: + azure.mgmt.network.v2023_09_01.operations.ExpressRouteConnectionsOperations + :ivar network_virtual_appliance_connections: NetworkVirtualApplianceConnectionsOperations + operations + :vartype network_virtual_appliance_connections: + azure.mgmt.network.v2023_09_01.operations.NetworkVirtualApplianceConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: + azure.mgmt.network.v2023_09_01.operations.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: + azure.mgmt.network.v2023_09_01.operations.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: + azure.mgmt.network.v2023_09_01.operations.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2023_09_01.operations.HubRouteTablesOperations + :ivar routing_intent: RoutingIntentOperations operations + :vartype routing_intent: azure.mgmt.network.v2023_09_01.operations.RoutingIntentOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: + azure.mgmt.network.v2023_09_01.operations.WebApplicationFirewallPoliciesOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft + Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = NetworkManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.application_gateways = ApplicationGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_private_link_resources = ApplicationGatewayPrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_private_endpoint_connections = ApplicationGatewayPrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_waf_dynamic_manifests_default = ApplicationGatewayWafDynamicManifestsDefaultOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_waf_dynamic_manifests = ApplicationGatewayWafDynamicManifestsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_security_groups = ApplicationSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_delegations = AvailableDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_service_aliases = AvailableServiceAliasesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.azure_firewalls = AzureFirewallsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.web_categories = WebCategoriesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.bastion_hosts = BastionHostsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interfaces = NetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.public_ip_addresses = PublicIPAddressesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vip_swap = VipSwapOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.custom_ip_prefixes = CustomIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ddos_custom_policies = DdosCustomPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ddos_protection_plans = DdosProtectionPlansOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.dscp_configuration = DscpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_endpoint_services = AvailableEndpointServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuits = ExpressRouteCircuitsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_service_providers = ExpressRouteServiceProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_ports_locations = ExpressRoutePortsLocationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_ports = ExpressRoutePortsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_links = ExpressRouteLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_port_authorizations = ExpressRoutePortAuthorizationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_provider_ports_location = ExpressRouteProviderPortsLocationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policies = FirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_rule_collection_groups = FirewallPolicyRuleCollectionGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_idps_signatures = FirewallPolicyIdpsSignaturesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_idps_signatures_overrides = FirewallPolicyIdpsSignaturesOverridesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_idps_signatures_filter_values = FirewallPolicyIdpsSignaturesFilterValuesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ip_allocations = IpAllocationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ip_groups = IpGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.inbound_nat_rules = InboundNatRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_probes = LoadBalancerProbesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.nat_gateways = NatGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_managers = NetworkManagersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_manager_commits = NetworkManagerCommitsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_manager_deployment_status = NetworkManagerDeploymentStatusOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.subscription_network_manager_connections = SubscriptionNetworkManagerConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.management_group_network_manager_connections = ManagementGroupNetworkManagerConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.connectivity_configurations = ConnectivityConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_groups = NetworkGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.static_members = StaticMembersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.scope_connections = ScopeConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.security_admin_configurations = SecurityAdminConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.admin_rule_collections = AdminRuleCollectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.admin_rules = AdminRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_profiles = NetworkProfilesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_security_groups = NetworkSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.security_rules = SecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.default_security_rules = DefaultSecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_virtual_appliances = NetworkVirtualAppliancesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_appliance_sites = VirtualApplianceSitesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_appliance_skus = VirtualApplianceSkusOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.inbound_security_rule = InboundSecurityRuleOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_watchers = NetworkWatchersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.packet_captures = PacketCapturesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.connection_monitors = ConnectionMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.flow_logs = FlowLogsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.private_endpoints = PrivateEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_private_endpoint_types = AvailablePrivateEndpointTypesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.private_dns_zone_groups = PrivateDnsZoneGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.private_link_services = PrivateLinkServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.public_ip_prefixes = PublicIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_filters = RouteFiltersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_filter_rules = RouteFilterRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_tables = RouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.routes = RoutesOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.security_partner_providers = SecurityPartnerProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.bgp_service_communities = BgpServiceCommunitiesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_endpoint_policies = ServiceEndpointPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_tags = ServiceTagsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_tag_information = ServiceTagInformationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.virtual_networks = VirtualNetworksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.subnets = SubnetsOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.resource_navigation_links = ResourceNavigationLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_association_links = ServiceAssociationLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_peerings = VirtualNetworkPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_gateways = VirtualNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.local_network_gateways = LocalNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_gateway_nat_rules = VirtualNetworkGatewayNatRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_taps = VirtualNetworkTapsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_routers = VirtualRoutersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_router_peerings = VirtualRouterPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_wans = VirtualWansOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_sites = VpnSitesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_site_links = VpnSiteLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_sites_configuration = VpnSitesConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_server_configurations = VpnServerConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.configuration_policy_groups = ConfigurationPolicyGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hubs = VirtualHubsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_maps = RouteMapsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_gateways = VpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_link_connections = VpnLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_connections = VpnConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_site_link_connections = VpnSiteLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.nat_rules = NatRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.p2_svpn_gateways = P2SVpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_server_configurations_associated_with_virtual_wan = ( + VpnServerConfigurationsAssociatedWithVirtualWanOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + ) + self.virtual_hub_route_table_v2_s = VirtualHubRouteTableV2SOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_gateways = ExpressRouteGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_connections = ExpressRouteConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_virtual_appliance_connections = NetworkVirtualApplianceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hub_bgp_connection = VirtualHubBgpConnectionOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hub_bgp_connections = VirtualHubBgpConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hub_ip_configuration = VirtualHubIpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.hub_route_tables = HubRouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.routing_intent = RoutingIntentOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "NetworkManagementClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_vendor.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_vendor.py new file mode 100644 index 00000000000..789c0a30e2e --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_vendor.py @@ -0,0 +1,36 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import NetworkManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from .._serialization import Deserializer, Serializer + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +class NetworkManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: NetworkManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_version.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_version.py new file mode 100644 index 00000000000..d970657f97f --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "25.4.0" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/__init__.py new file mode 100644 index 00000000000..3e9fedfa0ae --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._network_management_client import NetworkManagementClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NetworkManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_configuration.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_configuration.py new file mode 100644 index 00000000000..9c50c4b1006 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class NetworkManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for NetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft + Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-network/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_network_management_client.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_network_management_client.py new file mode 100644 index 00000000000..949d5f5cb69 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_network_management_client.py @@ -0,0 +1,1022 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import NetworkManagementClientConfiguration +from .operations import ( + AdminRuleCollectionsOperations, + AdminRulesOperations, + ApplicationGatewayPrivateEndpointConnectionsOperations, + ApplicationGatewayPrivateLinkResourcesOperations, + ApplicationGatewayWafDynamicManifestsDefaultOperations, + ApplicationGatewayWafDynamicManifestsOperations, + ApplicationGatewaysOperations, + ApplicationSecurityGroupsOperations, + AvailableDelegationsOperations, + AvailableEndpointServicesOperations, + AvailablePrivateEndpointTypesOperations, + AvailableResourceGroupDelegationsOperations, + AvailableServiceAliasesOperations, + AzureFirewallFqdnTagsOperations, + AzureFirewallsOperations, + BastionHostsOperations, + BgpServiceCommunitiesOperations, + ConfigurationPolicyGroupsOperations, + ConnectionMonitorsOperations, + ConnectivityConfigurationsOperations, + CustomIPPrefixesOperations, + DdosCustomPoliciesOperations, + DdosProtectionPlansOperations, + DefaultSecurityRulesOperations, + DscpConfigurationOperations, + ExpressRouteCircuitAuthorizationsOperations, + ExpressRouteCircuitConnectionsOperations, + ExpressRouteCircuitPeeringsOperations, + ExpressRouteCircuitsOperations, + ExpressRouteConnectionsOperations, + ExpressRouteCrossConnectionPeeringsOperations, + ExpressRouteCrossConnectionsOperations, + ExpressRouteGatewaysOperations, + ExpressRouteLinksOperations, + ExpressRoutePortAuthorizationsOperations, + ExpressRoutePortsLocationsOperations, + ExpressRoutePortsOperations, + ExpressRouteProviderPortsLocationOperations, + ExpressRouteServiceProvidersOperations, + FirewallPoliciesOperations, + FirewallPolicyIdpsSignaturesFilterValuesOperations, + FirewallPolicyIdpsSignaturesOperations, + FirewallPolicyIdpsSignaturesOverridesOperations, + FirewallPolicyRuleCollectionGroupsOperations, + FlowLogsOperations, + HubRouteTablesOperations, + HubVirtualNetworkConnectionsOperations, + InboundNatRulesOperations, + InboundSecurityRuleOperations, + IpAllocationsOperations, + IpGroupsOperations, + LoadBalancerBackendAddressPoolsOperations, + LoadBalancerFrontendIPConfigurationsOperations, + LoadBalancerLoadBalancingRulesOperations, + LoadBalancerNetworkInterfacesOperations, + LoadBalancerOutboundRulesOperations, + LoadBalancerProbesOperations, + LoadBalancersOperations, + LocalNetworkGatewaysOperations, + ManagementGroupNetworkManagerConnectionsOperations, + NatGatewaysOperations, + NatRulesOperations, + NetworkGroupsOperations, + NetworkInterfaceIPConfigurationsOperations, + NetworkInterfaceLoadBalancersOperations, + NetworkInterfaceTapConfigurationsOperations, + NetworkInterfacesOperations, + NetworkManagementClientOperationsMixin, + NetworkManagerCommitsOperations, + NetworkManagerDeploymentStatusOperations, + NetworkManagersOperations, + NetworkProfilesOperations, + NetworkSecurityGroupsOperations, + NetworkVirtualApplianceConnectionsOperations, + NetworkVirtualAppliancesOperations, + NetworkWatchersOperations, + Operations, + P2SVpnGatewaysOperations, + PacketCapturesOperations, + PeerExpressRouteCircuitConnectionsOperations, + PrivateDnsZoneGroupsOperations, + PrivateEndpointsOperations, + PrivateLinkServicesOperations, + PublicIPAddressesOperations, + PublicIPPrefixesOperations, + ResourceNavigationLinksOperations, + RouteFilterRulesOperations, + RouteFiltersOperations, + RouteMapsOperations, + RouteTablesOperations, + RoutesOperations, + RoutingIntentOperations, + ScopeConnectionsOperations, + SecurityAdminConfigurationsOperations, + SecurityPartnerProvidersOperations, + SecurityRulesOperations, + ServiceAssociationLinksOperations, + ServiceEndpointPoliciesOperations, + ServiceEndpointPolicyDefinitionsOperations, + ServiceTagInformationOperations, + ServiceTagsOperations, + StaticMembersOperations, + SubnetsOperations, + SubscriptionNetworkManagerConnectionsOperations, + UsagesOperations, + VipSwapOperations, + VirtualApplianceSitesOperations, + VirtualApplianceSkusOperations, + VirtualHubBgpConnectionOperations, + VirtualHubBgpConnectionsOperations, + VirtualHubIpConfigurationOperations, + VirtualHubRouteTableV2SOperations, + VirtualHubsOperations, + VirtualNetworkGatewayConnectionsOperations, + VirtualNetworkGatewayNatRulesOperations, + VirtualNetworkGatewaysOperations, + VirtualNetworkPeeringsOperations, + VirtualNetworkTapsOperations, + VirtualNetworksOperations, + VirtualRouterPeeringsOperations, + VirtualRoutersOperations, + VirtualWansOperations, + VpnConnectionsOperations, + VpnGatewaysOperations, + VpnLinkConnectionsOperations, + VpnServerConfigurationsAssociatedWithVirtualWanOperations, + VpnServerConfigurationsOperations, + VpnSiteLinkConnectionsOperations, + VpnSiteLinksOperations, + VpnSitesConfigurationOperations, + VpnSitesOperations, + WebApplicationFirewallPoliciesOperations, + WebCategoriesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class NetworkManagementClient( + NetworkManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """Network Client. + + :ivar application_gateways: ApplicationGatewaysOperations operations + :vartype application_gateways: + azure.mgmt.network.v2023_09_01.aio.operations.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: + ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: + azure.mgmt.network.v2023_09_01.aio.operations.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: + ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: + azure.mgmt.network.v2023_09_01.aio.operations.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_gateway_waf_dynamic_manifests_default: + ApplicationGatewayWafDynamicManifestsDefaultOperations operations + :vartype application_gateway_waf_dynamic_manifests_default: + azure.mgmt.network.v2023_09_01.aio.operations.ApplicationGatewayWafDynamicManifestsDefaultOperations + :ivar application_gateway_waf_dynamic_manifests: + ApplicationGatewayWafDynamicManifestsOperations operations + :vartype application_gateway_waf_dynamic_manifests: + azure.mgmt.network.v2023_09_01.aio.operations.ApplicationGatewayWafDynamicManifestsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: + azure.mgmt.network.v2023_09_01.aio.operations.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: + azure.mgmt.network.v2023_09_01.aio.operations.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations + operations + :vartype available_resource_group_delegations: + azure.mgmt.network.v2023_09_01.aio.operations.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: + azure.mgmt.network.v2023_09_01.aio.operations.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: + azure.mgmt.network.v2023_09_01.aio.operations.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: + azure.mgmt.network.v2023_09_01.aio.operations.AzureFirewallFqdnTagsOperations + :ivar web_categories: WebCategoriesOperations operations + :vartype web_categories: azure.mgmt.network.v2023_09_01.aio.operations.WebCategoriesOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2023_09_01.aio.operations.BastionHostsOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkInterfacesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: + azure.mgmt.network.v2023_09_01.aio.operations.PublicIPAddressesOperations + :ivar vip_swap: VipSwapOperations operations + :vartype vip_swap: azure.mgmt.network.v2023_09_01.aio.operations.VipSwapOperations + :ivar custom_ip_prefixes: CustomIPPrefixesOperations operations + :vartype custom_ip_prefixes: + azure.mgmt.network.v2023_09_01.aio.operations.CustomIPPrefixesOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: + azure.mgmt.network.v2023_09_01.aio.operations.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: + azure.mgmt.network.v2023_09_01.aio.operations.DdosProtectionPlansOperations + :ivar dscp_configuration: DscpConfigurationOperations operations + :vartype dscp_configuration: + azure.mgmt.network.v2023_09_01.aio.operations.DscpConfigurationOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: + azure.mgmt.network.v2023_09_01.aio.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations + operations + :vartype express_route_circuit_authorizations: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations + operations + :vartype peer_express_route_circuit_connections: + azure.mgmt.network.v2023_09_01.aio.operations.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations + operations + :vartype express_route_cross_connection_peerings: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteLinksOperations + :ivar express_route_port_authorizations: ExpressRoutePortAuthorizationsOperations operations + :vartype express_route_port_authorizations: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRoutePortAuthorizationsOperations + :ivar express_route_provider_ports_location: ExpressRouteProviderPortsLocationOperations + operations + :vartype express_route_provider_ports_location: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteProviderPortsLocationOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: + azure.mgmt.network.v2023_09_01.aio.operations.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations + operations + :vartype firewall_policy_rule_collection_groups: + azure.mgmt.network.v2023_09_01.aio.operations.FirewallPolicyRuleCollectionGroupsOperations + :ivar firewall_policy_idps_signatures: FirewallPolicyIdpsSignaturesOperations operations + :vartype firewall_policy_idps_signatures: + azure.mgmt.network.v2023_09_01.aio.operations.FirewallPolicyIdpsSignaturesOperations + :ivar firewall_policy_idps_signatures_overrides: + FirewallPolicyIdpsSignaturesOverridesOperations operations + :vartype firewall_policy_idps_signatures_overrides: + azure.mgmt.network.v2023_09_01.aio.operations.FirewallPolicyIdpsSignaturesOverridesOperations + :ivar firewall_policy_idps_signatures_filter_values: + FirewallPolicyIdpsSignaturesFilterValuesOperations operations + :vartype firewall_policy_idps_signatures_filter_values: + azure.mgmt.network.v2023_09_01.aio.operations.FirewallPolicyIdpsSignaturesFilterValuesOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2023_09_01.aio.operations.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2023_09_01.aio.operations.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: + azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations + operations + :vartype load_balancer_frontend_ip_configurations: + azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: + azure.mgmt.network.v2023_09_01.aio.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: + azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: + azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: + azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: + azure.mgmt.network.v2023_09_01.aio.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2023_09_01.aio.operations.NatGatewaysOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations + operations + :vartype network_interface_ip_configurations: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations + operations + :vartype network_interface_tap_configurations: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkInterfaceTapConfigurationsOperations + :ivar network_managers: NetworkManagersOperations operations + :vartype network_managers: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkManagersOperations + :ivar network_manager_commits: NetworkManagerCommitsOperations operations + :vartype network_manager_commits: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkManagerCommitsOperations + :ivar network_manager_deployment_status: NetworkManagerDeploymentStatusOperations operations + :vartype network_manager_deployment_status: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkManagerDeploymentStatusOperations + :ivar subscription_network_manager_connections: SubscriptionNetworkManagerConnectionsOperations + operations + :vartype subscription_network_manager_connections: + azure.mgmt.network.v2023_09_01.aio.operations.SubscriptionNetworkManagerConnectionsOperations + :ivar management_group_network_manager_connections: + ManagementGroupNetworkManagerConnectionsOperations operations + :vartype management_group_network_manager_connections: + azure.mgmt.network.v2023_09_01.aio.operations.ManagementGroupNetworkManagerConnectionsOperations + :ivar connectivity_configurations: ConnectivityConfigurationsOperations operations + :vartype connectivity_configurations: + azure.mgmt.network.v2023_09_01.aio.operations.ConnectivityConfigurationsOperations + :ivar network_groups: NetworkGroupsOperations operations + :vartype network_groups: azure.mgmt.network.v2023_09_01.aio.operations.NetworkGroupsOperations + :ivar static_members: StaticMembersOperations operations + :vartype static_members: azure.mgmt.network.v2023_09_01.aio.operations.StaticMembersOperations + :ivar scope_connections: ScopeConnectionsOperations operations + :vartype scope_connections: + azure.mgmt.network.v2023_09_01.aio.operations.ScopeConnectionsOperations + :ivar security_admin_configurations: SecurityAdminConfigurationsOperations operations + :vartype security_admin_configurations: + azure.mgmt.network.v2023_09_01.aio.operations.SecurityAdminConfigurationsOperations + :ivar admin_rule_collections: AdminRuleCollectionsOperations operations + :vartype admin_rule_collections: + azure.mgmt.network.v2023_09_01.aio.operations.AdminRuleCollectionsOperations + :ivar admin_rules: AdminRulesOperations operations + :vartype admin_rules: azure.mgmt.network.v2023_09_01.aio.operations.AdminRulesOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2023_09_01.aio.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: + azure.mgmt.network.v2023_09_01.aio.operations.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualApplianceSkusOperations + :ivar inbound_security_rule: InboundSecurityRuleOperations operations + :vartype inbound_security_rule: + azure.mgmt.network.v2023_09_01.aio.operations.InboundSecurityRuleOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: + azure.mgmt.network.v2023_09_01.aio.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: + azure.mgmt.network.v2023_09_01.aio.operations.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2023_09_01.aio.operations.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2023_09_01.aio.operations.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: + azure.mgmt.network.v2023_09_01.aio.operations.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: + azure.mgmt.network.v2023_09_01.aio.operations.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: + azure.mgmt.network.v2023_09_01.aio.operations.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: + azure.mgmt.network.v2023_09_01.aio.operations.PrivateLinkServicesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: + azure.mgmt.network.v2023_09_01.aio.operations.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2023_09_01.aio.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: + azure.mgmt.network.v2023_09_01.aio.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2023_09_01.aio.operations.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2023_09_01.aio.operations.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: + azure.mgmt.network.v2023_09_01.aio.operations.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: + azure.mgmt.network.v2023_09_01.aio.operations.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: + azure.mgmt.network.v2023_09_01.aio.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations + operations + :vartype service_endpoint_policy_definitions: + azure.mgmt.network.v2023_09_01.aio.operations.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2023_09_01.aio.operations.ServiceTagsOperations + :ivar service_tag_information: ServiceTagInformationOperations operations + :vartype service_tag_information: + azure.mgmt.network.v2023_09_01.aio.operations.ServiceTagInformationOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2023_09_01.aio.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2023_09_01.aio.operations.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: + azure.mgmt.network.v2023_09_01.aio.operations.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: + azure.mgmt.network.v2023_09_01.aio.operations.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations + operations + :vartype virtual_network_gateway_connections: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: + azure.mgmt.network.v2023_09_01.aio.operations.LocalNetworkGatewaysOperations + :ivar virtual_network_gateway_nat_rules: VirtualNetworkGatewayNatRulesOperations operations + :vartype virtual_network_gateway_nat_rules: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualNetworkGatewayNatRulesOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2023_09_01.aio.operations.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2023_09_01.aio.operations.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2023_09_01.aio.operations.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: + azure.mgmt.network.v2023_09_01.aio.operations.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: + azure.mgmt.network.v2023_09_01.aio.operations.VpnServerConfigurationsOperations + :ivar configuration_policy_groups: ConfigurationPolicyGroupsOperations operations + :vartype configuration_policy_groups: + azure.mgmt.network.v2023_09_01.aio.operations.ConfigurationPolicyGroupsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2023_09_01.aio.operations.VirtualHubsOperations + :ivar route_maps: RouteMapsOperations operations + :vartype route_maps: azure.mgmt.network.v2023_09_01.aio.operations.RouteMapsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: + azure.mgmt.network.v2023_09_01.aio.operations.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2023_09_01.aio.operations.VpnGatewaysOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: + azure.mgmt.network.v2023_09_01.aio.operations.VpnLinkConnectionsOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: + azure.mgmt.network.v2023_09_01.aio.operations.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: + azure.mgmt.network.v2023_09_01.aio.operations.VpnSiteLinkConnectionsOperations + :ivar nat_rules: NatRulesOperations operations + :vartype nat_rules: azure.mgmt.network.v2023_09_01.aio.operations.NatRulesOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: + azure.mgmt.network.v2023_09_01.aio.operations.P2SVpnGatewaysOperations + :ivar vpn_server_configurations_associated_with_virtual_wan: + VpnServerConfigurationsAssociatedWithVirtualWanOperations operations + :vartype vpn_server_configurations_associated_with_virtual_wan: + azure.mgmt.network.v2023_09_01.aio.operations.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: + azure.mgmt.network.v2023_09_01.aio.operations.ExpressRouteConnectionsOperations + :ivar network_virtual_appliance_connections: NetworkVirtualApplianceConnectionsOperations + operations + :vartype network_virtual_appliance_connections: + azure.mgmt.network.v2023_09_01.aio.operations.NetworkVirtualApplianceConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: + azure.mgmt.network.v2023_09_01.aio.operations.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: + azure.mgmt.network.v2023_09_01.aio.operations.HubRouteTablesOperations + :ivar routing_intent: RoutingIntentOperations operations + :vartype routing_intent: azure.mgmt.network.v2023_09_01.aio.operations.RoutingIntentOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: + azure.mgmt.network.v2023_09_01.aio.operations.WebApplicationFirewallPoliciesOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft + Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = NetworkManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.application_gateways = ApplicationGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_private_link_resources = ApplicationGatewayPrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_private_endpoint_connections = ApplicationGatewayPrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_waf_dynamic_manifests_default = ApplicationGatewayWafDynamicManifestsDefaultOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_gateway_waf_dynamic_manifests = ApplicationGatewayWafDynamicManifestsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.application_security_groups = ApplicationSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_delegations = AvailableDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_service_aliases = AvailableServiceAliasesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.azure_firewalls = AzureFirewallsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.web_categories = WebCategoriesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.bastion_hosts = BastionHostsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interfaces = NetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.public_ip_addresses = PublicIPAddressesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vip_swap = VipSwapOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.custom_ip_prefixes = CustomIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ddos_custom_policies = DdosCustomPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ddos_protection_plans = DdosProtectionPlansOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.dscp_configuration = DscpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_endpoint_services = AvailableEndpointServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_circuits = ExpressRouteCircuitsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_service_providers = ExpressRouteServiceProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_ports_locations = ExpressRoutePortsLocationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_ports = ExpressRoutePortsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_links = ExpressRouteLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_port_authorizations = ExpressRoutePortAuthorizationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_provider_ports_location = ExpressRouteProviderPortsLocationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policies = FirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_rule_collection_groups = FirewallPolicyRuleCollectionGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_idps_signatures = FirewallPolicyIdpsSignaturesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_idps_signatures_overrides = FirewallPolicyIdpsSignaturesOverridesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.firewall_policy_idps_signatures_filter_values = FirewallPolicyIdpsSignaturesFilterValuesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ip_allocations = IpAllocationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.ip_groups = IpGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.inbound_nat_rules = InboundNatRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.load_balancer_probes = LoadBalancerProbesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.nat_gateways = NatGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_managers = NetworkManagersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_manager_commits = NetworkManagerCommitsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_manager_deployment_status = NetworkManagerDeploymentStatusOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.subscription_network_manager_connections = SubscriptionNetworkManagerConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.management_group_network_manager_connections = ManagementGroupNetworkManagerConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.connectivity_configurations = ConnectivityConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_groups = NetworkGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.static_members = StaticMembersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.scope_connections = ScopeConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.security_admin_configurations = SecurityAdminConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.admin_rule_collections = AdminRuleCollectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.admin_rules = AdminRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_profiles = NetworkProfilesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_security_groups = NetworkSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.security_rules = SecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.default_security_rules = DefaultSecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_virtual_appliances = NetworkVirtualAppliancesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_appliance_sites = VirtualApplianceSitesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_appliance_skus = VirtualApplianceSkusOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.inbound_security_rule = InboundSecurityRuleOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_watchers = NetworkWatchersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.packet_captures = PacketCapturesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.connection_monitors = ConnectionMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.flow_logs = FlowLogsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.private_endpoints = PrivateEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.available_private_endpoint_types = AvailablePrivateEndpointTypesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.private_dns_zone_groups = PrivateDnsZoneGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.private_link_services = PrivateLinkServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.public_ip_prefixes = PublicIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_filters = RouteFiltersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_filter_rules = RouteFilterRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_tables = RouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.routes = RoutesOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.security_partner_providers = SecurityPartnerProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.bgp_service_communities = BgpServiceCommunitiesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_endpoint_policies = ServiceEndpointPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_tags = ServiceTagsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_tag_information = ServiceTagInformationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.virtual_networks = VirtualNetworksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.subnets = SubnetsOperations(self._client, self._config, self._serialize, self._deserialize, "2023-09-01") + self.resource_navigation_links = ResourceNavigationLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.service_association_links = ServiceAssociationLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_peerings = VirtualNetworkPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_gateways = VirtualNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.local_network_gateways = LocalNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_gateway_nat_rules = VirtualNetworkGatewayNatRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_network_taps = VirtualNetworkTapsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_routers = VirtualRoutersOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_router_peerings = VirtualRouterPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_wans = VirtualWansOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_sites = VpnSitesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_site_links = VpnSiteLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_sites_configuration = VpnSitesConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_server_configurations = VpnServerConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.configuration_policy_groups = ConfigurationPolicyGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hubs = VirtualHubsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.route_maps = RouteMapsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_gateways = VpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_link_connections = VpnLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_connections = VpnConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_site_link_connections = VpnSiteLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.nat_rules = NatRulesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.p2_svpn_gateways = P2SVpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.vpn_server_configurations_associated_with_virtual_wan = ( + VpnServerConfigurationsAssociatedWithVirtualWanOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + ) + self.virtual_hub_route_table_v2_s = VirtualHubRouteTableV2SOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_gateways = ExpressRouteGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.express_route_connections = ExpressRouteConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.network_virtual_appliance_connections = NetworkVirtualApplianceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hub_bgp_connection = VirtualHubBgpConnectionOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hub_bgp_connections = VirtualHubBgpConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.virtual_hub_ip_configuration = VirtualHubIpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.hub_route_tables = HubRouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.routing_intent = RoutingIntentOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize, "2023-09-01" + ) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "NetworkManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_vendor.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_vendor.py new file mode 100644 index 00000000000..f19aae839eb --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import NetworkManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from ..._serialization import Deserializer, Serializer + + +class NetworkManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: NetworkManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/__init__.py new file mode 100644 index 00000000000..475c77afc39 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/__init__.py @@ -0,0 +1,283 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import ApplicationGatewaysOperations +from ._operations import ApplicationGatewayPrivateLinkResourcesOperations +from ._operations import ApplicationGatewayPrivateEndpointConnectionsOperations +from ._operations import ApplicationGatewayWafDynamicManifestsDefaultOperations +from ._operations import ApplicationGatewayWafDynamicManifestsOperations +from ._operations import ApplicationSecurityGroupsOperations +from ._operations import AvailableDelegationsOperations +from ._operations import AvailableResourceGroupDelegationsOperations +from ._operations import AvailableServiceAliasesOperations +from ._operations import AzureFirewallsOperations +from ._operations import AzureFirewallFqdnTagsOperations +from ._operations import WebCategoriesOperations +from ._operations import BastionHostsOperations +from ._operations import NetworkManagementClientOperationsMixin +from ._operations import NetworkInterfacesOperations +from ._operations import PublicIPAddressesOperations +from ._operations import VipSwapOperations +from ._operations import CustomIPPrefixesOperations +from ._operations import DdosCustomPoliciesOperations +from ._operations import DdosProtectionPlansOperations +from ._operations import DscpConfigurationOperations +from ._operations import AvailableEndpointServicesOperations +from ._operations import ExpressRouteCircuitAuthorizationsOperations +from ._operations import ExpressRouteCircuitPeeringsOperations +from ._operations import ExpressRouteCircuitConnectionsOperations +from ._operations import PeerExpressRouteCircuitConnectionsOperations +from ._operations import ExpressRouteCircuitsOperations +from ._operations import ExpressRouteServiceProvidersOperations +from ._operations import ExpressRouteCrossConnectionsOperations +from ._operations import ExpressRouteCrossConnectionPeeringsOperations +from ._operations import ExpressRoutePortsLocationsOperations +from ._operations import ExpressRoutePortsOperations +from ._operations import ExpressRouteLinksOperations +from ._operations import ExpressRoutePortAuthorizationsOperations +from ._operations import ExpressRouteProviderPortsLocationOperations +from ._operations import FirewallPoliciesOperations +from ._operations import FirewallPolicyRuleCollectionGroupsOperations +from ._operations import FirewallPolicyIdpsSignaturesOperations +from ._operations import FirewallPolicyIdpsSignaturesOverridesOperations +from ._operations import FirewallPolicyIdpsSignaturesFilterValuesOperations +from ._operations import IpAllocationsOperations +from ._operations import IpGroupsOperations +from ._operations import LoadBalancersOperations +from ._operations import LoadBalancerBackendAddressPoolsOperations +from ._operations import LoadBalancerFrontendIPConfigurationsOperations +from ._operations import InboundNatRulesOperations +from ._operations import LoadBalancerLoadBalancingRulesOperations +from ._operations import LoadBalancerOutboundRulesOperations +from ._operations import LoadBalancerNetworkInterfacesOperations +from ._operations import LoadBalancerProbesOperations +from ._operations import NatGatewaysOperations +from ._operations import NetworkInterfaceIPConfigurationsOperations +from ._operations import NetworkInterfaceLoadBalancersOperations +from ._operations import NetworkInterfaceTapConfigurationsOperations +from ._operations import NetworkManagersOperations +from ._operations import NetworkManagerCommitsOperations +from ._operations import NetworkManagerDeploymentStatusOperations +from ._operations import SubscriptionNetworkManagerConnectionsOperations +from ._operations import ManagementGroupNetworkManagerConnectionsOperations +from ._operations import ConnectivityConfigurationsOperations +from ._operations import NetworkGroupsOperations +from ._operations import StaticMembersOperations +from ._operations import ScopeConnectionsOperations +from ._operations import SecurityAdminConfigurationsOperations +from ._operations import AdminRuleCollectionsOperations +from ._operations import AdminRulesOperations +from ._operations import NetworkProfilesOperations +from ._operations import NetworkSecurityGroupsOperations +from ._operations import SecurityRulesOperations +from ._operations import DefaultSecurityRulesOperations +from ._operations import NetworkVirtualAppliancesOperations +from ._operations import VirtualApplianceSitesOperations +from ._operations import VirtualApplianceSkusOperations +from ._operations import InboundSecurityRuleOperations +from ._operations import NetworkWatchersOperations +from ._operations import PacketCapturesOperations +from ._operations import ConnectionMonitorsOperations +from ._operations import FlowLogsOperations +from ._operations import Operations +from ._operations import PrivateEndpointsOperations +from ._operations import AvailablePrivateEndpointTypesOperations +from ._operations import PrivateDnsZoneGroupsOperations +from ._operations import PrivateLinkServicesOperations +from ._operations import PublicIPPrefixesOperations +from ._operations import RouteFiltersOperations +from ._operations import RouteFilterRulesOperations +from ._operations import RouteTablesOperations +from ._operations import RoutesOperations +from ._operations import SecurityPartnerProvidersOperations +from ._operations import BgpServiceCommunitiesOperations +from ._operations import ServiceEndpointPoliciesOperations +from ._operations import ServiceEndpointPolicyDefinitionsOperations +from ._operations import ServiceTagsOperations +from ._operations import ServiceTagInformationOperations +from ._operations import UsagesOperations +from ._operations import VirtualNetworksOperations +from ._operations import SubnetsOperations +from ._operations import ResourceNavigationLinksOperations +from ._operations import ServiceAssociationLinksOperations +from ._operations import VirtualNetworkPeeringsOperations +from ._operations import VirtualNetworkGatewaysOperations +from ._operations import VirtualNetworkGatewayConnectionsOperations +from ._operations import LocalNetworkGatewaysOperations +from ._operations import VirtualNetworkGatewayNatRulesOperations +from ._operations import VirtualNetworkTapsOperations +from ._operations import VirtualRoutersOperations +from ._operations import VirtualRouterPeeringsOperations +from ._operations import VirtualWansOperations +from ._operations import VpnSitesOperations +from ._operations import VpnSiteLinksOperations +from ._operations import VpnSitesConfigurationOperations +from ._operations import VpnServerConfigurationsOperations +from ._operations import ConfigurationPolicyGroupsOperations +from ._operations import VirtualHubsOperations +from ._operations import RouteMapsOperations +from ._operations import HubVirtualNetworkConnectionsOperations +from ._operations import VpnGatewaysOperations +from ._operations import VpnLinkConnectionsOperations +from ._operations import VpnConnectionsOperations +from ._operations import VpnSiteLinkConnectionsOperations +from ._operations import NatRulesOperations +from ._operations import P2SVpnGatewaysOperations +from ._operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from ._operations import VirtualHubRouteTableV2SOperations +from ._operations import ExpressRouteGatewaysOperations +from ._operations import ExpressRouteConnectionsOperations +from ._operations import NetworkVirtualApplianceConnectionsOperations +from ._operations import VirtualHubBgpConnectionOperations +from ._operations import VirtualHubBgpConnectionsOperations +from ._operations import VirtualHubIpConfigurationOperations +from ._operations import HubRouteTablesOperations +from ._operations import RoutingIntentOperations +from ._operations import WebApplicationFirewallPoliciesOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ApplicationGatewaysOperations", + "ApplicationGatewayPrivateLinkResourcesOperations", + "ApplicationGatewayPrivateEndpointConnectionsOperations", + "ApplicationGatewayWafDynamicManifestsDefaultOperations", + "ApplicationGatewayWafDynamicManifestsOperations", + "ApplicationSecurityGroupsOperations", + "AvailableDelegationsOperations", + "AvailableResourceGroupDelegationsOperations", + "AvailableServiceAliasesOperations", + "AzureFirewallsOperations", + "AzureFirewallFqdnTagsOperations", + "WebCategoriesOperations", + "BastionHostsOperations", + "NetworkManagementClientOperationsMixin", + "NetworkInterfacesOperations", + "PublicIPAddressesOperations", + "VipSwapOperations", + "CustomIPPrefixesOperations", + "DdosCustomPoliciesOperations", + "DdosProtectionPlansOperations", + "DscpConfigurationOperations", + "AvailableEndpointServicesOperations", + "ExpressRouteCircuitAuthorizationsOperations", + "ExpressRouteCircuitPeeringsOperations", + "ExpressRouteCircuitConnectionsOperations", + "PeerExpressRouteCircuitConnectionsOperations", + "ExpressRouteCircuitsOperations", + "ExpressRouteServiceProvidersOperations", + "ExpressRouteCrossConnectionsOperations", + "ExpressRouteCrossConnectionPeeringsOperations", + "ExpressRoutePortsLocationsOperations", + "ExpressRoutePortsOperations", + "ExpressRouteLinksOperations", + "ExpressRoutePortAuthorizationsOperations", + "ExpressRouteProviderPortsLocationOperations", + "FirewallPoliciesOperations", + "FirewallPolicyRuleCollectionGroupsOperations", + "FirewallPolicyIdpsSignaturesOperations", + "FirewallPolicyIdpsSignaturesOverridesOperations", + "FirewallPolicyIdpsSignaturesFilterValuesOperations", + "IpAllocationsOperations", + "IpGroupsOperations", + "LoadBalancersOperations", + "LoadBalancerBackendAddressPoolsOperations", + "LoadBalancerFrontendIPConfigurationsOperations", + "InboundNatRulesOperations", + "LoadBalancerLoadBalancingRulesOperations", + "LoadBalancerOutboundRulesOperations", + "LoadBalancerNetworkInterfacesOperations", + "LoadBalancerProbesOperations", + "NatGatewaysOperations", + "NetworkInterfaceIPConfigurationsOperations", + "NetworkInterfaceLoadBalancersOperations", + "NetworkInterfaceTapConfigurationsOperations", + "NetworkManagersOperations", + "NetworkManagerCommitsOperations", + "NetworkManagerDeploymentStatusOperations", + "SubscriptionNetworkManagerConnectionsOperations", + "ManagementGroupNetworkManagerConnectionsOperations", + "ConnectivityConfigurationsOperations", + "NetworkGroupsOperations", + "StaticMembersOperations", + "ScopeConnectionsOperations", + "SecurityAdminConfigurationsOperations", + "AdminRuleCollectionsOperations", + "AdminRulesOperations", + "NetworkProfilesOperations", + "NetworkSecurityGroupsOperations", + "SecurityRulesOperations", + "DefaultSecurityRulesOperations", + "NetworkVirtualAppliancesOperations", + "VirtualApplianceSitesOperations", + "VirtualApplianceSkusOperations", + "InboundSecurityRuleOperations", + "NetworkWatchersOperations", + "PacketCapturesOperations", + "ConnectionMonitorsOperations", + "FlowLogsOperations", + "Operations", + "PrivateEndpointsOperations", + "AvailablePrivateEndpointTypesOperations", + "PrivateDnsZoneGroupsOperations", + "PrivateLinkServicesOperations", + "PublicIPPrefixesOperations", + "RouteFiltersOperations", + "RouteFilterRulesOperations", + "RouteTablesOperations", + "RoutesOperations", + "SecurityPartnerProvidersOperations", + "BgpServiceCommunitiesOperations", + "ServiceEndpointPoliciesOperations", + "ServiceEndpointPolicyDefinitionsOperations", + "ServiceTagsOperations", + "ServiceTagInformationOperations", + "UsagesOperations", + "VirtualNetworksOperations", + "SubnetsOperations", + "ResourceNavigationLinksOperations", + "ServiceAssociationLinksOperations", + "VirtualNetworkPeeringsOperations", + "VirtualNetworkGatewaysOperations", + "VirtualNetworkGatewayConnectionsOperations", + "LocalNetworkGatewaysOperations", + "VirtualNetworkGatewayNatRulesOperations", + "VirtualNetworkTapsOperations", + "VirtualRoutersOperations", + "VirtualRouterPeeringsOperations", + "VirtualWansOperations", + "VpnSitesOperations", + "VpnSiteLinksOperations", + "VpnSitesConfigurationOperations", + "VpnServerConfigurationsOperations", + "ConfigurationPolicyGroupsOperations", + "VirtualHubsOperations", + "RouteMapsOperations", + "HubVirtualNetworkConnectionsOperations", + "VpnGatewaysOperations", + "VpnLinkConnectionsOperations", + "VpnConnectionsOperations", + "VpnSiteLinkConnectionsOperations", + "NatRulesOperations", + "P2SVpnGatewaysOperations", + "VpnServerConfigurationsAssociatedWithVirtualWanOperations", + "VirtualHubRouteTableV2SOperations", + "ExpressRouteGatewaysOperations", + "ExpressRouteConnectionsOperations", + "NetworkVirtualApplianceConnectionsOperations", + "VirtualHubBgpConnectionOperations", + "VirtualHubBgpConnectionsOperations", + "VirtualHubIpConfigurationOperations", + "HubRouteTablesOperations", + "RoutingIntentOperations", + "WebApplicationFirewallPoliciesOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/_operations.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/_operations.py new file mode 100644 index 00000000000..eac1cf24de4 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/_operations.py @@ -0,0 +1,70845 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Literal, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import ( + build_admin_rule_collections_create_or_update_request, + build_admin_rule_collections_delete_request, + build_admin_rule_collections_get_request, + build_admin_rule_collections_list_request, + build_admin_rules_create_or_update_request, + build_admin_rules_delete_request, + build_admin_rules_get_request, + build_admin_rules_list_request, + build_application_gateway_private_endpoint_connections_delete_request, + build_application_gateway_private_endpoint_connections_get_request, + build_application_gateway_private_endpoint_connections_list_request, + build_application_gateway_private_endpoint_connections_update_request, + build_application_gateway_private_link_resources_list_request, + build_application_gateway_waf_dynamic_manifests_default_get_request, + build_application_gateway_waf_dynamic_manifests_get_request, + build_application_gateways_backend_health_on_demand_request, + build_application_gateways_backend_health_request, + build_application_gateways_create_or_update_request, + build_application_gateways_delete_request, + build_application_gateways_get_request, + build_application_gateways_get_ssl_predefined_policy_request, + build_application_gateways_list_all_request, + build_application_gateways_list_available_request_headers_request, + build_application_gateways_list_available_response_headers_request, + build_application_gateways_list_available_server_variables_request, + build_application_gateways_list_available_ssl_options_request, + build_application_gateways_list_available_ssl_predefined_policies_request, + build_application_gateways_list_available_waf_rule_sets_request, + build_application_gateways_list_request, + build_application_gateways_start_request, + build_application_gateways_stop_request, + build_application_gateways_update_tags_request, + build_application_security_groups_create_or_update_request, + build_application_security_groups_delete_request, + build_application_security_groups_get_request, + build_application_security_groups_list_all_request, + build_application_security_groups_list_request, + build_application_security_groups_update_tags_request, + build_available_delegations_list_request, + build_available_endpoint_services_list_request, + build_available_private_endpoint_types_list_by_resource_group_request, + build_available_private_endpoint_types_list_request, + build_available_resource_group_delegations_list_request, + build_available_service_aliases_list_by_resource_group_request, + build_available_service_aliases_list_request, + build_azure_firewall_fqdn_tags_list_all_request, + build_azure_firewalls_create_or_update_request, + build_azure_firewalls_delete_request, + build_azure_firewalls_get_request, + build_azure_firewalls_list_all_request, + build_azure_firewalls_list_learned_prefixes_request, + build_azure_firewalls_list_request, + build_azure_firewalls_packet_capture_request, + build_azure_firewalls_update_tags_request, + build_bastion_hosts_create_or_update_request, + build_bastion_hosts_delete_request, + build_bastion_hosts_get_request, + build_bastion_hosts_list_by_resource_group_request, + build_bastion_hosts_list_request, + build_bastion_hosts_update_tags_request, + build_bgp_service_communities_list_request, + build_configuration_policy_groups_create_or_update_request, + build_configuration_policy_groups_delete_request, + build_configuration_policy_groups_get_request, + build_configuration_policy_groups_list_by_vpn_server_configuration_request, + build_connection_monitors_create_or_update_request, + build_connection_monitors_delete_request, + build_connection_monitors_get_request, + build_connection_monitors_list_request, + build_connection_monitors_query_request, + build_connection_monitors_start_request, + build_connection_monitors_stop_request, + build_connection_monitors_update_tags_request, + build_connectivity_configurations_create_or_update_request, + build_connectivity_configurations_delete_request, + build_connectivity_configurations_get_request, + build_connectivity_configurations_list_request, + build_custom_ip_prefixes_create_or_update_request, + build_custom_ip_prefixes_delete_request, + build_custom_ip_prefixes_get_request, + build_custom_ip_prefixes_list_all_request, + build_custom_ip_prefixes_list_request, + build_custom_ip_prefixes_update_tags_request, + build_ddos_custom_policies_create_or_update_request, + build_ddos_custom_policies_delete_request, + build_ddos_custom_policies_get_request, + build_ddos_custom_policies_update_tags_request, + build_ddos_protection_plans_create_or_update_request, + build_ddos_protection_plans_delete_request, + build_ddos_protection_plans_get_request, + build_ddos_protection_plans_list_by_resource_group_request, + build_ddos_protection_plans_list_request, + build_ddos_protection_plans_update_tags_request, + build_default_security_rules_get_request, + build_default_security_rules_list_request, + build_dscp_configuration_create_or_update_request, + build_dscp_configuration_delete_request, + build_dscp_configuration_get_request, + build_dscp_configuration_list_all_request, + build_dscp_configuration_list_request, + build_express_route_circuit_authorizations_create_or_update_request, + build_express_route_circuit_authorizations_delete_request, + build_express_route_circuit_authorizations_get_request, + build_express_route_circuit_authorizations_list_request, + build_express_route_circuit_connections_create_or_update_request, + build_express_route_circuit_connections_delete_request, + build_express_route_circuit_connections_get_request, + build_express_route_circuit_connections_list_request, + build_express_route_circuit_peerings_create_or_update_request, + build_express_route_circuit_peerings_delete_request, + build_express_route_circuit_peerings_get_request, + build_express_route_circuit_peerings_list_request, + build_express_route_circuits_create_or_update_request, + build_express_route_circuits_delete_request, + build_express_route_circuits_get_peering_stats_request, + build_express_route_circuits_get_request, + build_express_route_circuits_get_stats_request, + build_express_route_circuits_list_all_request, + build_express_route_circuits_list_arp_table_request, + build_express_route_circuits_list_request, + build_express_route_circuits_list_routes_table_request, + build_express_route_circuits_list_routes_table_summary_request, + build_express_route_circuits_update_tags_request, + build_express_route_connections_create_or_update_request, + build_express_route_connections_delete_request, + build_express_route_connections_get_request, + build_express_route_connections_list_request, + build_express_route_cross_connection_peerings_create_or_update_request, + build_express_route_cross_connection_peerings_delete_request, + build_express_route_cross_connection_peerings_get_request, + build_express_route_cross_connection_peerings_list_request, + build_express_route_cross_connections_create_or_update_request, + build_express_route_cross_connections_get_request, + build_express_route_cross_connections_list_arp_table_request, + build_express_route_cross_connections_list_by_resource_group_request, + build_express_route_cross_connections_list_request, + build_express_route_cross_connections_list_routes_table_request, + build_express_route_cross_connections_list_routes_table_summary_request, + build_express_route_cross_connections_update_tags_request, + build_express_route_gateways_create_or_update_request, + build_express_route_gateways_delete_request, + build_express_route_gateways_get_request, + build_express_route_gateways_list_by_resource_group_request, + build_express_route_gateways_list_by_subscription_request, + build_express_route_gateways_update_tags_request, + build_express_route_links_get_request, + build_express_route_links_list_request, + build_express_route_port_authorizations_create_or_update_request, + build_express_route_port_authorizations_delete_request, + build_express_route_port_authorizations_get_request, + build_express_route_port_authorizations_list_request, + build_express_route_ports_create_or_update_request, + build_express_route_ports_delete_request, + build_express_route_ports_generate_loa_request, + build_express_route_ports_get_request, + build_express_route_ports_list_by_resource_group_request, + build_express_route_ports_list_request, + build_express_route_ports_locations_get_request, + build_express_route_ports_locations_list_request, + build_express_route_ports_update_tags_request, + build_express_route_provider_ports_location_list_request, + build_express_route_service_providers_list_request, + build_firewall_policies_create_or_update_request, + build_firewall_policies_delete_request, + build_firewall_policies_get_request, + build_firewall_policies_list_all_request, + build_firewall_policies_list_request, + build_firewall_policies_update_tags_request, + build_firewall_policy_idps_signatures_filter_values_list_request, + build_firewall_policy_idps_signatures_list_request, + build_firewall_policy_idps_signatures_overrides_get_request, + build_firewall_policy_idps_signatures_overrides_list_request, + build_firewall_policy_idps_signatures_overrides_patch_request, + build_firewall_policy_idps_signatures_overrides_put_request, + build_firewall_policy_rule_collection_groups_create_or_update_request, + build_firewall_policy_rule_collection_groups_delete_request, + build_firewall_policy_rule_collection_groups_get_request, + build_firewall_policy_rule_collection_groups_list_request, + build_flow_logs_create_or_update_request, + build_flow_logs_delete_request, + build_flow_logs_get_request, + build_flow_logs_list_request, + build_flow_logs_update_tags_request, + build_hub_route_tables_create_or_update_request, + build_hub_route_tables_delete_request, + build_hub_route_tables_get_request, + build_hub_route_tables_list_request, + build_hub_virtual_network_connections_create_or_update_request, + build_hub_virtual_network_connections_delete_request, + build_hub_virtual_network_connections_get_request, + build_hub_virtual_network_connections_list_request, + build_inbound_nat_rules_create_or_update_request, + build_inbound_nat_rules_delete_request, + build_inbound_nat_rules_get_request, + build_inbound_nat_rules_list_request, + build_inbound_security_rule_create_or_update_request, + build_ip_allocations_create_or_update_request, + build_ip_allocations_delete_request, + build_ip_allocations_get_request, + build_ip_allocations_list_by_resource_group_request, + build_ip_allocations_list_request, + build_ip_allocations_update_tags_request, + build_ip_groups_create_or_update_request, + build_ip_groups_delete_request, + build_ip_groups_get_request, + build_ip_groups_list_by_resource_group_request, + build_ip_groups_list_request, + build_ip_groups_update_groups_request, + build_load_balancer_backend_address_pools_create_or_update_request, + build_load_balancer_backend_address_pools_delete_request, + build_load_balancer_backend_address_pools_get_request, + build_load_balancer_backend_address_pools_list_request, + build_load_balancer_frontend_ip_configurations_get_request, + build_load_balancer_frontend_ip_configurations_list_request, + build_load_balancer_load_balancing_rules_get_request, + build_load_balancer_load_balancing_rules_list_request, + build_load_balancer_network_interfaces_list_request, + build_load_balancer_outbound_rules_get_request, + build_load_balancer_outbound_rules_list_request, + build_load_balancer_probes_get_request, + build_load_balancer_probes_list_request, + build_load_balancers_create_or_update_request, + build_load_balancers_delete_request, + build_load_balancers_get_request, + build_load_balancers_list_all_request, + build_load_balancers_list_inbound_nat_rule_port_mappings_request, + build_load_balancers_list_request, + build_load_balancers_migrate_to_ip_based_request, + build_load_balancers_swap_public_ip_addresses_request, + build_load_balancers_update_tags_request, + build_local_network_gateways_create_or_update_request, + build_local_network_gateways_delete_request, + build_local_network_gateways_get_request, + build_local_network_gateways_list_request, + build_local_network_gateways_update_tags_request, + build_management_group_network_manager_connections_create_or_update_request, + build_management_group_network_manager_connections_delete_request, + build_management_group_network_manager_connections_get_request, + build_management_group_network_manager_connections_list_request, + build_nat_gateways_create_or_update_request, + build_nat_gateways_delete_request, + build_nat_gateways_get_request, + build_nat_gateways_list_all_request, + build_nat_gateways_list_request, + build_nat_gateways_update_tags_request, + build_nat_rules_create_or_update_request, + build_nat_rules_delete_request, + build_nat_rules_get_request, + build_nat_rules_list_by_vpn_gateway_request, + build_network_groups_create_or_update_request, + build_network_groups_delete_request, + build_network_groups_get_request, + build_network_groups_list_request, + build_network_interface_ip_configurations_get_request, + build_network_interface_ip_configurations_list_request, + build_network_interface_load_balancers_list_request, + build_network_interface_tap_configurations_create_or_update_request, + build_network_interface_tap_configurations_delete_request, + build_network_interface_tap_configurations_get_request, + build_network_interface_tap_configurations_list_request, + build_network_interfaces_create_or_update_request, + build_network_interfaces_delete_request, + build_network_interfaces_get_cloud_service_network_interface_request, + build_network_interfaces_get_effective_route_table_request, + build_network_interfaces_get_request, + build_network_interfaces_get_virtual_machine_scale_set_ip_configuration_request, + build_network_interfaces_get_virtual_machine_scale_set_network_interface_request, + build_network_interfaces_list_all_request, + build_network_interfaces_list_cloud_service_network_interfaces_request, + build_network_interfaces_list_cloud_service_role_instance_network_interfaces_request, + build_network_interfaces_list_effective_network_security_groups_request, + build_network_interfaces_list_request, + build_network_interfaces_list_virtual_machine_scale_set_ip_configurations_request, + build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request, + build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request, + build_network_interfaces_update_tags_request, + build_network_management_check_dns_name_availability_request, + build_network_management_delete_bastion_shareable_link_by_token_request, + build_network_management_delete_bastion_shareable_link_request, + build_network_management_disconnect_active_sessions_request, + build_network_management_express_route_provider_port_request, + build_network_management_generatevirtualwanvpnserverconfigurationvpnprofile_request, + build_network_management_get_active_sessions_request, + build_network_management_get_bastion_shareable_link_request, + build_network_management_list_active_connectivity_configurations_request, + build_network_management_list_active_security_admin_rules_request, + build_network_management_list_network_manager_effective_connectivity_configurations_request, + build_network_management_list_network_manager_effective_security_admin_rules_request, + build_network_management_put_bastion_shareable_link_request, + build_network_management_supported_security_providers_request, + build_network_manager_commits_post_request, + build_network_manager_deployment_status_list_request, + build_network_managers_create_or_update_request, + build_network_managers_delete_request, + build_network_managers_get_request, + build_network_managers_list_by_subscription_request, + build_network_managers_list_request, + build_network_managers_patch_request, + build_network_profiles_create_or_update_request, + build_network_profiles_delete_request, + build_network_profiles_get_request, + build_network_profiles_list_all_request, + build_network_profiles_list_request, + build_network_profiles_update_tags_request, + build_network_security_groups_create_or_update_request, + build_network_security_groups_delete_request, + build_network_security_groups_get_request, + build_network_security_groups_list_all_request, + build_network_security_groups_list_request, + build_network_security_groups_update_tags_request, + build_network_virtual_appliance_connections_create_or_update_request, + build_network_virtual_appliance_connections_delete_request, + build_network_virtual_appliance_connections_get_request, + build_network_virtual_appliance_connections_list_request, + build_network_virtual_appliances_create_or_update_request, + build_network_virtual_appliances_delete_request, + build_network_virtual_appliances_get_request, + build_network_virtual_appliances_list_by_resource_group_request, + build_network_virtual_appliances_list_request, + build_network_virtual_appliances_update_tags_request, + build_network_watchers_check_connectivity_request, + build_network_watchers_create_or_update_request, + build_network_watchers_delete_request, + build_network_watchers_get_azure_reachability_report_request, + build_network_watchers_get_flow_log_status_request, + build_network_watchers_get_network_configuration_diagnostic_request, + build_network_watchers_get_next_hop_request, + build_network_watchers_get_request, + build_network_watchers_get_topology_request, + build_network_watchers_get_troubleshooting_request, + build_network_watchers_get_troubleshooting_result_request, + build_network_watchers_get_vm_security_rules_request, + build_network_watchers_list_all_request, + build_network_watchers_list_available_providers_request, + build_network_watchers_list_request, + build_network_watchers_set_flow_log_configuration_request, + build_network_watchers_update_tags_request, + build_network_watchers_verify_ip_flow_request, + build_operations_list_request, + build_p2_svpn_gateways_create_or_update_request, + build_p2_svpn_gateways_delete_request, + build_p2_svpn_gateways_disconnect_p2_s_vpn_connections_request, + build_p2_svpn_gateways_generate_vpn_profile_request, + build_p2_svpn_gateways_get_p2_s_vpn_connection_health_detailed_request, + build_p2_svpn_gateways_get_p2_s_vpn_connection_health_request, + build_p2_svpn_gateways_get_request, + build_p2_svpn_gateways_list_by_resource_group_request, + build_p2_svpn_gateways_list_request, + build_p2_svpn_gateways_reset_request, + build_p2_svpn_gateways_update_tags_request, + build_packet_captures_create_request, + build_packet_captures_delete_request, + build_packet_captures_get_request, + build_packet_captures_get_status_request, + build_packet_captures_list_request, + build_packet_captures_stop_request, + build_peer_express_route_circuit_connections_get_request, + build_peer_express_route_circuit_connections_list_request, + build_private_dns_zone_groups_create_or_update_request, + build_private_dns_zone_groups_delete_request, + build_private_dns_zone_groups_get_request, + build_private_dns_zone_groups_list_request, + build_private_endpoints_create_or_update_request, + build_private_endpoints_delete_request, + build_private_endpoints_get_request, + build_private_endpoints_list_by_subscription_request, + build_private_endpoints_list_request, + build_private_link_services_check_private_link_service_visibility_by_resource_group_request, + build_private_link_services_check_private_link_service_visibility_request, + build_private_link_services_create_or_update_request, + build_private_link_services_delete_private_endpoint_connection_request, + build_private_link_services_delete_request, + build_private_link_services_get_private_endpoint_connection_request, + build_private_link_services_get_request, + build_private_link_services_list_auto_approved_private_link_services_by_resource_group_request, + build_private_link_services_list_auto_approved_private_link_services_request, + build_private_link_services_list_by_subscription_request, + build_private_link_services_list_private_endpoint_connections_request, + build_private_link_services_list_request, + build_private_link_services_update_private_endpoint_connection_request, + build_public_ip_addresses_create_or_update_request, + build_public_ip_addresses_ddos_protection_status_request, + build_public_ip_addresses_delete_request, + build_public_ip_addresses_get_cloud_service_public_ip_address_request, + build_public_ip_addresses_get_request, + build_public_ip_addresses_get_virtual_machine_scale_set_public_ip_address_request, + build_public_ip_addresses_list_all_request, + build_public_ip_addresses_list_cloud_service_public_ip_addresses_request, + build_public_ip_addresses_list_cloud_service_role_instance_public_ip_addresses_request, + build_public_ip_addresses_list_request, + build_public_ip_addresses_list_virtual_machine_scale_set_public_ip_addresses_request, + build_public_ip_addresses_list_virtual_machine_scale_set_vm_public_ip_addresses_request, + build_public_ip_addresses_update_tags_request, + build_public_ip_prefixes_create_or_update_request, + build_public_ip_prefixes_delete_request, + build_public_ip_prefixes_get_request, + build_public_ip_prefixes_list_all_request, + build_public_ip_prefixes_list_request, + build_public_ip_prefixes_update_tags_request, + build_resource_navigation_links_list_request, + build_route_filter_rules_create_or_update_request, + build_route_filter_rules_delete_request, + build_route_filter_rules_get_request, + build_route_filter_rules_list_by_route_filter_request, + build_route_filters_create_or_update_request, + build_route_filters_delete_request, + build_route_filters_get_request, + build_route_filters_list_by_resource_group_request, + build_route_filters_list_request, + build_route_filters_update_tags_request, + build_route_maps_create_or_update_request, + build_route_maps_delete_request, + build_route_maps_get_request, + build_route_maps_list_request, + build_route_tables_create_or_update_request, + build_route_tables_delete_request, + build_route_tables_get_request, + build_route_tables_list_all_request, + build_route_tables_list_request, + build_route_tables_update_tags_request, + build_routes_create_or_update_request, + build_routes_delete_request, + build_routes_get_request, + build_routes_list_request, + build_routing_intent_create_or_update_request, + build_routing_intent_delete_request, + build_routing_intent_get_request, + build_routing_intent_list_request, + build_scope_connections_create_or_update_request, + build_scope_connections_delete_request, + build_scope_connections_get_request, + build_scope_connections_list_request, + build_security_admin_configurations_create_or_update_request, + build_security_admin_configurations_delete_request, + build_security_admin_configurations_get_request, + build_security_admin_configurations_list_request, + build_security_partner_providers_create_or_update_request, + build_security_partner_providers_delete_request, + build_security_partner_providers_get_request, + build_security_partner_providers_list_by_resource_group_request, + build_security_partner_providers_list_request, + build_security_partner_providers_update_tags_request, + build_security_rules_create_or_update_request, + build_security_rules_delete_request, + build_security_rules_get_request, + build_security_rules_list_request, + build_service_association_links_list_request, + build_service_endpoint_policies_create_or_update_request, + build_service_endpoint_policies_delete_request, + build_service_endpoint_policies_get_request, + build_service_endpoint_policies_list_by_resource_group_request, + build_service_endpoint_policies_list_request, + build_service_endpoint_policies_update_tags_request, + build_service_endpoint_policy_definitions_create_or_update_request, + build_service_endpoint_policy_definitions_delete_request, + build_service_endpoint_policy_definitions_get_request, + build_service_endpoint_policy_definitions_list_by_resource_group_request, + build_service_tag_information_list_request, + build_service_tags_list_request, + build_static_members_create_or_update_request, + build_static_members_delete_request, + build_static_members_get_request, + build_static_members_list_request, + build_subnets_create_or_update_request, + build_subnets_delete_request, + build_subnets_get_request, + build_subnets_list_request, + build_subnets_prepare_network_policies_request, + build_subnets_unprepare_network_policies_request, + build_subscription_network_manager_connections_create_or_update_request, + build_subscription_network_manager_connections_delete_request, + build_subscription_network_manager_connections_get_request, + build_subscription_network_manager_connections_list_request, + build_usages_list_request, + build_vip_swap_create_request, + build_vip_swap_get_request, + build_vip_swap_list_request, + build_virtual_appliance_sites_create_or_update_request, + build_virtual_appliance_sites_delete_request, + build_virtual_appliance_sites_get_request, + build_virtual_appliance_sites_list_request, + build_virtual_appliance_skus_get_request, + build_virtual_appliance_skus_list_request, + build_virtual_hub_bgp_connection_create_or_update_request, + build_virtual_hub_bgp_connection_delete_request, + build_virtual_hub_bgp_connection_get_request, + build_virtual_hub_bgp_connections_list_advertised_routes_request, + build_virtual_hub_bgp_connections_list_learned_routes_request, + build_virtual_hub_bgp_connections_list_request, + build_virtual_hub_ip_configuration_create_or_update_request, + build_virtual_hub_ip_configuration_delete_request, + build_virtual_hub_ip_configuration_get_request, + build_virtual_hub_ip_configuration_list_request, + build_virtual_hub_route_table_v2_s_create_or_update_request, + build_virtual_hub_route_table_v2_s_delete_request, + build_virtual_hub_route_table_v2_s_get_request, + build_virtual_hub_route_table_v2_s_list_request, + build_virtual_hubs_create_or_update_request, + build_virtual_hubs_delete_request, + build_virtual_hubs_get_effective_virtual_hub_routes_request, + build_virtual_hubs_get_inbound_routes_request, + build_virtual_hubs_get_outbound_routes_request, + build_virtual_hubs_get_request, + build_virtual_hubs_list_by_resource_group_request, + build_virtual_hubs_list_request, + build_virtual_hubs_update_tags_request, + build_virtual_network_gateway_connections_create_or_update_request, + build_virtual_network_gateway_connections_delete_request, + build_virtual_network_gateway_connections_get_ike_sas_request, + build_virtual_network_gateway_connections_get_request, + build_virtual_network_gateway_connections_get_shared_key_request, + build_virtual_network_gateway_connections_list_request, + build_virtual_network_gateway_connections_reset_connection_request, + build_virtual_network_gateway_connections_reset_shared_key_request, + build_virtual_network_gateway_connections_set_shared_key_request, + build_virtual_network_gateway_connections_start_packet_capture_request, + build_virtual_network_gateway_connections_stop_packet_capture_request, + build_virtual_network_gateway_connections_update_tags_request, + build_virtual_network_gateway_nat_rules_create_or_update_request, + build_virtual_network_gateway_nat_rules_delete_request, + build_virtual_network_gateway_nat_rules_get_request, + build_virtual_network_gateway_nat_rules_list_by_virtual_network_gateway_request, + build_virtual_network_gateways_create_or_update_request, + build_virtual_network_gateways_delete_request, + build_virtual_network_gateways_disconnect_virtual_network_gateway_vpn_connections_request, + build_virtual_network_gateways_generate_vpn_profile_request, + build_virtual_network_gateways_generatevpnclientpackage_request, + build_virtual_network_gateways_get_advertised_routes_request, + build_virtual_network_gateways_get_bgp_peer_status_request, + build_virtual_network_gateways_get_learned_routes_request, + build_virtual_network_gateways_get_request, + build_virtual_network_gateways_get_vpn_profile_package_url_request, + build_virtual_network_gateways_get_vpnclient_connection_health_request, + build_virtual_network_gateways_get_vpnclient_ipsec_parameters_request, + build_virtual_network_gateways_list_connections_request, + build_virtual_network_gateways_list_request, + build_virtual_network_gateways_reset_request, + build_virtual_network_gateways_reset_vpn_client_shared_key_request, + build_virtual_network_gateways_set_vpnclient_ipsec_parameters_request, + build_virtual_network_gateways_start_packet_capture_request, + build_virtual_network_gateways_stop_packet_capture_request, + build_virtual_network_gateways_supported_vpn_devices_request, + build_virtual_network_gateways_update_tags_request, + build_virtual_network_gateways_vpn_device_configuration_script_request, + build_virtual_network_peerings_create_or_update_request, + build_virtual_network_peerings_delete_request, + build_virtual_network_peerings_get_request, + build_virtual_network_peerings_list_request, + build_virtual_network_taps_create_or_update_request, + build_virtual_network_taps_delete_request, + build_virtual_network_taps_get_request, + build_virtual_network_taps_list_all_request, + build_virtual_network_taps_list_by_resource_group_request, + build_virtual_network_taps_update_tags_request, + build_virtual_networks_check_ip_address_availability_request, + build_virtual_networks_create_or_update_request, + build_virtual_networks_delete_request, + build_virtual_networks_get_request, + build_virtual_networks_list_all_request, + build_virtual_networks_list_ddos_protection_status_request, + build_virtual_networks_list_request, + build_virtual_networks_list_usage_request, + build_virtual_networks_update_tags_request, + build_virtual_router_peerings_create_or_update_request, + build_virtual_router_peerings_delete_request, + build_virtual_router_peerings_get_request, + build_virtual_router_peerings_list_request, + build_virtual_routers_create_or_update_request, + build_virtual_routers_delete_request, + build_virtual_routers_get_request, + build_virtual_routers_list_by_resource_group_request, + build_virtual_routers_list_request, + build_virtual_wans_create_or_update_request, + build_virtual_wans_delete_request, + build_virtual_wans_get_request, + build_virtual_wans_list_by_resource_group_request, + build_virtual_wans_list_request, + build_virtual_wans_update_tags_request, + build_vpn_connections_create_or_update_request, + build_vpn_connections_delete_request, + build_vpn_connections_get_request, + build_vpn_connections_list_by_vpn_gateway_request, + build_vpn_connections_start_packet_capture_request, + build_vpn_connections_stop_packet_capture_request, + build_vpn_gateways_create_or_update_request, + build_vpn_gateways_delete_request, + build_vpn_gateways_get_request, + build_vpn_gateways_list_by_resource_group_request, + build_vpn_gateways_list_request, + build_vpn_gateways_reset_request, + build_vpn_gateways_start_packet_capture_request, + build_vpn_gateways_stop_packet_capture_request, + build_vpn_gateways_update_tags_request, + build_vpn_link_connections_get_ike_sas_request, + build_vpn_link_connections_list_by_vpn_connection_request, + build_vpn_link_connections_reset_connection_request, + build_vpn_server_configurations_associated_with_virtual_wan_list_request, + build_vpn_server_configurations_create_or_update_request, + build_vpn_server_configurations_delete_request, + build_vpn_server_configurations_get_request, + build_vpn_server_configurations_list_by_resource_group_request, + build_vpn_server_configurations_list_request, + build_vpn_server_configurations_update_tags_request, + build_vpn_site_link_connections_get_request, + build_vpn_site_links_get_request, + build_vpn_site_links_list_by_vpn_site_request, + build_vpn_sites_configuration_download_request, + build_vpn_sites_create_or_update_request, + build_vpn_sites_delete_request, + build_vpn_sites_get_request, + build_vpn_sites_list_by_resource_group_request, + build_vpn_sites_list_request, + build_vpn_sites_update_tags_request, + build_web_application_firewall_policies_create_or_update_request, + build_web_application_firewall_policies_delete_request, + build_web_application_firewall_policies_get_request, + build_web_application_firewall_policies_list_all_request, + build_web_application_firewall_policies_list_request, + build_web_categories_get_request, + build_web_categories_list_by_subscription_request, +) +from .._vendor import NetworkManagementClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ApplicationGatewaysOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`application_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_delete_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> _models.ApplicationGateway: + """Gets the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + _request = build_application_gateways_get_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.ApplicationGateway, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationGateway") + + _request = build_application_gateways_create_or_update_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: _models.ApplicationGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.ApplicationGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Is either a ApplicationGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_gateways_update_tags_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ApplicationGateway"]: + """Lists all application gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ApplicationGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.ApplicationGateway"]: + """Gets all the application gateways in a subscription. + + :return: An iterator like instance of either ApplicationGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_start_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_stop_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _backend_health_initial( + self, resource_group_name: str, application_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.ApplicationGatewayBackendHealth]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ApplicationGatewayBackendHealth]] = kwargs.pop("cls", None) + + _request = build_application_gateways_backend_health_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayBackendHealth", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_backend_health( + self, resource_group_name: str, application_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayBackendHealth]: + """Gets the backend health of the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayBackendHealth] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._backend_health_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + expand=expand, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayBackendHealth", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGatewayBackendHealth].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGatewayBackendHealth]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _backend_health_on_demand_initial( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: Union[_models.ApplicationGatewayOnDemandProbe, IO[bytes]], + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.ApplicationGatewayBackendHealthOnDemand]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ApplicationGatewayBackendHealthOnDemand]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(probe_request, (IOBase, bytes)): + _content = probe_request + else: + _json = self._serialize.body(probe_request, "ApplicationGatewayOnDemandProbe") + + _request = build_application_gateways_backend_health_on_demand_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayBackendHealthOnDemand", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: _models.ApplicationGatewayOnDemandProbe, + *, + expand: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Required. + :type probe_request: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayOnDemandProbe + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: IO[bytes], + *, + expand: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Required. + :type probe_request: IO[bytes] + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: Union[_models.ApplicationGatewayOnDemandProbe, IO[bytes]], + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Is either a + ApplicationGatewayOnDemandProbe type or a IO[bytes] type. Required. + :type probe_request: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayOnDemandProbe or + IO[bytes] + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGatewayBackendHealthOnDemand] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._backend_health_on_demand_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + probe_request=probe_request, + expand=expand, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayBackendHealthOnDemand", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGatewayBackendHealthOnDemand]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def list_available_server_variables(self, **kwargs: Any) -> List[str]: + """Lists all available server variables. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_server_variables_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_available_request_headers(self, **kwargs: Any) -> List[str]: + """Lists all available request headers. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_request_headers_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_available_response_headers(self, **kwargs: Any) -> List[str]: + """Lists all available response headers. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_response_headers_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_available_waf_rule_sets(self, **kwargs: Any) -> _models.ApplicationGatewayAvailableWafRuleSetsResult: + """Lists all available web application firewall rule sets. + + :return: ApplicationGatewayAvailableWafRuleSetsResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayAvailableWafRuleSetsResult] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_waf_rule_sets_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayAvailableWafRuleSetsResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_available_ssl_options(self, **kwargs: Any) -> _models.ApplicationGatewayAvailableSslOptions: + """Lists available Ssl options for configuring Ssl policy. + + :return: ApplicationGatewayAvailableSslOptions or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAvailableSslOptions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayAvailableSslOptions] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_ssl_options_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayAvailableSslOptions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_available_ssl_predefined_policies( + self, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationGatewaySslPredefinedPolicy"]: + """Lists all SSL predefined policies for configuring Ssl policy. + + :return: An iterator like instance of either ApplicationGatewaySslPredefinedPolicy or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPredefinedPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayAvailableSslPredefinedPolicies] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_available_ssl_predefined_policies_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayAvailableSslPredefinedPolicies", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_ssl_predefined_policy( + self, predefined_policy_name: str, **kwargs: Any + ) -> _models.ApplicationGatewaySslPredefinedPolicy: + """Gets Ssl predefined policy with the specified policy name. + + :param predefined_policy_name: Name of Ssl predefined policy. Required. + :type predefined_policy_name: str + :return: ApplicationGatewaySslPredefinedPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPredefinedPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewaySslPredefinedPolicy] = kwargs.pop("cls", None) + + _request = build_application_gateways_get_ssl_predefined_policy_request( + predefined_policy_name=predefined_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewaySslPredefinedPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ApplicationGatewayPrivateLinkResourcesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`application_gateway_private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationGatewayPrivateLinkResource"]: + """Lists all private link resources on an application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An iterator like instance of either ApplicationGatewayPrivateLinkResource or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayPrivateLinkResourceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_private_link_resources_list_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateLinkResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ApplicationGatewayPrivateEndpointConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`application_gateway_private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateway_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: Union[_models.ApplicationGatewayPrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ApplicationGatewayPrivateEndpointConnection]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ApplicationGatewayPrivateEndpointConnection]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationGatewayPrivateEndpointConnection") + + _request = build_application_gateway_private_endpoint_connections_update_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: _models.ApplicationGatewayPrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: Union[_models.ApplicationGatewayPrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Is either a ApplicationGatewayPrivateEndpointConnection type or a + IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationGatewayPrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.ApplicationGatewayPrivateEndpointConnection: + """Gets the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :return: ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_application_gateway_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationGatewayPrivateEndpointConnection"]: + """Lists all private endpoint connections on an application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An iterator like instance of either ApplicationGatewayPrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ApplicationGatewayWafDynamicManifestsDefaultOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`application_gateway_waf_dynamic_manifests_default` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, location: str, **kwargs: Any) -> _models.ApplicationGatewayWafDynamicManifestResult: + """Gets the regional application gateway waf manifest. + + :param location: The region where the nrp are located at. Required. + :type location: str + :return: ApplicationGatewayWafDynamicManifestResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafDynamicManifestResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayWafDynamicManifestResult] = kwargs.pop("cls", None) + + _request = build_application_gateway_waf_dynamic_manifests_default_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayWafDynamicManifestResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ApplicationGatewayWafDynamicManifestsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`application_gateway_waf_dynamic_manifests` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ApplicationGatewayWafDynamicManifestResult"]: + """Gets the regional application gateway waf manifest. + + :param location: The region where the nrp are located at. Required. + :type location: str + :return: An iterator like instance of either ApplicationGatewayWafDynamicManifestResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafDynamicManifestResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayWafDynamicManifestResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_waf_dynamic_manifests_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayWafDynamicManifestResultList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ApplicationSecurityGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`application_security_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_security_groups_delete_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Gets information about the specified application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + _request = build_application_security_groups_get_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.ApplicationSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationSecurityGroup") + + _request = build_application_security_groups_create_or_update_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: _models.ApplicationSecurityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.ApplicationSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Is either a ApplicationSecurityGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_security_groups_update_tags_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.ApplicationSecurityGroup"]: + """Gets all application security groups in a subscription. + + :return: An iterator like instance of either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_security_groups_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ApplicationSecurityGroup"]: + """Gets all the application security groups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_security_groups_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AvailableDelegationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`available_delegations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableDelegation"]: + """Gets all of the available subnet delegations for this subscription in this region. + + :param location: The location of the subnet. Required. + :type location: str + :return: An iterator like instance of either AvailableDelegation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableDelegation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableDelegationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_delegations_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableDelegationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AvailableResourceGroupDelegationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`available_resource_group_delegations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, location: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AvailableDelegation"]: + """Gets all of the available subnet delegations for this resource group in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AvailableDelegation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableDelegation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableDelegationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_resource_group_delegations_list_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableDelegationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AvailableServiceAliasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`available_service_aliases` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableServiceAlias"]: + """Gets all available service aliases for this subscription in this region. + + :param location: The location. Required. + :type location: str + :return: An iterator like instance of either AvailableServiceAlias or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableServiceAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableServiceAliasesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_service_aliases_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableServiceAliasesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, location: str, **kwargs: Any + ) -> AsyncIterable["_models.AvailableServiceAlias"]: + """Gets all available service aliases for this resource group in this region. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param location: The location. Required. + :type location: str + :return: An iterator like instance of either AvailableServiceAlias or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableServiceAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableServiceAliasesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_service_aliases_list_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableServiceAliasesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AzureFirewallsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`azure_firewalls` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_delete_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any) -> _models.AzureFirewall: + """Gets the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :return: AzureFirewall or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AzureFirewall + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_get_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.AzureFirewall, IO[bytes]], + **kwargs: Any + ) -> _models.AzureFirewall: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AzureFirewall") + + _request = build_azure_firewalls_create_or_update_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: _models.AzureFirewall, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureFirewall + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.AzureFirewall, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. Is + either a AzureFirewall type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureFirewall or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureFirewall", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AzureFirewall].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AzureFirewall]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.AzureFirewall]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AzureFirewall]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_azure_firewalls_update_tags_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureFirewall", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AzureFirewall].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AzureFirewall]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.AzureFirewall"]: + """Lists all Azure Firewalls in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AzureFirewall or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewallListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewalls_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.AzureFirewall"]: + """Gets all the Azure Firewalls in a subscription. + + :return: An iterator like instance of either AzureFirewall or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewallListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewalls_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _list_learned_prefixes_initial( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> Optional[_models.IPPrefixesList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.IPPrefixesList]] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_list_learned_prefixes_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("IPPrefixesList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_learned_prefixes( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.IPPrefixesList]: + """Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the azure firewall. Required. + :type azure_firewall_name: str + :return: An instance of AsyncLROPoller that returns either IPPrefixesList or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IPPrefixesList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IPPrefixesList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_learned_prefixes_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IPPrefixesList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IPPrefixesList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IPPrefixesList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _packet_capture_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.FirewallPacketCaptureParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPacketCaptureParameters") + + _request = build_azure_firewalls_packet_capture_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: _models.FirewallPacketCaptureParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPacketCaptureParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.FirewallPacketCaptureParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Is either a + FirewallPacketCaptureParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPacketCaptureParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._packet_capture_initial( # type: ignore + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AzureFirewallFqdnTagsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`azure_firewall_fqdn_tags` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.AzureFirewallFqdnTag"]: + """Gets all the Azure Firewall FQDN Tags in a subscription. + + :return: An iterator like instance of either AzureFirewallFqdnTag or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureFirewallFqdnTag] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewallFqdnTagListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewall_fqdn_tags_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallFqdnTagListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class WebCategoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`web_categories` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, name: str, *, expand: Optional[str] = None, **kwargs: Any) -> _models.AzureWebCategory: + """Gets the specified Azure Web Category. + + :param name: The name of the azureWebCategory. Required. + :type name: str + :keyword expand: Expands resourceIds back referenced by the azureWebCategory resource. Default + value is None. + :paramtype expand: str + :return: AzureWebCategory or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AzureWebCategory + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureWebCategory] = kwargs.pop("cls", None) + + _request = build_web_categories_get_request( + name=name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureWebCategory", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AzureWebCategory"]: + """Gets all the Azure Web Categories in a subscription. + + :return: An iterator like instance of either AzureWebCategory or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureWebCategory] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureWebCategoryListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_categories_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureWebCategoryListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class BastionHostsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`bastion_hosts` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_bastion_hosts_delete_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, bastion_host_name: str, **kwargs: Any) -> _models.BastionHost: + """Gets the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: BastionHost or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BastionHost + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + + _request = build_bastion_hosts_get_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.BastionHost, IO[bytes]], + **kwargs: Any + ) -> _models.BastionHost: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BastionHost") + + _request = build_bastion_hosts_create_or_update_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: _models.BastionHost, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BastionHost + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.BastionHost, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. Is + either a BastionHost type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BastionHost or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BastionHost", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BastionHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BastionHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.BastionHost]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BastionHost]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_bastion_hosts_update_tags_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BastionHost", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BastionHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BastionHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.BastionHost"]: + """Lists all Bastion Hosts in a subscription. + + :return: An iterator like instance of either BastionHost or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bastion_hosts_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.BastionHost"]: + """Lists all Bastion Hosts in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either BastionHost or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bastion_hosts_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkManagementClientOperationsMixin(NetworkManagementClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + + async def _put_bastion_shareable_link_initial( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.BastionShareableLinkListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("_put_bastion_shareable_link_initial") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BastionShareableLinkListResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + _request = build_network_management_put_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: _models.BastionShareableLinkListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("begin_put_bastion_shareable_link") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionShareableLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_put_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._put_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncIterable["_models.BastionShareableLink"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_bastion_shareable_link_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("_delete_bastion_shareable_link_initial") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + _request = build_network_management_delete_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: _models.BastionShareableLinkListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("begin_delete_bastion_shareable_link") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_bastion_shareable_link_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_bastion_shareable_link_by_token_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("_delete_bastion_shareable_link_by_token_initial") or "2023-09-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_token_request, (IOBase, bytes)): + _content = bsl_token_request + else: + _json = self._serialize.body(bsl_token_request, "BastionShareableLinkTokenListRequest") + + _request = build_network_management_delete_bastion_shareable_link_by_token_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: _models.BastionShareableLinkTokenListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. + Required. + :type bsl_token_request: + ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. + Required. + :type bsl_token_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is + either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required. + :type bsl_token_request: + ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("begin_delete_bastion_shareable_link_by_token") or "2023-09-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_bastion_shareable_link_by_token_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_token_request=bsl_token_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: _models.BastionShareableLinkListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncIterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("get_bastion_shareable_link") or "2023-09-01") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionShareableLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_get_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _get_active_sessions_initial( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> Optional[_models.BastionActiveSessionListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("_get_active_sessions_initial") or "2023-09-01") + ) + cls: ClsType[Optional[_models.BastionActiveSessionListResult]] = kwargs.pop("cls", None) + + _request = build_network_management_get_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionActiveSessionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_active_sessions( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.BastionActiveSession"]]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionActiveSessionListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionActiveSession]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("begin_get_active_sessions") or "2023-09-01") + ) + cls: ClsType[_models.BastionActiveSessionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_get_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionActiveSessionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_active_sessions_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[AsyncIterable["_models.BastionActiveSession"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncIterable["_models.BastionActiveSession"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: _models.SessionIds, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Required. + :type session_ids: ~azure.mgmt.network.v2023_09_01.models.SessionIds + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Required. + :type session_ids: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: Union[_models.SessionIds, IO[bytes]], + **kwargs: Any + ) -> AsyncIterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Is either a SessionIds type or a + IO[bytes] type. Required. + :type session_ids: ~azure.mgmt.network.v2023_09_01.models.SessionIds or IO[bytes] + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("disconnect_active_sessions") or "2023-09-01") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionSessionDeleteResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(session_ids, (IOBase, bytes)): + _content = session_ids + else: + _json = self._serialize.body(session_ids, "SessionIds") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_disconnect_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BastionSessionDeleteResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def check_dns_name_availability( + self, location: str, *, domain_name_label: str, **kwargs: Any + ) -> _models.DnsNameAvailabilityResult: + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + + :param location: The location of the domain name. Required. + :type location: str + :keyword domain_name_label: The domain name to be verified. It must conform to the following + regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Required. + :paramtype domain_name_label: str + :return: DnsNameAvailabilityResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DnsNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_dns_name_availability") or "2023-09-01") + ) + cls: ClsType[_models.DnsNameAvailabilityResult] = kwargs.pop("cls", None) + + _request = build_network_management_check_dns_name_availability_request( + location=location, + subscription_id=self._config.subscription_id, + domain_name_label=domain_name_label, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DnsNameAvailabilityResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def express_route_provider_port(self, providerport: str, **kwargs: Any) -> _models.ExpressRouteProviderPort: + """Retrieves detail of a provider port. + + :param providerport: The name of the provider port. Required. + :type providerport: str + :return: ExpressRouteProviderPort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("express_route_provider_port") or "2023-09-01") + ) + cls: ClsType[_models.ExpressRouteProviderPort] = kwargs.pop("cls", None) + + _request = build_network_management_express_route_provider_port_request( + providerport=providerport, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteProviderPort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.ActiveConfigurationParameter, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or + IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("list_active_connectivity_configurations") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveConnectivityConfigurationsListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_network_management_list_active_connectivity_configurations_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveConnectivityConfigurationsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.ActiveConfigurationParameter, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or + IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("list_active_security_admin_rules") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_network_management_list_active_security_admin_rules_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.QueryRequestOptions, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("list_network_manager_effective_connectivity_configurations") or "2023-09-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_management_list_network_manager_effective_connectivity_configurations_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize( + "NetworkManagerEffectiveConnectivityConfigurationListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.QueryRequestOptions, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("list_network_manager_effective_security_admin_rules") or "2023-09-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_management_list_network_manager_effective_security_admin_rules_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerEffectiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def supported_security_providers( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> _models.VirtualWanSecurityProviders: + """Gives the supported security providers for the virtual wan. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which supported security providers are + needed. Required. + :type virtual_wan_name: str + :return: VirtualWanSecurityProviders or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProviders + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("supported_security_providers") or "2023-09-01") + ) + cls: ClsType[_models.VirtualWanSecurityProviders] = kwargs.pop("cls", None) + + _request = build_network_management_supported_security_providers_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWanSecurityProviders", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnProfileResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("_generatevirtualwanvpnserverconfigurationvpnprofile_initial") or "2023-09-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnProfileResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_client_params, (IOBase, bytes)): + _content = vpn_client_params + else: + _json = self._serialize.body(vpn_client_params, "VirtualWanVpnProfileParameters") + + _request = build_network_management_generatevirtualwanvpnserverconfigurationvpnprofile_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: _models.VirtualWanVpnProfileParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Required. + :type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Required. + :type vpn_client_params: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required. + :type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("begin_generatevirtualwanvpnserverconfigurationvpnprofile") or "2023-09-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnProfileResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generatevirtualwanvpnserverconfigurationvpnprofile_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + vpn_client_params=vpn_client_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnProfileResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnProfileResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_interfaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_cloud_service_role_instance_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, cloud_service_name: str, role_instance_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets information about all network interfaces in a role instance in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_cloud_service_role_instance_network_interfaces_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_cloud_service_network_interfaces( + self, resource_group_name: str, cloud_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_cloud_service_network_interfaces_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_cloud_service_network_interface( + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterface: + """Get the specified network interface in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_cloud_service_network_interface_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_interfaces_delete_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_interface_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkInterface: + """Gets information about the specified network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.NetworkInterface, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkInterface") + + _request = build_network_interfaces_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: _models.NetworkInterface, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.NetworkInterface, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. Is + either a NetworkInterface type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterface", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_interfaces_update_tags_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a subscription. + + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _get_effective_route_table_initial( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Optional[_models.EffectiveRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.EffectiveRouteListResult]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_effective_route_table_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_effective_route_table( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteListResult]: + """Gets all route tables applied to a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.EffectiveRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_effective_route_table_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_effective_network_security_groups_initial( # pylint: disable=name-too-long + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Optional[_models.EffectiveNetworkSecurityGroupListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.EffectiveNetworkSecurityGroupListResult]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_list_effective_network_security_groups_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveNetworkSecurityGroupListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_effective_network_security_groups( # pylint: disable=name-too-long + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveNetworkSecurityGroupListResult]: + """Gets all network security groups applied to a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns either + EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityGroupListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.EffectiveNetworkSecurityGroupListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_effective_network_security_groups_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveNetworkSecurityGroupListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveNetworkSecurityGroupListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveNetworkSecurityGroupListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_virtual_machine_scale_set_vm_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets information about all network interfaces in a virtual machine in a virtual machine scale + set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_virtual_machine_scale_set_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets all network interfaces in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_virtual_machine_scale_set_network_interface( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterface: + """Get the specified network interface in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_virtual_machine_scale_set_network_interface_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_virtual_machine_scale_set_ip_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterfaceIPConfiguration"]: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: An iterator like instance of either NetworkInterfaceIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_ip_configurations_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_virtual_machine_scale_set_ip_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterfaceIPConfiguration: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration. Required. + :type ip_configuration_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterfaceIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceIPConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_virtual_machine_scale_set_ip_configuration_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PublicIPAddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`public_ip_addresses` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_cloud_service_public_ip_addresses( + self, resource_group_name: str, cloud_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses on a cloud service level. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_cloud_service_public_ip_addresses_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_cloud_service_role_instance_public_ip_addresses( # pylint: disable=name-too-long + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses in a role instance IP configuration in a cloud + service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :param network_interface_name: The network interface name. Required. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. Required. + :type ip_configuration_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_cloud_service_role_instance_public_ip_addresses_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_cloud_service_public_ip_address( + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PublicIPAddress: + """Get the specified public IP address in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The role instance name. Required. + :type role_instance_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. Required. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_cloud_service_public_ip_address_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_delete_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, public_ip_address_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PublicIPAddress: + """Gets the specified public IP address in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.PublicIPAddress, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PublicIPAddress") + + _request = build_public_ip_addresses_create_or_update_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: _models.PublicIPAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.PublicIPAddress, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. Is + either a PublicIPAddress type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIPAddress].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIPAddress]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_addresses_update_tags_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets all the public IP addresses in a subscription. + + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets all public IP addresses in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _ddos_protection_status_initial( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> Optional[_models.PublicIpDdosProtectionStatusResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.PublicIpDdosProtectionStatusResult]] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_ddos_protection_status_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("PublicIpDdosProtectionStatusResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_ddos_protection_status( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIpDdosProtectionStatusResult]: + """Gets the Ddos Protection Status of a Public IP Address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :return: An instance of AsyncLROPoller that returns either PublicIpDdosProtectionStatusResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIpDdosProtectionStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIpDdosProtectionStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._ddos_protection_status_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIpDdosProtectionStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIpDdosProtectionStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIpDdosProtectionStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_virtual_machine_scale_set_public_ip_addresses( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses on a virtual machine scale set level. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_virtual_machine_scale_set_public_ip_addresses_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_virtual_machine_scale_set_vm_public_ip_addresses( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses in a virtual machine IP configuration in a + virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The network interface name. Required. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. Required. + :type ip_configuration_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_virtual_machine_scale_set_vm_public_ip_addresses_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_virtual_machine_scale_set_public_ip_address( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PublicIPAddress: + """Get the specified public IP address in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. Required. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_virtual_machine_scale_set_public_ip_address_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VipSwapOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vip_swap` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, group_name: str, resource_name: str, **kwargs: Any) -> _models.SwapResource: + """Gets the SwapResource which identifies the slot type for the specified cloud service. The slot + type on a cloud service can either be Staging or Production. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :return: SwapResource or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SwapResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SwapResource] = kwargs.pop("cls", None) + + _request = build_vip_swap_get_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + singleton_resource=singleton_resource, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SwapResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( # pylint: disable=inconsistent-return-statements + self, group_name: str, resource_name: str, parameters: Union[_models.SwapResource, IO[bytes]], **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SwapResource") + + _request = build_vip_swap_create_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + singleton_resource=singleton_resource, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_create( + self, + group_name: str, + resource_name: str, + parameters: _models.SwapResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SwapResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, group_name: str, resource_name: str, parameters: Union[_models.SwapResource, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Is either a SwapResource type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SwapResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + group_name=group_name, + resource_name=resource_name, + parameters=parameters, + singleton_resource=singleton_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def list(self, group_name: str, resource_name: str, **kwargs: Any) -> _models.SwapResourceListResult: + """Gets the list of SwapResource which identifies the slot type for the specified cloud service. + The slot type on a cloud service can either be Staging or Production. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :return: SwapResourceListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SwapResourceListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SwapResourceListResult] = kwargs.pop("cls", None) + + _request = build_vip_swap_list_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SwapResourceListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class CustomIPPrefixesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`custom_ip_prefixes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, custom_ip_prefix_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_custom_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, custom_ip_prefix_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the CustomIpPrefix. Required. + :type custom_ip_prefix_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, custom_ip_prefix_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.CustomIpPrefix: + """Gets the specified custom IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + _request = build_custom_ip_prefixes_get_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.CustomIpPrefix, IO[bytes]], + **kwargs: Any + ) -> _models.CustomIpPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CustomIpPrefix") + + _request = build_custom_ip_prefixes_create_or_update_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: _models.CustomIpPrefix, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.CustomIpPrefix, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. Is + either a CustomIpPrefix type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CustomIpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CustomIpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_custom_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CustomIpPrefix"]: + """Gets all the custom IP prefixes in a subscription. + + :return: An iterator like instance of either CustomIpPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.CustomIpPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_custom_ip_prefixes_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomIpPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.CustomIpPrefix"]: + """Gets all custom IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either CustomIpPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.CustomIpPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_custom_ip_prefixes_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomIpPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DdosCustomPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`ddos_custom_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ddos_custom_policies_delete_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Gets information about the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + _request = build_ddos_custom_policies_get_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.DdosCustomPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DdosCustomPolicy") + + _request = build_ddos_custom_policies_create_or_update_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: _models.DdosCustomPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.DdosCustomPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Is either a + DdosCustomPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DdosCustomPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DdosCustomPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_custom_policies_update_tags_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DdosProtectionPlansOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`ddos_protection_plans` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ddos_protection_plans_delete_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Gets information about the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + _request = build_ddos_protection_plans_get_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.DdosProtectionPlan, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DdosProtectionPlan") + + _request = build_ddos_protection_plans_create_or_update_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: _models.DdosProtectionPlan, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.DdosProtectionPlan, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Is either a + DdosProtectionPlan type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DdosProtectionPlan].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DdosProtectionPlan]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_protection_plans_update_tags_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.DdosProtectionPlan"]: + """Gets all DDoS protection plans in a subscription. + + :return: An iterator like instance of either DdosProtectionPlan or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosProtectionPlanListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ddos_protection_plans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlanListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.DdosProtectionPlan"]: + """Gets all the DDoS protection plans in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either DdosProtectionPlan or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosProtectionPlanListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ddos_protection_plans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlanListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DscpConfigurationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`dscp_configuration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: Union[_models.DscpConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.DscpConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DscpConfiguration") + + _request = build_dscp_configuration_create_or_update_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: _models.DscpConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DscpConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: Union[_models.DscpConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. Is + either a DscpConfiguration type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DscpConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DscpConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DscpConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_dscp_configuration_delete_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> _models.DscpConfiguration: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :return: DscpConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DscpConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + + _request = build_dscp_configuration_get_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.DscpConfiguration"]: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either DscpConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DscpConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_dscp_configuration_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DscpConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.DscpConfiguration"]: + """Gets all dscp configurations in a subscription. + + :return: An iterator like instance of either DscpConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DscpConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_dscp_configuration_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DscpConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AvailableEndpointServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`available_endpoint_services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.EndpointServiceResult"]: + """List what values of endpoint services are available for use. + + :param location: The location to check available endpoint services. Required. + :type location: str + :return: An iterator like instance of either EndpointServiceResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.EndpointServiceResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.EndpointServicesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_endpoint_services_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("EndpointServicesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitAuthorizationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_circuit_authorizations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_authorizations_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitAuthorization: + """Gets the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_authorizations_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRouteCircuitAuthorization, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitAuthorization: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(authorization_parameters, (IOBase, bytes)): + _content = authorization_parameters + else: + _json = self._serialize.body(authorization_parameters, "ExpressRouteCircuitAuthorization") + + _request = build_express_route_circuit_authorizations_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: _models.ExpressRouteCircuitAuthorization, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Required. + :type authorization_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRouteCircuitAuthorization, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Is either a ExpressRouteCircuitAuthorization type or a + IO[bytes] type. Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitAuthorization].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitAuthorization]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitAuthorization"]: + """Gets all authorizations in an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitAuthorization or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AuthorizationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_authorizations_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AuthorizationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitPeeringsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_circuit_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_peerings_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitPeering: + """Gets the specified peering for the express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_peerings_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCircuitPeering, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(peering_parameters, (IOBase, bytes)): + _content = peering_parameters + else: + _json = self._serialize.body(peering_parameters, "ExpressRouteCircuitPeering") + + _request = build_express_route_circuit_peerings_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: _models.ExpressRouteCircuitPeering, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Required. + :type peering_parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Required. + :type peering_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCircuitPeering, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Is either a ExpressRouteCircuitPeering type or a IO[bytes] type. Required. + :type peering_parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitPeering"]: + """Gets all peerings in a specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitPeering or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_peerings_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_circuit_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_connections_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitConnection: + """Gets the specified Express Route Circuit Connection from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :return: ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_connections_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: Union[_models.ExpressRouteCircuitConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(express_route_circuit_connection_parameters, (IOBase, bytes)): + _content = express_route_circuit_connection_parameters + else: + _json = self._serialize.body(express_route_circuit_connection_parameters, "ExpressRouteCircuitConnection") + + _request = build_express_route_circuit_connections_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: _models.ExpressRouteCircuitConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Required. + :type express_route_circuit_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Required. + :type express_route_circuit_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: Union[_models.ExpressRouteCircuitConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Is either a ExpressRouteCircuitConnection type or a + IO[bytes] type. Required. + :type express_route_circuit_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + express_route_circuit_connection_parameters=express_route_circuit_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCircuitConnection"]: + """Gets all global reach connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An iterator like instance of either ExpressRouteCircuitConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_connections_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PeerExpressRouteCircuitConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`peer_express_route_circuit_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> _models.PeerExpressRouteCircuitConnection: + """Gets the specified Peer Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the peer express route circuit connection. Required. + :type connection_name: str + :return: PeerExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PeerExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + _request = build_peer_express_route_circuit_connections_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PeerExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnection"]: + """Gets all global reach peer connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An iterator like instance of either PeerExpressRouteCircuitConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PeerExpressRouteCircuitConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_peer_express_route_circuit_connections_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PeerExpressRouteCircuitConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_circuits` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> _models.ExpressRouteCircuit: + """Gets information about the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of express route circuit. Required. + :type circuit_name: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.ExpressRouteCircuit, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRouteCircuit") + + _request = build_express_route_circuits_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: _models.ExpressRouteCircuit, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.ExpressRouteCircuit, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Is either a ExpressRouteCircuit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_circuits_update_tags_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _list_arp_table_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsArpTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsArpTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_arp_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_arp_table( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]: + """Gets the currently advertised ARP table associated with the express route circuit in a resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_arp_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_routes_table_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_routes_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_routes_table( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]: + """Gets the currently advertised routes table associated with the express route circuit in a + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_routes_table_summary_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_routes_table_summary_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableSummaryListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_routes_table_summary( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]: + """Gets the currently advertised routes table summary associated with the express route circuit in + a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableSummaryListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableSummaryListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_stats( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitStats: + """Gets all the stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: ExpressRouteCircuitStats or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitStats + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitStats] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitStats", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_peering_stats( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitStats: + """Gets all stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCircuitStats or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitStats + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitStats] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_peering_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitStats", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteCircuit"]: + """Gets all the express route circuits in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRouteCircuit or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteCircuit"]: + """Gets all the express route circuits in a subscription. + + :return: An iterator like instance of either ExpressRouteCircuit or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteServiceProvidersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_service_providers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteServiceProvider"]: + """Gets all the available express route service providers. + + :return: An iterator like instance of either ExpressRouteServiceProvider or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteServiceProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteServiceProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_service_providers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteServiceProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteCrossConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_cross_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRouteCrossConnection"]: + """Retrieves all the ExpressRouteCrossConnections in a subscription. + + :return: An iterator like instance of either ExpressRouteCrossConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connections_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCrossConnection"]: + """Retrieves all the ExpressRouteCrossConnections in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRouteCrossConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connections_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, cross_connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Gets details about the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group (peering location of the circuit). + Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection (service key of the + circuit). Required. + :type cross_connection_name: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_get_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: Union[_models.ExpressRouteCrossConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRouteCrossConnection") + + _request = build_express_route_cross_connections_create_or_update_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: _models.ExpressRouteCrossConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: Union[_models.ExpressRouteCrossConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Is either a ExpressRouteCrossConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCrossConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Required. + :type cross_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Required. + :type cross_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type cross_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cross_connection_parameters, (IOBase, bytes)): + _content = cross_connection_parameters + else: + _json = self._serialize.body(cross_connection_parameters, "TagsObject") + + _request = build_express_route_cross_connections_update_tags_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _list_arp_table_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsArpTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsArpTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_list_arp_table_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_arp_table( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]: + """Gets the currently advertised ARP table associated with the express route cross connection in a + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_arp_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsArpTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_routes_table_summary_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]] = kwargs.pop( + "cls", None + ) + + _request = build_express_route_cross_connections_list_routes_table_summary_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize( + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_routes_table_summary( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]: + """Gets the route table summary associated with the express route cross connection in a resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", pipeline_response + ) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[ + _models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_routes_table_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_list_routes_table_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_routes_table( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]: + """Gets the currently advertised routes table associated with the express route cross connection + in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of AsyncLROPoller that returns either + ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_routes_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExpressRouteCrossConnectionPeeringsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_cross_connection_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, cross_connection_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeering"]: + """Gets all peerings in a specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :return: An iterator like instance of either ExpressRouteCrossConnectionPeering or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionPeeringList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connection_peerings_list_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionPeeringList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connection_peerings_delete_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCrossConnectionPeering: + """Gets the specified peering for the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connection_peerings_get_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCrossConnectionPeering, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnectionPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(peering_parameters, (IOBase, bytes)): + _content = peering_parameters + else: + _json = self._serialize.body(peering_parameters, "ExpressRouteCrossConnectionPeering") + + _request = build_express_route_cross_connection_peerings_create_or_update_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: _models.ExpressRouteCrossConnectionPeering, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Required. + :type peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Required. + :type peering_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCrossConnectionPeering, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Is either a ExpressRouteCrossConnectionPeering + type or a IO[bytes] type. Required. + :type peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteCrossConnectionPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExpressRoutePortsLocationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_ports_locations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRoutePortsLocation"]: + """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each + location. Available bandwidths can only be obtained when retrieving a specific peering + location. + + :return: An iterator like instance of either ExpressRoutePortsLocation or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortsLocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_locations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortsLocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, location_name: str, **kwargs: Any) -> _models.ExpressRoutePortsLocation: + """Retrieves a single ExpressRoutePort peering location, including the list of available + bandwidths available at said peering location. + + :param location_name: Name of the requested ExpressRoutePort peering location. Required. + :type location_name: str + :return: ExpressRoutePortsLocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortsLocation] = kwargs.pop("cls", None) + + _request = build_express_route_ports_locations_get_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePortsLocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRoutePortsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_ports` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_ports_delete_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> _models.ExpressRoutePort: + """Retrieves the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + _request = build_express_route_ports_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.ExpressRoutePort, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRoutePort") + + _request = build_express_route_ports_create_or_update_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: _models.ExpressRoutePort, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.ExpressRoutePort, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Is either a + ExpressRoutePort type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRoutePort].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRoutePort]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_ports_update_tags_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRoutePort"]: + """List all the ExpressRoutePort resources in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRoutePort or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ExpressRoutePort"]: + """List all the ExpressRoutePort resources in the specified subscription. + + :return: An iterator like instance of either ExpressRoutePort or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: _models.GenerateExpressRoutePortsLOARequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOARequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: Union[_models.GenerateExpressRoutePortsLOARequest, IO[bytes]], + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Is either a + GenerateExpressRoutePortsLOARequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOARequest or + IO[bytes] + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateExpressRoutePortsLOAResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "GenerateExpressRoutePortsLOARequest") + + _request = build_express_route_ports_generate_loa_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GenerateExpressRoutePortsLOAResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_port_name: str, link_name: str, **kwargs: Any + ) -> _models.ExpressRouteLink: + """Retrieves the specified ExpressRouteLink resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param link_name: The name of the ExpressRouteLink resource. Required. + :type link_name: str + :return: ExpressRouteLink or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteLink] = kwargs.pop("cls", None) + + _request = build_express_route_links_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + link_name=link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRouteLink"]: + """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :return: An iterator like instance of either ExpressRouteLink or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_links_list_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRoutePortAuthorizationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_port_authorizations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_port_authorizations_delete_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified authorization from the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> _models.ExpressRoutePortAuthorization: + """Gets the specified authorization from the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: ExpressRoutePortAuthorization or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + + _request = build_express_route_port_authorizations_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRoutePortAuthorization, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePortAuthorization: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(authorization_parameters, (IOBase, bytes)): + _content = authorization_parameters + else: + _json = self._serialize.body(authorization_parameters, "ExpressRoutePortAuthorization") + + _request = build_express_route_port_authorizations_create_or_update_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: _models.ExpressRoutePortAuthorization, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Required. + :type authorization_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRoutePortAuthorization, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Is either a ExpressRoutePortAuthorization type or a IO[bytes] type. + Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRoutePortAuthorization].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRoutePortAuthorization]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressRoutePortAuthorization"]: + """Gets all authorizations in an express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :return: An iterator like instance of either ExpressRoutePortAuthorization or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortAuthorizationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_port_authorizations_list_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortAuthorizationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteProviderPortsLocationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_provider_ports_location` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list(self, *, filter: Optional[str] = None, **kwargs: Any) -> _models.ExpressRouteProviderPortListResult: + """Retrieves all the ExpressRouteProviderPorts in a subscription. + + :keyword filter: The filter to apply on the operation. For example, you can use + $filter=location eq '{state}'. Default value is None. + :paramtype filter: str + :return: ExpressRouteProviderPortListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPortListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteProviderPortListResult] = kwargs.pop("cls", None) + + _request = build_express_route_provider_ports_location_list_request( + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteProviderPortListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`firewall_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policies_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.FirewallPolicy: + """Gets the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + _request = build_firewall_policies_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicy") + + _request = build_firewall_policies_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.FirewallPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. Is + either a FirewallPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FirewallPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FirewallPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_firewall_policies_update_tags_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.FirewallPolicy"]: + """Lists all Firewall Policies in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either FirewallPolicy or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policies_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FirewallPolicy"]: + """Gets all the Firewall Policies in a subscription. + + :return: An iterator like instance of either FirewallPolicy or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policies_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FirewallPolicyRuleCollectionGroupsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`firewall_policy_rule_collection_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_groups_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroup: + """Gets the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: FirewallPolicyRuleCollectionGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_groups_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroup, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicyRuleCollectionGroup") + + _request = build_firewall_policy_rule_collection_groups_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: _models.FirewallPolicyRuleCollectionGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleCollectionGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleCollectionGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Is either a FirewallPolicyRuleCollectionGroup type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleCollectionGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FirewallPolicyRuleCollectionGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FirewallPolicyRuleCollectionGroup"]: + """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An iterator like instance of either FirewallPolicyRuleCollectionGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policy_rule_collection_groups_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FirewallPolicyIdpsSignaturesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.IDPSQueryObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IDPSQueryObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.IDPSQueryObject, IO[bytes]], + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Is either a IDPSQueryObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IDPSQueryObject or IO[bytes] + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResults] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IDPSQueryObject") + + _request = build_firewall_policy_idps_signatures_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("QueryResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesOverridesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures_overrides` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.SignaturesOverrides, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignaturesOverrides, IO[bytes]], + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Is either a + SignaturesOverrides type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides or IO[bytes] + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignaturesOverrides") + + _request = build_firewall_policy_idps_signatures_overrides_patch_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.SignaturesOverrides, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignaturesOverrides, IO[bytes]], + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Is either a + SignaturesOverrides type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides or IO[bytes] + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignaturesOverrides") + + _request = build_firewall_policy_idps_signatures_overrides_put_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> _models.SignaturesOverrides: + """Returns all signatures overrides for a specific policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + _request = build_firewall_policy_idps_signatures_overrides_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> _models.SignaturesOverridesList: + """Returns all signatures overrides objects for a specific policy as a list containing a single + value. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: SignaturesOverridesList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverridesList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SignaturesOverridesList] = kwargs.pop("cls", None) + + _request = build_firewall_policy_idps_signatures_overrides_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverridesList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesFilterValuesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures_filter_values` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.SignatureOverridesFilterValuesQuery, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesQuery + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignatureOverridesFilterValuesQuery, IO[bytes]], + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Is either a SignatureOverridesFilterValuesQuery type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesQuery or + IO[bytes] + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignatureOverridesFilterValuesResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignatureOverridesFilterValuesQuery") + + _request = build_firewall_policy_idps_signatures_filter_values_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignatureOverridesFilterValuesResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class IpAllocationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`ip_allocations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ip_allocation_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ip_allocations_delete_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ip_allocation_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified IpAllocation. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, ip_allocation_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.IpAllocation: + """Gets the specified IpAllocation by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + _request = build_ip_allocations_get_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.IpAllocation, IO[bytes]], + **kwargs: Any + ) -> _models.IpAllocation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IpAllocation") + + _request = build_ip_allocations_create_or_update_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: _models.IpAllocation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.IpAllocation, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. Is + either a IpAllocation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpAllocation or IO[bytes] + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IpAllocation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpAllocation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpAllocation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ip_allocations_update_tags_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.IpAllocation"]: + """Gets all IpAllocations in a subscription. + + :return: An iterator like instance of either IpAllocation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpAllocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_allocations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpAllocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.IpAllocation"]: + """Gets all IpAllocations in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either IpAllocation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpAllocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_allocations_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpAllocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class IpGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`ip_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, ip_groups_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.IpGroup: + """Gets the specified ipGroups. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :keyword expand: Expands resourceIds (of Firewalls/Network Security Groups etc.) back + referenced by the IpGroups resource. Default value is None. + :paramtype expand: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + _request = build_ip_groups_get_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.IpGroup, IO[bytes]], + **kwargs: Any + ) -> _models.IpGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IpGroup") + + _request = build_ip_groups_create_or_update_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("IpGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: _models.IpGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.IpGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Is either a + IpGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IpGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ip_groups_update_groups_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ip_groups_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ip_groups_delete_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, ip_groups_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified ipGroups. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.IpGroup"]: + """Gets all IpGroups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either IpGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.IpGroup"]: + """Gets all IpGroups in a subscription. + + :return: An iterator like instance of either IpGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_groups_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IpGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_load_balancers_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_load_balancers_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LoadBalancer") + + _request = build_load_balancers_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: _models.LoadBalancer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. Is + either a LoadBalancer type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LoadBalancer", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LoadBalancer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LoadBalancer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_load_balancers_update_tags_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.LoadBalancer"]: + """Gets all the load balancers in a subscription. + + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.LoadBalancer"]: + """Gets all the load balancers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _swap_public_ip_addresses_initial( # pylint: disable=inconsistent-return-statements + self, location: str, parameters: Union[_models.LoadBalancerVipSwapRequest, IO[bytes]], **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LoadBalancerVipSwapRequest") + + _request = build_load_balancers_swap_public_ip_addresses_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_swap_public_ip_addresses( + self, + location: str, + parameters: _models.LoadBalancerVipSwapRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancerVipSwapRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_swap_public_ip_addresses( + self, location: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_swap_public_ip_addresses( + self, location: str, parameters: Union[_models.LoadBalancerVipSwapRequest, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Is either a + LoadBalancerVipSwapRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancerVipSwapRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._swap_public_ip_addresses_initial( # type: ignore + location=location, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _list_inbound_nat_rule_port_mappings_initial( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: Union[_models.QueryInboundNatRulePortMappingRequest, IO[bytes]], + **kwargs: Any + ) -> _models.BackendAddressInboundNatRulePortMappings: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressInboundNatRulePortMappings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryInboundNatRulePortMappingRequest") + + _request = build_load_balancers_list_inbound_nat_rule_port_mappings_request( + group_name=group_name, + load_balancer_name=load_balancer_name, + backend_pool_name=backend_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: _models.QueryInboundNatRulePortMappingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryInboundNatRulePortMappingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + BackendAddressInboundNatRulePortMappings or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + BackendAddressInboundNatRulePortMappings or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: Union[_models.QueryInboundNatRulePortMappingRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Is either a + QueryInboundNatRulePortMappingRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryInboundNatRulePortMappingRequest + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + BackendAddressInboundNatRulePortMappings or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressInboundNatRulePortMappings] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_inbound_nat_rule_port_mappings_initial( + group_name=group_name, + load_balancer_name=load_balancer_name, + backend_pool_name=backend_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BackendAddressInboundNatRulePortMappings]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[_models.MigrateLoadBalancerToIpBasedRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.MigrateLoadBalancerToIpBasedRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[Union[_models.MigrateLoadBalancerToIpBasedRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Is either a + MigrateLoadBalancerToIpBasedRequest type or a IO[bytes] type. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.MigrateLoadBalancerToIpBasedRequest or + IO[bytes] + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MigratedPools] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "MigrateLoadBalancerToIpBasedRequest") + else: + _json = None + + _request = build_load_balancers_migrate_to_ip_based_request( + group_name=group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MigratedPools", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LoadBalancerBackendAddressPoolsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancer_backend_address_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BackendAddressPool"]: + """Gets all the load balancer backed address pools. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either BackendAddressPool or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerBackendAddressPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_backend_address_pools_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerBackendAddressPoolListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> _models.BackendAddressPool: + """Gets load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :return: BackendAddressPool or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BackendAddressPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + + _request = build_load_balancer_backend_address_pools_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: Union[_models.BackendAddressPool, IO[bytes]], + **kwargs: Any + ) -> _models.BackendAddressPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BackendAddressPool") + + _request = build_load_balancer_backend_address_pools_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: _models.BackendAddressPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BackendAddressPool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: Union[_models.BackendAddressPool, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Is either a BackendAddressPool type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BackendAddressPool or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BackendAddressPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BackendAddressPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_load_balancer_backend_address_pools_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class LoadBalancerFrontendIPConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancer_frontend_ip_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FrontendIPConfiguration"]: + """Gets all the load balancer frontend IP configurations. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either FrontendIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerFrontendIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_frontend_ip_configurations_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerFrontendIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs: Any + ) -> _models.FrontendIPConfiguration: + """Gets load balancer frontend IP configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param frontend_ip_configuration_name: The name of the frontend IP configuration. Required. + :type frontend_ip_configuration_name: str + :return: FrontendIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FrontendIPConfiguration] = kwargs.pop("cls", None) + + _request = build_load_balancer_frontend_ip_configurations_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + frontend_ip_configuration_name=frontend_ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FrontendIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InboundNatRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`inbound_nat_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.InboundNatRule"]: + """Gets all the inbound NAT rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either InboundNatRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.InboundNatRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_inbound_nat_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("InboundNatRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_inbound_nat_rules_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.InboundNatRule: + """Gets the specified load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: InboundNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.InboundNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + + _request = build_inbound_nat_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: Union[_models.InboundNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.InboundNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(inbound_nat_rule_parameters, (IOBase, bytes)): + _content = inbound_nat_rule_parameters + else: + _json = self._serialize.body(inbound_nat_rule_parameters, "InboundNatRule") + + _request = build_inbound_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: _models.InboundNatRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Required. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.InboundNatRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Required. + :type inbound_nat_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: Union[_models.InboundNatRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Is either a InboundNatRule type or a IO[bytes] type. Required. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.InboundNatRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + inbound_nat_rule_parameters=inbound_nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InboundNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InboundNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InboundNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class LoadBalancerLoadBalancingRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancer_load_balancing_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.LoadBalancingRule"]: + """Gets all the load balancing rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either LoadBalancingRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerLoadBalancingRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_load_balancing_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerLoadBalancingRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, load_balancing_rule_name: str, **kwargs: Any + ) -> _models.LoadBalancingRule: + """Gets the specified load balancer load balancing rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param load_balancing_rule_name: The name of the load balancing rule. Required. + :type load_balancing_rule_name: str + :return: LoadBalancingRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancingRule] = kwargs.pop("cls", None) + + _request = build_load_balancer_load_balancing_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + load_balancing_rule_name=load_balancing_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancingRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LoadBalancerOutboundRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancer_outbound_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OutboundRule"]: + """Gets all the outbound rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either OutboundRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.OutboundRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerOutboundRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_outbound_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerOutboundRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, outbound_rule_name: str, **kwargs: Any + ) -> _models.OutboundRule: + """Gets the specified load balancer outbound rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param outbound_rule_name: The name of the outbound rule. Required. + :type outbound_rule_name: str + :return: OutboundRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.OutboundRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.OutboundRule] = kwargs.pop("cls", None) + + _request = build_load_balancer_outbound_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + outbound_rule_name=outbound_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OutboundRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LoadBalancerNetworkInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancer_network_interfaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterface"]: + """Gets associated load balancer network interfaces. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_network_interfaces_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancerProbesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`load_balancer_probes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, load_balancer_name: str, **kwargs: Any) -> AsyncIterable["_models.Probe"]: + """Gets all the load balancer probes. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either Probe or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.Probe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerProbeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_probes_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerProbeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, load_balancer_name: str, probe_name: str, **kwargs: Any + ) -> _models.Probe: + """Gets load balancer probe. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param probe_name: The name of the probe. Required. + :type probe_name: str + :return: Probe or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Probe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.Probe] = kwargs.pop("cls", None) + + _request = build_load_balancer_probes_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + probe_name=probe_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Probe", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NatGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`nat_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, nat_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nat_gateways_delete_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, nat_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, nat_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NatGateway: + """Gets the specified nat gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + + _request = build_nat_gateways_get_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.NatGateway, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.NatGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NatGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NatGateway") + + _request = build_nat_gateways_create_or_update_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("NatGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: _models.NatGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.NatGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Is either + a NatGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NatGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NatGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NatGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NatGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_nat_gateways_update_tags_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NatGateway"]: + """Gets all the Nat Gateways in a subscription. + + :return: An iterator like instance of either NatGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NatGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_gateways_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NatGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NatGateway"]: + """Gets all nat gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NatGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NatGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NatGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkInterfaceIPConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_interface_ip_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterfaceIPConfiguration"]: + """Get all ip configurations in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either NetworkInterfaceIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_ip_configurations_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_interface_name: str, ip_configuration_name: str, **kwargs: Any + ) -> _models.NetworkInterfaceIPConfiguration: + """Gets the specified network interface ip configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration name. Required. + :type ip_configuration_name: str + :return: NetworkInterfaceIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceIPConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interface_ip_configurations_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkInterfaceLoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_interface_load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterable["_models.LoadBalancer"]: + """List all load balancers in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceLoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_load_balancers_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceLoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkInterfaceTapConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_interface_tap_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_interface_tap_configurations_delete_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified tap configuration from the NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> _models.NetworkInterfaceTapConfiguration: + """Get the specified tap configuration on a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :return: NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interface_tap_configurations_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: Union[_models.NetworkInterfaceTapConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterfaceTapConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_configuration_parameters, (IOBase, bytes)): + _content = tap_configuration_parameters + else: + _json = self._serialize.body(tap_configuration_parameters, "NetworkInterfaceTapConfiguration") + + _request = build_network_interface_tap_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: _models.NetworkInterfaceTapConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Required. + :type tap_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Required. + :type tap_configuration_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: Union[_models.NetworkInterfaceTapConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Is either a NetworkInterfaceTapConfiguration type or a IO[bytes] type. + Required. + :type tap_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + tap_configuration_parameters=tap_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkInterfaceTapConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterfaceTapConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkInterfaceTapConfiguration"]: + """Get all Tap configurations in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either NetworkInterfaceTapConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceTapConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_tap_configurations_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceTapConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkManagersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_managers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, network_manager_name: str, **kwargs: Any) -> _models.NetworkManager: + """Gets the specified Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + _request = build_network_managers_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.NetworkManager, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManager, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Is either a + NetworkManager type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManager or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManager") + + _request = build_network_managers_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_managers_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_manager_name: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.PatchObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PatchObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.PatchObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Is either a + PatchObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PatchObject or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PatchObject") + + _request = build_network_managers_patch_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManager"]: + """List all network managers in a subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManager or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_managers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManager"]: + """List network managers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManager or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_managers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkManagerCommitsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_manager_commits` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _post_initial( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerCommit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerCommit") + + _request = build_network_manager_commits_post_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.NetworkManagerCommit, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkManagerCommit or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkManagerCommit or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Is either a + NetworkManagerCommit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkManagerCommit or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._post_initial( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkManagerCommit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkManagerCommit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkManagerDeploymentStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_manager_deployment_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.NetworkManagerDeploymentStatusParameter, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusParameter + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerDeploymentStatusParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Is either a NetworkManagerDeploymentStatusParameter type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusParameter or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerDeploymentStatusListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerDeploymentStatusParameter") + + _request = build_network_manager_deployment_status_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerDeploymentStatusListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SubscriptionNetworkManagerConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`subscription_network_manager_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def create_or_update( + self, + network_manager_connection_name: str, + parameters: _models.NetworkManagerConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + network_manager_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + network_manager_connection_name: str, + parameters: Union[_models.NetworkManagerConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Is either a + NetworkManagerConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection or IO[bytes] + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerConnection") + + _request = build_subscription_network_manager_connections_create_or_update_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, network_manager_connection_name: str, **kwargs: Any) -> _models.NetworkManagerConnection: + """Get a specified connection created by this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + _request = build_subscription_network_manager_connections_get_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, network_manager_connection_name: str, **kwargs: Any + ) -> None: + """Delete specified connection created by this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_subscription_network_manager_connections_delete_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManagerConnection"]: + """List all network manager connections created by this subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManagerConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subscription_network_manager_connections_list_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagementGroupNetworkManagerConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`management_group_network_manager_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: _models.NetworkManagerConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: Union[_models.NetworkManagerConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Is either a + NetworkManagerConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection or IO[bytes] + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerConnection") + + _request = build_management_group_network_manager_connections_create_or_update_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, management_group_id: str, network_manager_connection_name: str, **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Get a specified connection created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + _request = build_management_group_network_manager_connections_get_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, management_group_id: str, network_manager_connection_name: str, **kwargs: Any + ) -> None: + """Delete specified pending connection created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_management_group_network_manager_connections_delete_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, management_group_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.NetworkManagerConnection"]: + """List all network manager connections created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManagerConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_management_group_network_manager_connections_list_request( + management_group_id=management_group_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ConnectivityConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`connectivity_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Gets a Network Connectivity Configuration, specified by the resource group, network manager + name, and connectivity Configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectivityConfiguration] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: _models.ConnectivityConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Required. + :type connectivity_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Required. + :type connectivity_configuration: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: Union[_models.ConnectivityConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Is either a ConnectivityConfiguration type or a IO[bytes] type. + Required. + :type connectivity_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration or IO[bytes] + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(connectivity_configuration, (IOBase, bytes)): + _content = connectivity_configuration + else: + _json = self._serialize.body(connectivity_configuration, "ConnectivityConfiguration") + + _request = build_connectivity_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network manager connectivity configuration, specified by the resource group, network + manager name, and connectivity configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ConnectivityConfiguration"]: + """Lists all the network manager connectivity configuration in a specified network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either ConnectivityConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connectivity_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectivityConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, network_group_name: str, **kwargs: Any + ) -> _models.NetworkGroup: + """Gets the specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkGroup] = kwargs.pop("cls", None) + + _request = build_network_groups_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: _models.NetworkGroup, + *, + if_match: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: IO[bytes], + *, + if_match: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. + Required. + :type parameters: IO[bytes] + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: Union[_models.NetworkGroup, IO[bytes]], + *, + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. Is + either a NetworkGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup or IO[bytes] + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkGroup") + + _request = build_network_groups_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if response.status_code == 201: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_groups_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkGroup"]: + """Lists the specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkGroup or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_groups_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class StaticMembersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`static_members` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + **kwargs: Any + ) -> _models.StaticMember: + """Gets the specified static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.StaticMember] = kwargs.pop("cls", None) + + _request = build_static_members_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("StaticMember", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: _models.StaticMember, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: Union[_models.StaticMember, IO[bytes]], + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Is either a + StaticMember type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.StaticMember or IO[bytes] + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StaticMember] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "StaticMember") + + _request = build_static_members_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("StaticMember", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("StaticMember", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + **kwargs: Any + ) -> None: + """Deletes a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_static_members_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.StaticMember"]: + """Lists the specified static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either StaticMember or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.StaticMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.StaticMemberListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_static_members_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("StaticMemberListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ScopeConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`scope_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: _models.ScopeConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: Union[_models.ScopeConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Is either a ScopeConnection type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection or IO[bytes] + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScopeConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ScopeConnection") + + _request = build_scope_connections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, scope_connection_name: str, **kwargs: Any + ) -> _models.ScopeConnection: + """Get specified scope connection created by this Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ScopeConnection] = kwargs.pop("cls", None) + + _request = build_scope_connections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, scope_connection_name: str, **kwargs: Any + ) -> None: + """Delete the pending scope connection created by this network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_scope_connections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ScopeConnection"]: + """List all scope connections created by this network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either ScopeConnection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ScopeConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ScopeConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_scope_connections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ScopeConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityAdminConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`security_admin_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SecurityAdminConfiguration"]: + """Lists all the network manager security admin configurations in a network manager, in a + paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either SecurityAdminConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityAdminConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_admin_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityAdminConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Retrieves a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityAdminConfiguration] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: _models.SecurityAdminConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. + Required. + :type security_admin_configuration: + ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. + Required. + :type security_admin_configuration: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: Union[_models.SecurityAdminConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. Is + either a SecurityAdminConfiguration type or a IO[bytes] type. Required. + :type security_admin_configuration: + ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration or IO[bytes] + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAdminConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_admin_configuration, (IOBase, bytes)): + _content = security_admin_configuration + else: + _json = self._serialize.body(security_admin_configuration, "SecurityAdminConfiguration") + + _request = build_security_admin_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AdminRuleCollectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`admin_rule_collections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.AdminRuleCollection"]: + """Lists all the rule collections in a security admin configuration, in a paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either AdminRuleCollection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AdminRuleCollectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_admin_rule_collections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AdminRuleCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Gets a network manager security admin configuration rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AdminRuleCollection] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: _models.AdminRuleCollection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Required. + :type rule_collection: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Required. + :type rule_collection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: Union[_models.AdminRuleCollection, IO[bytes]], + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Is either a + AdminRuleCollection type or a IO[bytes] type. Required. + :type rule_collection: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection or IO[bytes] + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdminRuleCollection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(rule_collection, (IOBase, bytes)): + _content = rule_collection + else: + _json = self._serialize.body(rule_collection, "AdminRuleCollection") + + _request = build_admin_rule_collections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AdminRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`admin_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.BaseAdminRule"]: + """List all network manager security configuration admin rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either BaseAdminRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BaseAdminRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AdminRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_admin_rules_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AdminRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + **kwargs: Any + ) -> _models.BaseAdminRule: + """Gets a network manager security configuration admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BaseAdminRule] = kwargs.pop("cls", None) + + _request = build_admin_rules_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: _models.BaseAdminRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Required. + :type admin_rule: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Required. + :type admin_rule: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: Union[_models.BaseAdminRule, IO[bytes]], + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Is either a BaseAdminRule type or a + IO[bytes] type. Required. + :type admin_rule: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule or IO[bytes] + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BaseAdminRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(admin_rule, (IOBase, bytes)): + _content = admin_rule + else: + _json = self._serialize.body(admin_rule, "BaseAdminRule") + + _request = build_admin_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rules_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NetworkProfilesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_profiles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_profile_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_profiles_delete_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_profile_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the NetworkProfile. Required. + :type network_profile_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_profile_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkProfile: + """Gets the specified network profile in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the public IP prefix. Required. + :type network_profile_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + _request = build_network_profiles_get_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: _models.NetworkProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: Union[_models.NetworkProfile, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. Is + either a NetworkProfile type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile or IO[bytes] + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkProfile") + + _request = build_network_profiles_create_or_update_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_profiles_update_tags_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkProfile"]: + """Gets all the network profiles in a subscription. + + :return: An iterator like instance of either NetworkProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_profiles_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkProfile"]: + """Gets all network profiles in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_profiles_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkSecurityGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_security_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_security_groups_delete_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Gets the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + _request = build_network_security_groups_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.NetworkSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkSecurityGroup") + + _request = build_network_security_groups_create_or_update_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: _models.NetworkSecurityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.NetworkSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Is either a NetworkSecurityGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_security_groups_update_tags_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkSecurityGroup"]: + """Gets all network security groups in a subscription. + + :return: An iterator like instance of either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_groups_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkSecurityGroup"]: + """Gets all network security groups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_groups_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`security_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_rules_delete_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> _models.SecurityRule: + """Get the specified network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :return: SecurityRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + _request = build_security_rules_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: Union[_models.SecurityRule, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_rule_parameters, (IOBase, bytes)): + _content = security_rule_parameters + else: + _json = self._serialize.body(security_rule_parameters, "SecurityRule") + + _request = build_security_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: _models.SecurityRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Required. + :type security_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Required. + :type security_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: Union[_models.SecurityRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Is either a SecurityRule type or a IO[bytes] type. Required. + :type security_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + security_rule_parameters=security_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityRule"]: + """Gets all security rules in a network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An iterator like instance of either SecurityRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_rules_list_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DefaultSecurityRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`default_security_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityRule"]: + """Gets all default security rules in a network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An iterator like instance of either SecurityRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_default_security_rules_list_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_security_group_name: str, default_security_rule_name: str, **kwargs: Any + ) -> _models.SecurityRule: + """Get the specified default network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param default_security_rule_name: The name of the default security rule. Required. + :type default_security_rule_name: str + :return: SecurityRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + _request = build_default_security_rules_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + default_security_rule_name=default_security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkVirtualAppliancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_virtual_appliances` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliances_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Gets the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliances_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_virtual_appliances_update_tags_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.NetworkVirtualAppliance, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkVirtualAppliance") + + _request = build_network_virtual_appliances_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: _models.NetworkVirtualAppliance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.NetworkVirtualAppliance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. Is + either a NetworkVirtualAppliance type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkVirtualAppliance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkVirtualAppliance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkVirtualAppliance"]: + """Lists all Network Virtual Appliances in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliances_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.NetworkVirtualAppliance"]: + """Gets all Network Virtual Appliances in a subscription. + + :return: An iterator like instance of either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliances_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualApplianceSitesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_appliance_sites` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_sites_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified site from a Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> _models.VirtualApplianceSite: + """Gets the specified Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :return: VirtualApplianceSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_sites_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: Union[_models.VirtualApplianceSite, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualApplianceSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualApplianceSite") + + _request = build_virtual_appliance_sites_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: _models.VirtualApplianceSite, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualApplianceSite or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualApplianceSite or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: Union[_models.VirtualApplianceSite, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Is either a VirtualApplianceSite type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualApplianceSite or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualApplianceSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualApplianceSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualApplianceSite"]: + """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An iterator like instance of either VirtualApplianceSite or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceSiteListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_appliance_sites_list_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceSiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualApplianceSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_appliance_skus` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.NetworkVirtualApplianceSku"]: + """List all SKUs available for a virtual appliance. + + :return: An iterator like instance of either NetworkVirtualApplianceSku or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceSkuListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_appliance_skus_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceSkuListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, sku_name: str, **kwargs: Any) -> _models.NetworkVirtualApplianceSku: + """Retrieves a single available sku for network virtual appliance. + + :param sku_name: Name of the Sku. Required. + :type sku_name: str + :return: NetworkVirtualApplianceSku or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceSku] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_skus_get_request( + sku_name=sku_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualApplianceSku", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InboundSecurityRuleOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`inbound_security_rule` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: Union[_models.InboundSecurityRule, IO[bytes]], + **kwargs: Any + ) -> _models.InboundSecurityRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundSecurityRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "InboundSecurityRule") + + _request = build_inbound_security_rule_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: _models.InboundSecurityRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: Union[_models.InboundSecurityRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Is either a InboundSecurityRule type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule or IO[bytes] + :return: An instance of AsyncLROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundSecurityRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InboundSecurityRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InboundSecurityRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkWatchersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_watchers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.NetworkWatcher, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkWatcher, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Is either a + NetworkWatcher type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher or IO[bytes] + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkWatcher") + + _request = build_network_watchers_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, network_watcher_name: str, **kwargs: Any) -> _models.NetworkWatcher: + """Gets the specified network watcher by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + _request = build_network_watchers_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_watchers_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network watcher resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_watchers_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkWatcher"]: + """Gets all network watchers by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkWatcher or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkWatcher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkWatcherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_watchers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkWatcherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkWatcher"]: + """Gets all network watchers by subscription. + + :return: An iterator like instance of either NetworkWatcher or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkWatcher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkWatcherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_watchers_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkWatcherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.TopologyParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TopologyParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TopologyParameters, IO[bytes]], + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Is either a + TopologyParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TopologyParameters or IO[bytes] + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Topology] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TopologyParameters") + + _request = build_network_watchers_get_topology_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Topology", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _verify_ip_flow_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.VerificationIPFlowParameters, IO[bytes]], + **kwargs: Any + ) -> _models.VerificationIPFlowResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VerificationIPFlowResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VerificationIPFlowParameters") + + _request = build_network_watchers_verify_ip_flow_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.VerificationIPFlowParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.VerificationIPFlowParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Is either a + VerificationIPFlowParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VerificationIPFlowResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._verify_ip_flow_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VerificationIPFlowResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VerificationIPFlowResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_next_hop_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NextHopParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NextHopResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NextHopResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NextHopParameters") + + _request = build_network_watchers_get_next_hop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NextHopResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("NextHopResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.NextHopParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NextHopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NextHopParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Is either a + NextHopParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NextHopParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NextHopResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_next_hop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NextHopResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NextHopResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NextHopResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_vm_security_rules_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.SecurityGroupViewParameters, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityGroupViewResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityGroupViewResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SecurityGroupViewParameters") + + _request = build_network_watchers_get_vm_security_rules_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.SecurityGroupViewParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.SecurityGroupViewParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Is either a + SecurityGroupViewParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityGroupViewResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vm_security_rules_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityGroupViewResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityGroupViewResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_troubleshooting_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> _models.TroubleshootingResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TroubleshootingParameters") + + _request = build_network_watchers_get_troubleshooting_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.TroubleshootingParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TroubleshootingParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Is either a + TroubleshootingParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TroubleshootingParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_troubleshooting_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TroubleshootingResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TroubleshootingResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_troubleshooting_result_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.QueryTroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> _models.TroubleshootingResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryTroubleshootingParameters") + + _request = build_network_watchers_get_troubleshooting_result_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.QueryTroubleshootingParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryTroubleshootingParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.QueryTroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. Is + either a QueryTroubleshootingParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryTroubleshootingParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_troubleshooting_result_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TroubleshootingResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TroubleshootingResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_flow_log_configuration_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogInformation, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLogInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLogInformation") + + _request = build_network_watchers_set_flow_log_configuration_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.FlowLogInformation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogInformation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogInformation, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Is either a + FlowLogInformation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogInformation or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_flow_log_configuration_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowLogInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowLogInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_flow_log_status_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogStatusParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLogInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLogStatusParameters") + + _request = build_network_watchers_get_flow_log_status_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.FlowLogStatusParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogStatusParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogStatusParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Is either a FlowLogStatusParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogStatusParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_flow_log_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowLogInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowLogInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _check_connectivity_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.ConnectivityParameters, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectivityInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectivityParameters") + + _request = build_network_watchers_check_connectivity_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.ConnectivityParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectivityParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.ConnectivityParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. Is + either a ConnectivityParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectivityParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._check_connectivity_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectivityInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectivityInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_azure_reachability_report_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AzureReachabilityReportParameters, IO[bytes]], + **kwargs: Any + ) -> _models.AzureReachabilityReport: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureReachabilityReport] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AzureReachabilityReportParameters") + + _request = build_network_watchers_get_azure_reachability_report_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.AzureReachabilityReportParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AzureReachabilityReportParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Is either + a AzureReachabilityReportParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureReachabilityReport] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_azure_reachability_report_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AzureReachabilityReport].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AzureReachabilityReport]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_available_providers_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AvailableProvidersListParameters, IO[bytes]], + **kwargs: Any + ) -> _models.AvailableProvidersList: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AvailableProvidersList] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AvailableProvidersListParameters") + + _request = build_network_watchers_list_available_providers_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.AvailableProvidersListParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AvailableProvidersListParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Is either a + AvailableProvidersListParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AvailableProvidersList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_available_providers_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AvailableProvidersList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AvailableProvidersList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_network_configuration_diagnostic_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkConfigurationDiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkConfigurationDiagnosticResponse: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConfigurationDiagnosticResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkConfigurationDiagnosticParameters") + + _request = build_network_watchers_get_network_configuration_diagnostic_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.NetworkConfigurationDiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkConfigurationDiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Is either a + NetworkConfigurationDiagnosticParameters type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConfigurationDiagnosticResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_network_configuration_diagnostic_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkConfigurationDiagnosticResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class PacketCapturesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`packet_captures` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: Union[_models.PacketCapture, IO[bytes]], + **kwargs: Any + ) -> _models.PacketCaptureResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PacketCapture") + + _request = build_packet_captures_create_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: _models.PacketCapture, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PacketCapture + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: Union[_models.PacketCapture, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Is either a + PacketCapture type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PacketCapture or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PacketCaptureResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PacketCaptureResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> _models.PacketCaptureResult: + """Gets a packet capture session by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: PacketCaptureResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + + _request = build_packet_captures_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_packet_captures_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_packet_captures_stop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops a specified packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _get_status_initial( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> _models.PacketCaptureQueryStatusResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureQueryStatusResult] = kwargs.pop("cls", None) + + _request = build_packet_captures_get_status_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_status( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.PacketCaptureQueryStatusResult]: + """Query the status of a running packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param packet_capture_name: The name given to the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureQueryStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureQueryStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PacketCaptureQueryStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PacketCaptureQueryStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PacketCaptureResult"]: + """Lists all packet capture sessions within the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either PacketCaptureResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_packet_captures_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PacketCaptureListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ConnectionMonitorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`connection_monitors` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.ConnectionMonitor, IO[bytes]], + *, + migrate: Optional[str] = None, + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionMonitor") + + _request = build_connection_monitors_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + migrate=migrate, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: _models.ConnectionMonitor, + *, + migrate: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitor + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: IO[bytes], + *, + migrate: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. + Required. + :type parameters: IO[bytes] + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.ConnectionMonitor, IO[bytes]], + *, + migrate: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. Is + either a ConnectionMonitor type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitor or IO[bytes] + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + parameters=parameters, + migrate=migrate, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionMonitorResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionMonitorResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Gets a connection monitor by name. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + _request = build_connection_monitors_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_connection_monitors_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_stop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_start_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _query_initial( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> _models.ConnectionMonitorQueryResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorQueryResult] = kwargs.pop("cls", None) + + _request = build_connection_monitors_query_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_query( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionMonitorQueryResult]: + """Query a snapshot of the most recent connection states. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name given to the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorQueryResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorQueryResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._query_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionMonitorQueryResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionMonitorQueryResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConnectionMonitorResult"]: + """Lists all connection monitors for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either ConnectionMonitorResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connection_monitors_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FlowLogsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`flow_logs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.FlowLog, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLog: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLog") + + _request = build_flow_logs_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLog", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: _models.FlowLog, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.FlowLog, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Is either a + FlowLog type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLog or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLog", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FlowLog].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FlowLog]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Is either a TagsObject type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_flow_logs_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> _models.FlowLog: + """Gets a flow log resource by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. Required. + :type flow_log_name: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + _request = build_flow_logs_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_flow_logs_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified flow log resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. Required. + :type flow_log_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FlowLog"]: + """Lists all flow log resources for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either FlowLog or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FlowLogListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flow_logs_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FlowLogListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + """Lists all of the available Network Rest API operations. + + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateEndpointsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`private_endpoints` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_endpoint_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_endpoints_delete_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, private_endpoint_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_endpoint_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PrivateEndpoint: + """Gets the specified private endpoint by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateEndpoint or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + + _request = build_private_endpoints_get_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: Union[_models.PrivateEndpoint, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpoint: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateEndpoint") + + _request = build_private_endpoints_create_or_update_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: _models.PrivateEndpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: Union[_models.PrivateEndpoint, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. Is + either a PrivateEndpoint type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PrivateEndpoint"]: + """Gets all private endpoints in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateEndpoint or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoints_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateEndpoint"]: + """Gets all private endpoints in a subscription. + + :return: An iterator like instance of either PrivateEndpoint or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoints_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AvailablePrivateEndpointTypesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`available_private_endpoint_types` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailablePrivateEndpointType"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. Required. + :type location: str + :return: An iterator like instance of either AvailablePrivateEndpointType or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailablePrivateEndpointType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailablePrivateEndpointTypesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_private_endpoint_types_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailablePrivateEndpointTypesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, location: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AvailablePrivateEndpointType"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AvailablePrivateEndpointType or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailablePrivateEndpointType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailablePrivateEndpointTypesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_private_endpoint_types_list_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailablePrivateEndpointTypesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateDnsZoneGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`private_dns_zone_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_dns_zone_groups_delete_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private dns zone group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> _models.PrivateDnsZoneGroup: + """Gets the private dns zone group resource by specified private dns zone group name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :return: PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + + _request = build_private_dns_zone_groups_get_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: Union[_models.PrivateDnsZoneGroup, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateDnsZoneGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateDnsZoneGroup") + + _request = build_private_dns_zone_groups_create_or_update_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: _models.PrivateDnsZoneGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: Union[_models.PrivateDnsZoneGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Is either a PrivateDnsZoneGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateDnsZoneGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateDnsZoneGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, private_endpoint_name: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PrivateDnsZoneGroup"]: + """Gets all private dns zone groups in a private endpoint. + + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateDnsZoneGroup or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateDnsZoneGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_dns_zone_groups_list_request( + private_endpoint_name=private_endpoint_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateDnsZoneGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateLinkServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`private_link_services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_link_services_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified private link service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PrivateLinkService: + """Gets the specified private link service by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateLinkService or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + + _request = build_private_link_services_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + parameters: Union[_models.PrivateLinkService, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkService: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateLinkService") + + _request = build_private_link_services_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: _models.PrivateLinkService, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: Union[_models.PrivateLinkService, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Is either a PrivateLinkService type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateLinkService].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateLinkService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PrivateLinkService"]: + """Gets all private link services in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateLinkService or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateLinkServiceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateLinkService"]: + """Gets all private link service in a subscription. + + :return: An iterator like instance of either PrivateLinkService or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateLinkServiceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get the specific private end point connection by specific private link service in the resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_link_services_get_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateEndpointConnection") + + _request = build_private_link_services_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_private_endpoint_connection_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, service_name: str, pe_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_link_services_delete_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete_private_endpoint_connection( + self, resource_group_name: str, service_name: str, pe_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_private_endpoint_connections( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnection"]: + """Gets all private end point connections for a specific private link service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :return: An iterator like instance of either PrivateEndpointConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_private_endpoint_connections_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _check_private_link_service_visibility_initial( # pylint: disable=name-too-long + self, + location: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.PrivateLinkServiceVisibility]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateLinkServiceVisibility]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CheckPrivateLinkServiceVisibilityRequest") + + _request = build_private_link_services_check_private_link_service_visibility_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, + location: str, + parameters: _models.CheckPrivateLinkServiceVisibilityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, location: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, + location: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Is either a + CheckPrivateLinkServiceVisibilityRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkServiceVisibility] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._check_private_link_service_visibility_initial( + location=location, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateLinkServiceVisibility].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateLinkServiceVisibility]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _check_private_link_service_visibility_by_resource_group_initial( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.PrivateLinkServiceVisibility]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateLinkServiceVisibility]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CheckPrivateLinkServiceVisibilityRequest") + + _request = build_private_link_services_check_private_link_service_visibility_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: _models.CheckPrivateLinkServiceVisibilityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Is either a + CheckPrivateLinkServiceVisibilityRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkServiceVisibility] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._check_private_link_service_visibility_by_resource_group_initial( + location=location, + resource_group_name=resource_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateLinkServiceVisibility].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateLinkServiceVisibility]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_auto_approved_private_link_services( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkService"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. Required. + :type location: str + :return: An iterator like instance of either AutoApprovedPrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AutoApprovedPrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AutoApprovedPrivateLinkServicesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_auto_approved_private_link_services_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AutoApprovedPrivateLinkServicesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_auto_approved_private_link_services_by_resource_group( # pylint: disable=name-too-long + self, location: str, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkService"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AutoApprovedPrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.AutoApprovedPrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AutoApprovedPrivateLinkServicesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_private_link_services_list_auto_approved_private_link_services_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AutoApprovedPrivateLinkServicesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PublicIPPrefixesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`public_ip_prefixes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_prefix_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_public_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, public_ip_prefix_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIpPrefix. Required. + :type public_ip_prefix_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, public_ip_prefix_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PublicIPPrefix: + """Gets the specified public IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + _request = build_public_ip_prefixes_get_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.PublicIPPrefix, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PublicIPPrefix") + + _request = build_public_ip_prefixes_create_or_update_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: _models.PublicIPPrefix, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.PublicIPPrefix, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. Is + either a PublicIPPrefix type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PublicIPPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PublicIPPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.PublicIPPrefix"]: + """Gets all the public IP prefixes in a subscription. + + :return: An iterator like instance of either PublicIPPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_prefixes_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PublicIPPrefix"]: + """Gets all public IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PublicIPPrefix or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_prefixes_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RouteFiltersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`route_filters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_filters_delete_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_filter_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.RouteFilter: + """Gets the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :keyword expand: Expands referenced express route bgp peering resources. Default value is None. + :paramtype expand: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + _request = build_route_filters_get_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.RouteFilter, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_parameters, (IOBase, bytes)): + _content = route_filter_parameters + else: + _json = self._serialize.body(route_filter_parameters, "RouteFilter") + + _request = build_route_filters_create_or_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: _models.RouteFilter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Required. + :type route_filter_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Required. + :type route_filter_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.RouteFilter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Is either a RouteFilter type or a IO[bytes] type. Required. + :type route_filter_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilter or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteFilter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteFilter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_filters_update_tags_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.RouteFilter"]: + """Gets all route filters in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either RouteFilter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.RouteFilter"]: + """Gets all route filters in a subscription. + + :return: An iterator like instance of either RouteFilter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filters_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RouteFilterRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`route_filter_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_filter_rules_delete_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> _models.RouteFilterRule: + """Gets the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: RouteFilterRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilterRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + _request = build_route_filter_rules_get_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.RouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilterRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_rule_parameters, (IOBase, bytes)): + _content = route_filter_rule_parameters + else: + _json = self._serialize.body(route_filter_rule_parameters, "RouteFilterRule") + + _request = build_route_filter_rules_create_or_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: _models.RouteFilterRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Required. + :type route_filter_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilterRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Required. + :type route_filter_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.RouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Is either a RouteFilterRule type or a IO[bytes] type. Required. + :type route_filter_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilterRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteFilterRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteFilterRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_route_filter( + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> AsyncIterable["_models.RouteFilterRule"]: + """Gets all RouteFilterRules in a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :return: An iterator like instance of either RouteFilterRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filter_rules_list_by_route_filter_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RouteTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`route_tables` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_tables_delete_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_table_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_table_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.RouteTable: + """Gets the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + _request = build_route_tables_get_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.RouteTable, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "RouteTable") + + _request = build_route_tables_create_or_update_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteTable", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: _models.RouteTable, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.RouteTable, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Is either + a RouteTable type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.RouteTable or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_tables_update_tags_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.RouteTable"]: + """Gets all route tables in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either RouteTable or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_tables_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RouteTable"]: + """Gets all route tables in a subscription. + + :return: An iterator like instance of either RouteTable or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_tables_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RoutesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`routes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_delete_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified route from a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> _models.Route: + """Gets the specified route from a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :return: Route or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Route + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + + _request = build_routes_get_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Route", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: Union[_models.Route, IO[bytes]], + **kwargs: Any + ) -> _models.Route: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_parameters, (IOBase, bytes)): + _content = route_parameters + else: + _json = self._serialize.body(route_parameters, "Route") + + _request = build_routes_create_or_update_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Route", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Route", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: _models.Route, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Required. + :type route_parameters: ~azure.mgmt.network.v2023_09_01.models.Route + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Required. + :type route_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: Union[_models.Route, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Is either + a Route type or a IO[bytes] type. Required. + :type route_parameters: ~azure.mgmt.network.v2023_09_01.models.Route or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + route_parameters=route_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Route", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Route].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Route]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, route_table_name: str, **kwargs: Any) -> AsyncIterable["_models.Route"]: + """Gets all routes in a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :return: An iterator like instance of either Route or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_routes_list_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("RouteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityPartnerProvidersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`security_partner_providers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_partner_providers_delete_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Gets the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + _request = build_security_partner_providers_get_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.SecurityPartnerProvider, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SecurityPartnerProvider") + + _request = build_security_partner_providers_create_or_update_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: _models.SecurityPartnerProvider, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.SecurityPartnerProvider, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Is either a SecurityPartnerProvider type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider or IO[bytes] + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityPartnerProvider].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityPartnerProvider]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_security_partner_providers_update_tags_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityPartnerProvider"]: + """Lists all Security Partner Providers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityPartnerProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_partner_providers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityPartnerProvider"]: + """Gets all the Security Partner Providers in a subscription. + + :return: An iterator like instance of either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityPartnerProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_partner_providers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class BgpServiceCommunitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`bgp_service_communities` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.BgpServiceCommunity"]: + """Gets all the available bgp service communities. + + :return: An iterator like instance of either BgpServiceCommunity or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BgpServiceCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BgpServiceCommunityListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bgp_service_communities_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BgpServiceCommunityListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServiceEndpointPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`service_endpoint_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policies_delete_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Gets the specified service Endpoint Policies in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policies_get_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.ServiceEndpointPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ServiceEndpointPolicy") + + _request = build_service_endpoint_policies_create_or_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: _models.ServiceEndpointPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.ServiceEndpointPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Is either a ServiceEndpointPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceEndpointPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceEndpointPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_service_endpoint_policies_update_tags_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ServiceEndpointPolicy"]: + """Gets all the service endpoint policies in a subscription. + + :return: An iterator like instance of either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policies_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ServiceEndpointPolicy"]: + """Gets all service endpoint Policies in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policies_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServiceEndpointPolicyDefinitionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`service_endpoint_policy_definitions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policy_definitions_delete_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified ServiceEndpoint policy definitions. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the Service Endpoint Policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition. Required. + :type service_endpoint_policy_definition_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> _models.ServiceEndpointPolicyDefinition: + """Get the specified service endpoint policy definitions from service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :return: ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policy_definitions_get_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: Union[_models.ServiceEndpointPolicyDefinition, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicyDefinition: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_endpoint_policy_definitions, (IOBase, bytes)): + _content = service_endpoint_policy_definitions + else: + _json = self._serialize.body(service_endpoint_policy_definitions, "ServiceEndpointPolicyDefinition") + + _request = build_service_endpoint_policy_definitions_create_or_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: _models.ServiceEndpointPolicyDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Required. + :type service_endpoint_policy_definitions: + ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Required. + :type service_endpoint_policy_definitions: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: Union[_models.ServiceEndpointPolicyDefinition, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Is either a ServiceEndpointPolicyDefinition type or a IO[bytes] + type. Required. + :type service_endpoint_policy_definitions: + ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + service_endpoint_policy_definitions=service_endpoint_policy_definitions, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceEndpointPolicyDefinition].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceEndpointPolicyDefinition]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinition"]: + """Gets all service endpoint policy definitions in a service end point policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. Required. + :type service_endpoint_policy_name: str + :return: An iterator like instance of either ServiceEndpointPolicyDefinition or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyDefinitionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policy_definitions_list_by_resource_group_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyDefinitionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServiceTagsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`service_tags` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list(self, location: str, **kwargs: Any) -> _models.ServiceTagsListResult: + """Gets a list of service tag information resources. + + :param location: The location that will be used as a reference for version (not as a filter + based on location, you will get the list of service tags with prefix details across all regions + but limited to the cloud that your subscription belongs to). Required. + :type location: str + :return: ServiceTagsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceTagsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceTagsListResult] = kwargs.pop("cls", None) + + _request = build_service_tags_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceTagsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceTagInformationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`service_tag_information` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + location: str, + *, + no_address_prefixes: Optional[bool] = None, + tag_name: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ServiceTagInformation"]: + """Gets a list of service tag information resources with pagination. + + :param location: The location that will be used as a reference for cloud (not as a filter based + on location, you will get the list of service tags with prefix details across all regions but + limited to the cloud that your subscription belongs to). Required. + :type location: str + :keyword no_address_prefixes: Do not return address prefixes for the tag(s). Default value is + None. + :paramtype no_address_prefixes: bool + :keyword tag_name: Return tag information for a particular tag. Default value is None. + :paramtype tag_name: str + :return: An iterator like instance of either ServiceTagInformation or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceTagInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceTagInformationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_tag_information_list_request( + location=location, + subscription_id=self._config.subscription_id, + no_address_prefixes=no_address_prefixes, + tag_name=tag_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceTagInformationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class UsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`usages` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: + """List network usages for a subscription. + + :param location: The location where resource usage is queried. Required. + :type location: str + :return: An iterator like instance of either Usage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.Usage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_usages_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("UsagesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_networks` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_networks_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.VirtualNetwork: + """Gets the specified virtual network by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + _request = build_virtual_networks_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.VirtualNetwork, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetwork") + + _request = build_virtual_networks_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.VirtualNetwork, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.VirtualNetwork, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. Is + either a VirtualNetwork type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_networks_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualNetwork"]: + """Gets all virtual networks in a subscription. + + :return: An iterator like instance of either VirtualNetwork or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualNetwork"]: + """Gets all virtual networks in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetwork or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def check_ip_address_availability( + self, resource_group_name: str, virtual_network_name: str, *, ip_address: str, **kwargs: Any + ) -> _models.IPAddressAvailabilityResult: + """Checks whether a private IP address is available for use. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword ip_address: The private IP address to be verified. Required. + :paramtype ip_address: str + :return: IPAddressAvailabilityResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IPAddressAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IPAddressAvailabilityResult] = kwargs.pop("cls", None) + + _request = build_virtual_networks_check_ip_address_availability_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + ip_address=ip_address, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IPAddressAvailabilityResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_usage( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkUsage"]: + """Lists usage stats. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either VirtualNetworkUsage or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkListUsageResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_usage_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListUsageResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _list_ddos_protection_status_initial( + self, + resource_group_name: str, + virtual_network_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.VirtualNetworkDdosProtectionStatusResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VirtualNetworkDdosProtectionStatusResult]] = kwargs.pop("cls", None) + + _request = build_virtual_networks_list_ddos_protection_status_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkDdosProtectionStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_ddos_protection_status( + self, + resource_group_name: str, + virtual_network_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[AsyncIterable["_models.PublicIpDdosProtectionStatusResult"]]: + """Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword top: The max number of ip addresses to return. Default value is None. + :paramtype top: int + :keyword skip_token: The skipToken that is given with nextLink. Default value is None. + :paramtype skip_token: str + :return: An instance of LROPoller that returns an iterator like instance of either + VirtualNetworkDdosProtectionStatusResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIpDdosProtectionStatusResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkDdosProtectionStatusResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_ddos_protection_status_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkDdosProtectionStatusResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_ddos_protection_status_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + top=top, + skip_token=skip_token, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[AsyncIterable["_models.PublicIpDdosProtectionStatusResult"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncIterable["_models.PublicIpDdosProtectionStatusResult"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SubnetsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`subnets` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_subnets_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Subnet: + """Gets the specified subnet by virtual network and resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: Subnet or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Subnet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + + _request = build_subnets_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Subnet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: Union[_models.Subnet, IO[bytes]], + **kwargs: Any + ) -> _models.Subnet: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(subnet_parameters, (IOBase, bytes)): + _content = subnet_parameters + else: + _json = self._serialize.body(subnet_parameters, "Subnet") + + _request = build_subnets_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Subnet", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Subnet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: _models.Subnet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. + Required. + :type subnet_parameters: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Subnet or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. + Required. + :type subnet_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Subnet or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: Union[_models.Subnet, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. Is + either a Subnet type or a IO[bytes] type. Required. + :type subnet_parameters: ~azure.mgmt.network.v2023_09_01.models.Subnet or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Subnet or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subnet_parameters=subnet_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Subnet", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Subnet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Subnet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _prepare_network_policies_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: Union[_models.PrepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(prepare_network_policies_request_parameters, (IOBase, bytes)): + _content = prepare_network_policies_request_parameters + else: + _json = self._serialize.body(prepare_network_policies_request_parameters, "PrepareNetworkPoliciesRequest") + + _request = build_subnets_prepare_network_policies_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: _models.PrepareNetworkPoliciesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Required. + :type prepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.PrepareNetworkPoliciesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Required. + :type prepare_network_policies_request_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: Union[_models.PrepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Is either a PrepareNetworkPoliciesRequest type or a IO[bytes] + type. Required. + :type prepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.PrepareNetworkPoliciesRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._prepare_network_policies_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + prepare_network_policies_request_parameters=prepare_network_policies_request_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _unprepare_network_policies_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: Union[_models.UnprepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(unprepare_network_policies_request_parameters, (IOBase, bytes)): + _content = unprepare_network_policies_request_parameters + else: + _json = self._serialize.body( + unprepare_network_policies_request_parameters, "UnprepareNetworkPoliciesRequest" + ) + + _request = build_subnets_unprepare_network_policies_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: _models.UnprepareNetworkPoliciesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Required. + :type unprepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.UnprepareNetworkPoliciesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Required. + :type unprepare_network_policies_request_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: Union[_models.UnprepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Is either a UnprepareNetworkPoliciesRequest type or a + IO[bytes] type. Required. + :type unprepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.UnprepareNetworkPoliciesRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._unprepare_network_policies_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + unprepare_network_policies_request_parameters=unprepare_network_policies_request_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Subnet"]: + """Gets all subnets in a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either Subnet or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SubnetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subnets_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SubnetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ResourceNavigationLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`resource_navigation_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ResourceNavigationLinksListResult: + """Gets a list of resource navigation links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ResourceNavigationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ResourceNavigationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ResourceNavigationLinksListResult] = kwargs.pop("cls", None) + + _request = build_resource_navigation_links_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceNavigationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceAssociationLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`service_association_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ServiceAssociationLinksListResult: + """Gets a list of service association links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ServiceAssociationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceAssociationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceAssociationLinksListResult] = kwargs.pop("cls", None) + + _request = build_service_association_links_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceAssociationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualNetworkPeeringsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_network_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_peerings_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. Required. + :type virtual_network_peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> _models.VirtualNetworkPeering: + """Gets the specified virtual network peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. Required. + :type virtual_network_peering_name: str + :return: VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + + _request = build_virtual_network_peerings_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: Union[_models.VirtualNetworkPeering, IO[bytes]], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any + ) -> _models.VirtualNetworkPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_network_peering_parameters, (IOBase, bytes)): + _content = virtual_network_peering_parameters + else: + _json = self._serialize.body(virtual_network_peering_parameters, "VirtualNetworkPeering") + + _request = build_virtual_network_peerings_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + sync_remote_address_space=sync_remote_address_space, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: _models.VirtualNetworkPeering, + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Required. + :type virtual_network_peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.v2023_09_01.models.SyncRemoteAddressSpace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: IO[bytes], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Required. + :type virtual_network_peering_parameters: IO[bytes] + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.v2023_09_01.models.SyncRemoteAddressSpace + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: Union[_models.VirtualNetworkPeering, IO[bytes]], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Is either a VirtualNetworkPeering type or a IO[bytes] type. + Required. + :type virtual_network_peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering or IO[bytes] + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.v2023_09_01.models.SyncRemoteAddressSpace + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + virtual_network_peering_parameters=virtual_network_peering_parameters, + sync_remote_address_space=sync_remote_address_space, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkPeering"]: + """Gets all virtual network peerings in a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either VirtualNetworkPeering or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_peerings_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworkGatewaysOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_network_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VirtualNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkGateway") + + _request = build_virtual_network_gateways_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VirtualNetworkGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VirtualNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Is either a VirtualNetworkGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGateway: + """Gets the specified virtual network gateway by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualNetworkGateway"]: + """Gets all virtual network gateways by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_connections( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListEntity"]: + """Gets all the connections in a virtual network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An iterator like instance of either VirtualNetworkGatewayConnectionListEntity or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionListEntity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayListConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateways_list_connections_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayListConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reset_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VirtualNetworkGateway]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_reset_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + gateway_vip=gateway_vip, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reset( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGateway]: + """Resets the primary of the virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword gateway_vip: Virtual network gateway vip address supplied to the begin reset of the + active-active feature enabled gateway. Default value is None. + :paramtype gateway_vip: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + gateway_vip=gateway_vip, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _reset_vpn_client_shared_key_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_reset_vpn_client_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_reset_vpn_client_shared_key( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Resets the VPN client shared key of the virtual network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_vpn_client_shared_key_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _generatevpnclientpackage_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnClientParameters") + + _request = build_virtual_network_gateways_generatevpnclientpackage_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VpnClientParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Is either a VpnClientParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generatevpnclientpackage_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _generate_vpn_profile_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnClientParameters") + + _request = build_virtual_network_gateways_generate_vpn_profile_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VpnClientParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Is either a VpnClientParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _get_vpn_profile_package_url_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpn_profile_package_url_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_vpn_profile_package_url( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[str]: + """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified + resource group. The profile needs to be generated first using generateVpnProfile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vpn_profile_package_url_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _get_bgp_peer_status_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.BgpPeerStatusListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.BgpPeerStatusListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_bgp_peer_status_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + peer=peer, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BgpPeerStatusListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_bgp_peer_status( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: Optional[str] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.BgpPeerStatusListResult]: + """The GetBgpPeerStatus operation retrieves the status of all BGP peers. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword peer: The IP address of the peer to retrieve the status of. Default value is None. + :paramtype peer: str + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BgpPeerStatusListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BgpPeerStatusListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_bgp_peer_status_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BgpPeerStatusListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BgpPeerStatusListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BgpPeerStatusListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def supported_vpn_devices( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> str: + """Gets a xml format representation for supported vpn devices. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_supported_vpn_devices_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _get_learned_routes_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[_models.GatewayRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.GatewayRouteListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_learned_routes_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_learned_routes( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteListResult]: + """This operation retrieves a list of routes the virtual network gateway has learned, including + routes learned from BGP peers. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.GatewayRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_learned_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_advertised_routes_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: str, **kwargs: Any + ) -> Optional[_models.GatewayRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.GatewayRouteListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_advertised_routes_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + peer=peer, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_advertised_routes( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: str, **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteListResult]: + """This operation retrieves a list of routes the virtual network gateway is advertising to the + specified peer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword peer: The IP address of the peer. Required. + :paramtype peer: str + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.GatewayRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_advertised_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_vpnclient_ipsec_parameters_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: Union[_models.VpnClientIPsecParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnClientIPsecParameters]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnClientIPsecParameters]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpnclient_ipsec_params, (IOBase, bytes)): + _content = vpnclient_ipsec_params + else: + _json = self._serialize.body(vpnclient_ipsec_params, "VpnClientIPsecParameters") + + _request = build_virtual_network_gateways_set_vpnclient_ipsec_parameters_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: _models.VpnClientIPsecParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Required. + :type vpnclient_ipsec_params: ~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Required. + :type vpnclient_ipsec_params: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: Union[_models.VpnClientIPsecParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Is either a + VpnClientIPsecParameters type or a IO[bytes] type. Required. + :type vpnclient_ipsec_params: ~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + vpnclient_ipsec_params=vpnclient_ipsec_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnClientIPsecParameters].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnClientIPsecParameters]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_vpnclient_ipsec_parameters_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> _models.VpnClientIPsecParameters: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpnclient_ipsec_parameters_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_vpnclient_ipsec_parameters( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientIPsecParameters]: + """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec + policy for P2S client of virtual network gateway in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The virtual network gateway name. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnClientIPsecParameters].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnClientIPsecParameters]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.VpnDeviceScriptParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnDeviceScriptParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnDeviceScriptParameters, IO[bytes]], + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Is either a + VpnDeviceScriptParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnDeviceScriptParameters or IO[bytes] + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnDeviceScriptParameters") + + _request = build_virtual_network_gateways_vpn_device_configuration_script_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnPacketCaptureStartParameters") + else: + _json = None + + _request = build_virtual_network_gateways_start_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[_models.VpnPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Is either a VpnPacketCaptureStartParameters type or a IO[bytes] type. + Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnPacketCaptureStopParameters") + + _request = build_virtual_network_gateways_stop_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VpnPacketCaptureStopParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Is either a VpnPacketCaptureStopParameters type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _get_vpnclient_connection_health_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[_models.VpnClientConnectionHealthDetailListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VpnClientConnectionHealthDetailListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpnclient_connection_health_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnClientConnectionHealthDetailListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_vpnclient_connection_health( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnClientConnectionHealthDetailListResult]: + """Get VPN client connection health detail per P2S client connection of the virtual network + gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either + VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientConnectionHealthDetailListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnClientConnectionHealthDetailListResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_vpnclient_connection_health_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientConnectionHealthDetailListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnClientConnectionHealthDetailListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnClientConnectionHealthDetailListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _disconnect_virtual_network_gateway_vpn_connections_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionRequest") + + _request = build_virtual_network_gateways_disconnect_virtual_network_gateway_vpn_connections_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: _models.P2SVpnConnectionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Is either a + P2SVpnConnectionRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disconnect_virtual_network_gateway_vpn_connections_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualNetworkGatewayConnectionsOperations: # pylint: disable=too-many-public-methods,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_network_gateway_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VirtualNetworkGatewayConnection, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGatewayConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkGatewayConnection") + + _request = build_virtual_network_gateway_connections_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.VirtualNetworkGatewayConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VirtualNetworkGatewayConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Is either a VirtualNetworkGatewayConnection type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGatewayConnection: + """Gets the specified virtual network gateway connection by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :return: VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network Gateway connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGatewayConnection]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkGatewayConnection]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_network_gateway_connections_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGatewayConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionSharedKey, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectionSharedKey: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionSharedKey") + + _request = build_virtual_network_gateway_connections_set_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.ConnectionSharedKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionSharedKey, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Is either a ConnectionSharedKey type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionSharedKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionSharedKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_shared_key( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> _models.ConnectionSharedKey: + """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the + specified virtual network gateway connection shared key through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection shared + key name. Required. + :type virtual_network_gateway_connection_name: str + :return: ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualNetworkGatewayConnection"]: + """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways + connections created. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkGatewayConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateway_connections_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reset_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionResetSharedKey, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ConnectionResetSharedKey]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConnectionResetSharedKey]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionResetSharedKey") + + _request = build_virtual_network_gateway_connections_reset_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ConnectionResetSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.ConnectionResetSharedKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionResetSharedKey, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Is either a ConnectionResetSharedKey + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionResetSharedKey] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionResetSharedKey", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConnectionResetSharedKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectionResetSharedKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnPacketCaptureStartParameters") + else: + _json = None + + _request = build_virtual_network_gateway_connections_start_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[_models.VpnPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Is either a VpnPacketCaptureStartParameters type or a IO[bytes] + type. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnPacketCaptureStopParameters") + + _request = build_virtual_network_gateway_connections_stop_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.VpnPacketCaptureStopParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Is either a VpnPacketCaptureStopParameters type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _get_ike_sas_initial( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_ike_sas_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_ike_sas( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[str]: + """Lists IKE Security Associations for the virtual network gateway connection in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_ike_sas_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _reset_connection_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_reset_connection_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_reset_connection( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Resets the virtual network gateway connection specified. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_connection_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class LocalNetworkGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`local_network_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.LocalNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LocalNetworkGateway") + + _request = build_local_network_gateways_create_or_update_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: _models.LocalNetworkGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.LocalNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Is either a LocalNetworkGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LocalNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LocalNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Gets the specified local network gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + _request = build_local_network_gateways_get_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_local_network_gateways_delete_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified local network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_local_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.LocalNetworkGateway"]: + """Gets all the local network gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either LocalNetworkGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LocalNetworkGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_local_network_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LocalNetworkGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworkGatewayNatRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_network_gateway_nat_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGatewayNatRule: + """Retrieves the details of a nat rule. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: VirtualNetworkGatewayNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_nat_rules_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VirtualNetworkGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGatewayNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(nat_rule_parameters, (IOBase, bytes)): + _content = nat_rule_parameters + else: + _json = self._serialize.body(nat_rule_parameters, "VirtualNetworkGatewayNatRule") + + _request = build_virtual_network_gateway_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: _models.VirtualNetworkGatewayNatRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VirtualNetworkGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Is either a + VirtualNetworkGatewayNatRule type or a IO[bytes] type. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + nat_rule_parameters=nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkGatewayNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkGatewayNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_nat_rules_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a nat rule. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_virtual_network_gateway( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkGatewayNatRule"]: + """Retrieves all nat rules for a particular virtual network gateway. + + :param resource_group_name: The resource group name of the virtual network gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :return: An iterator like instance of either VirtualNetworkGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualNetworkGatewayNatRulesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateway_nat_rules_list_by_virtual_network_gateway_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualNetworkGatewayNatRulesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualNetworkTapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_network_taps` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, tap_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_taps_delete_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, tap_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified virtual network tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + tap_name=tap_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, tap_name: str, **kwargs: Any) -> _models.VirtualNetworkTap: + """Gets information about the specified virtual network tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of virtual network tap. Required. + :type tap_name: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + _request = build_virtual_network_taps_get_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + tap_name: str, + parameters: Union[_models.VirtualNetworkTap, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkTap") + + _request = build_virtual_network_taps_create_or_update_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: _models.VirtualNetworkTap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: Union[_models.VirtualNetworkTap, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Is either a VirtualNetworkTap type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Required. + :type tap_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Required. + :type tap_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type tap_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_parameters, (IOBase, bytes)): + _content = tap_parameters + else: + _json = self._serialize.body(tap_parameters, "TagsObject") + + _request = build_virtual_network_taps_update_tags_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualNetworkTap"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :return: An iterator like instance of either VirtualNetworkTap or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkTapListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_taps_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTapListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualNetworkTap"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkTap or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkTapListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_taps_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTapListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualRoutersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_routers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_routers_delete_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_router_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.VirtualRouter: + """Gets the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: VirtualRouter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualRouter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + _request = build_virtual_routers_get_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.VirtualRouter, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouter") + + _request = build_virtual_routers_create_or_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: _models.VirtualRouter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.VirtualRouter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Is either a + VirtualRouter type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouter or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualRouter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualRouter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualRouter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualRouter"]: + """Lists all Virtual Routers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualRouter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_routers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualRouter"]: + """Gets all the Virtual Routers in a subscription. + + :return: An iterator like instance of either VirtualRouter or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_routers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualRouterPeeringsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_router_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_router_peerings_delete_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from a Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> _models.VirtualRouterPeering: + """Gets the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :return: VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + _request = build_virtual_router_peerings_get_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouterPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouterPeering") + + _request = build_virtual_router_peerings_create_or_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: _models.VirtualRouterPeering, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Is either a VirtualRouterPeering type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualRouterPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualRouterPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualRouterPeering"]: + """Lists all Virtual Router Peerings in a Virtual Router resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :return: An iterator like instance of either VirtualRouterPeering or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_router_peerings_list_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualWansOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_wans` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any) -> _models.VirtualWAN: + """Retrieves the details of a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being retrieved. Required. + :type virtual_wan_name: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + _request = build_virtual_wans_get_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "VirtualWAN") + + _request = build_virtual_wans_create_or_update_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: _models.VirtualWAN, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Required. + :type wan_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Is either a + VirtualWAN type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualWAN", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualWAN].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualWAN]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Required. + :type wan_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "TagsObject") + + _request = build_virtual_wans_update_tags_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_wans_delete_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being deleted. Required. + :type virtual_wan_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a resource group. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a subscription. + + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnSitesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_sites` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, vpn_site_name: str, **kwargs: Any) -> _models.VpnSite: + """Retrieves the details of a VPN site. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being retrieved. Required. + :type vpn_site_name: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + _request = build_vpn_sites_get_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.VpnSite, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "VpnSite") + + _request = build_vpn_sites_create_or_update_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: _models.VpnSite, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Required. + :type vpn_site_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.VpnSite, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Is either a + VpnSite type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnSite or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_parameters=vpn_site_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Required. + :type vpn_site_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "TagsObject") + + _request = build_vpn_sites_update_tags_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vpn_site_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_sites_delete_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, vpn_site_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being deleted. Required. + :type vpn_site_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VpnSite"]: + """Lists all the vpnSites in a resource group. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnSite or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSitesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_sites_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSitesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VpnSite"]: + """Lists all the VpnSites in a subscription. + + :return: An iterator like instance of either VpnSite or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSitesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_sites_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSitesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnSiteLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_site_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, vpn_site_name: str, vpn_site_link_name: str, **kwargs: Any + ) -> _models.VpnSiteLink: + """Retrieves the details of a VPN site link. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. Required. + :type vpn_site_name: str + :param vpn_site_link_name: The name of the VpnSiteLink being retrieved. Required. + :type vpn_site_link_name: str + :return: VpnSiteLink or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSiteLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnSiteLink] = kwargs.pop("cls", None) + + _request = build_vpn_site_links_get_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_link_name=vpn_site_link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSiteLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_vpn_site( + self, resource_group_name: str, vpn_site_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnSiteLink"]: + """Lists all the vpnSiteLinks in a resource group for a vpn site. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. Required. + :type vpn_site_name: str + :return: An iterator like instance of either VpnSiteLink or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSiteLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSiteLinksResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_site_links_list_by_vpn_site_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSiteLinksResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnSitesConfigurationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_sites_configuration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _download_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_wan_name: str, + request: Union[_models.GetVpnSitesConfigurationRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "GetVpnSitesConfigurationRequest") + + _request = build_vpn_sites_configuration_download_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: _models.GetVpnSitesConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GetVpnSitesConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: Union[_models.GetVpnSitesConfigurationRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Is either a + GetVpnSitesConfigurationRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GetVpnSitesConfigurationRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._download_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnServerConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_server_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Retrieves the details of a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being retrieved. + Required. + :type vpn_server_configuration_name: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_get_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.VpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "VpnServerConfiguration") + + _request = build_vpn_server_configurations_create_or_update_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: _models.VpnServerConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Required. + :type vpn_server_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Required. + :type vpn_server_configuration_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.VpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Is either a VpnServerConfiguration type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + vpn_server_configuration_parameters=vpn_server_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Required. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Required. + :type vpn_server_configuration_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "TagsObject") + + _request = build_vpn_server_configurations_update_tags_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_delete_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being deleted. + Required. + :type vpn_server_configuration_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnServerConfiguration"]: + """Lists all the vpnServerConfigurations in a resource group. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_server_configurations_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VpnServerConfiguration"]: + """Lists all the VpnServerConfigurations in a subscription. + + :return: An iterator like instance of either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_server_configurations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ConfigurationPolicyGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`configuration_policy_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: Union[_models.VpnServerConfigurationPolicyGroup, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfigurationPolicyGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_policy_group_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_policy_group_parameters + else: + _json = self._serialize.body( + vpn_server_configuration_policy_group_parameters, "VpnServerConfigurationPolicyGroup" + ) + + _request = build_configuration_policy_groups_create_or_update_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: _models.VpnServerConfigurationPolicyGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Required. + :type vpn_server_configuration_policy_group_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationPolicyGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Required. + :type vpn_server_configuration_policy_group_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationPolicyGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: Union[_models.VpnServerConfigurationPolicyGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Is either a VpnServerConfigurationPolicyGroup type + or a IO[bytes] type. Required. + :type vpn_server_configuration_policy_group_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationPolicyGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + vpn_server_configuration_policy_group_parameters=vpn_server_configuration_policy_group_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfigurationPolicyGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_configuration_policy_groups_delete_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a ConfigurationPolicyGroup. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> _models.VpnServerConfigurationPolicyGroup: + """Retrieves the details of a ConfigurationPolicyGroup. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup being + retrieved. Required. + :type configuration_policy_group_name: str + :return: VpnServerConfigurationPolicyGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + + _request = build_configuration_policy_groups_get_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_vpn_server_configuration( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnServerConfigurationPolicyGroup"]: + """Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :return: An iterator like instance of either VpnServerConfigurationPolicyGroup or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnServerConfigurationPolicyGroupsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_configuration_policy_groups_list_by_vpn_server_configuration_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationPolicyGroupsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualHubsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_hubs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> _models.VirtualHub: + """Retrieves the details of a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + _request = build_virtual_hubs_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.VirtualHub, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "VirtualHub") + + _request = build_virtual_hubs_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: _models.VirtualHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Required. + :type virtual_hub_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.VirtualHub, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Is either a + VirtualHub type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualHub or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + virtual_hub_parameters=virtual_hub_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHub", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHub].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHub]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Required. + :type virtual_hub_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "TagsObject") + + _request = build_virtual_hubs_update_tags_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hubs_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualHub"]: + """Lists all the VirtualHubs in a resource group. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualHub or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hubs_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualHub"]: + """Lists all the VirtualHubs in a subscription. + + :return: An iterator like instance of either VirtualHub or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hubs_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _get_effective_virtual_hub_routes_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[Union[_models.EffectiveRoutesParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[_models.VirtualHubEffectiveRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualHubEffectiveRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(effective_routes_parameters, (IOBase, bytes)): + _content = effective_routes_parameters + else: + if effective_routes_parameters is not None: + _json = self._serialize.body(effective_routes_parameters, "EffectiveRoutesParameters") + else: + _json = None + + _request = build_virtual_hubs_get_effective_virtual_hub_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("VirtualHubEffectiveRouteList", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[_models.EffectiveRoutesParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Default value is None. + :type effective_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.EffectiveRoutesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Default value is None. + :type effective_routes_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[Union[_models.EffectiveRoutesParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Is either a EffectiveRoutesParameters type or a IO[bytes] type. Default + value is None. + :type effective_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.EffectiveRoutesParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubEffectiveRouteList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_effective_virtual_hub_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + effective_routes_parameters=effective_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHubEffectiveRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHubEffectiveRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHubEffectiveRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_inbound_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: Union[_models.GetInboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.EffectiveRouteMapRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EffectiveRouteMapRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(get_inbound_routes_parameters, (IOBase, bytes)): + _content = get_inbound_routes_parameters + else: + _json = self._serialize.body(get_inbound_routes_parameters, "GetInboundRoutesParameters") + + _request = build_virtual_hubs_get_inbound_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: _models.GetInboundRoutesParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Required. + :type get_inbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetInboundRoutesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Required. + :type get_inbound_routes_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: Union[_models.GetInboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Is either a GetInboundRoutesParameters type or a IO[bytes] type. Required. + :type get_inbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetInboundRoutesParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveRouteMapRouteList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_inbound_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + get_inbound_routes_parameters=get_inbound_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveRouteMapRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveRouteMapRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_outbound_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: Union[_models.GetOutboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.EffectiveRouteMapRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EffectiveRouteMapRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(get_outbound_routes_parameters, (IOBase, bytes)): + _content = get_outbound_routes_parameters + else: + _json = self._serialize.body(get_outbound_routes_parameters, "GetOutboundRoutesParameters") + + _request = build_virtual_hubs_get_outbound_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: _models.GetOutboundRoutesParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Required. + :type get_outbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetOutboundRoutesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Required. + :type get_outbound_routes_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: Union[_models.GetOutboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Is either a GetOutboundRoutesParameters type or a IO[bytes] type. + Required. + :type get_outbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetOutboundRoutesParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EffectiveRouteMapRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveRouteMapRouteList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_outbound_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + get_outbound_routes_parameters=get_outbound_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EffectiveRouteMapRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EffectiveRouteMapRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class RouteMapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`route_maps` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> _models.RouteMap: + """Retrieves the details of a RouteMap. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :return: RouteMap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteMap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + + _request = build_route_maps_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteMap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: Union[_models.RouteMap, IO[bytes]], + **kwargs: Any + ) -> _models.RouteMap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_map_parameters, (IOBase, bytes)): + _content = route_map_parameters + else: + _json = self._serialize.body(route_map_parameters, "RouteMap") + + _request = build_route_maps_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteMap", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteMap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: _models.RouteMap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Required. + :type route_map_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteMap + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteMap or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Required. + :type route_map_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RouteMap or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: Union[_models.RouteMap, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Is either a + RouteMap type or a IO[bytes] type. Required. + :type route_map_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteMap or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RouteMap or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + route_map_parameters=route_map_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteMap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RouteMap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RouteMap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_maps_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a RouteMap. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> AsyncIterable["_models.RouteMap"]: + """Retrieves the details of all RouteMaps. + + :param resource_group_name: The resource group name of the RouteMap's resource group'. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either RouteMap or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListRouteMapsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_maps_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListRouteMapsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class HubVirtualNetworkConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`hub_virtual_network_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: Union[_models.HubVirtualNetworkConnection, IO[bytes]], + **kwargs: Any + ) -> _models.HubVirtualNetworkConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(hub_virtual_network_connection_parameters, (IOBase, bytes)): + _content = hub_virtual_network_connection_parameters + else: + _json = self._serialize.body(hub_virtual_network_connection_parameters, "HubVirtualNetworkConnection") + + _request = build_hub_virtual_network_connections_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: _models.HubVirtualNetworkConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Required. + :type hub_virtual_network_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either HubVirtualNetworkConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Required. + :type hub_virtual_network_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either HubVirtualNetworkConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: Union[_models.HubVirtualNetworkConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Is either a HubVirtualNetworkConnection type or a IO[bytes] type. + Required. + :type hub_virtual_network_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either HubVirtualNetworkConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + hub_virtual_network_connection_parameters=hub_virtual_network_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HubVirtualNetworkConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HubVirtualNetworkConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_hub_virtual_network_connections_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> _models.HubVirtualNetworkConnection: + """Retrieves the details of a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: HubVirtualNetworkConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + + _request = build_hub_virtual_network_connections_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HubVirtualNetworkConnection"]: + """Retrieves the details of all HubVirtualNetworkConnections. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubVirtualNetworkConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListHubVirtualNetworkConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_hub_virtual_network_connections_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListHubVirtualNetworkConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.VpnGateway: + """Retrieves the details of a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: VpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.VpnGateway, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "VpnGateway") + + _request = build_vpn_gateways_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: _models.VpnGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Required. + :type vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.VpnGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Is either a VpnGateway type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "TagsObject") + + _request = build_vpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. + Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. + Required. + :type vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _reset_initial( + self, resource_group_name: str, gateway_name: str, *, ip_configuration_id: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.VpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VpnGateway]] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_reset_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + ip_configuration_id=ip_configuration_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reset( + self, resource_group_name: str, gateway_name: str, *, ip_configuration_id: Optional[str] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGateway]: + """Resets the primary of the vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :keyword ip_configuration_id: VpnGateway ipConfigurationId to specify the gateway instance. + Default value is None. + :paramtype ip_configuration_id: str + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + ip_configuration_id=ip_configuration_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnGatewayPacketCaptureStartParameters") + else: + _json = None + + _request = build_vpn_gateways_start_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[_models.VpnGatewayPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Is either a VpnGatewayPacketCaptureStartParameters type or a IO[bytes] type. + Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStartParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnGatewayPacketCaptureStopParameters") + else: + _json = None + + _request = build_vpn_gateways_stop_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[_models.VpnGatewayPacketCaptureStopParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Is either a VpnGatewayPacketCaptureStopParameters type or a IO[bytes] type. Default + value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStopParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VpnGateway"]: + """Lists all the VpnGateways in a resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.VpnGateway"]: + """Lists all the VpnGateways in a subscription. + + :return: An iterator like instance of either VpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_gateways_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnLinkConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_link_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _reset_connection_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_link_connections_reset_connection_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_reset_connection( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Resets the VpnLink connection specified. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn link connection. Required. + :type link_connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_connection_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _get_ike_sas_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_vpn_link_connections_get_ike_sas_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_ike_sas( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn link connection. Required. + :type link_connection_name: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_ike_sas_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_vpn_connection( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnSiteLinkConnection"]: + """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn + connection. + + :param resource_group_name: The resource group name of the vpn gateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: An iterator like instance of either VpnSiteLinkConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSiteLinkConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_link_connections_list_by_vpn_connection_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSiteLinkConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.VpnConnection: + """Retrieves the details of a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: VpnConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + + _request = build_vpn_connections_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: Union[_models.VpnConnection, IO[bytes]], + **kwargs: Any + ) -> _models.VpnConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_connection_parameters, (IOBase, bytes)): + _content = vpn_connection_parameters + else: + _json = self._serialize.body(vpn_connection_parameters, "VpnConnection") + + _request = build_vpn_connections_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: _models.VpnConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. + Required. + :type vpn_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. + Required. + :type vpn_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: Union[_models.VpnConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. Is + either a VpnConnection type or a IO[bytes] type. Required. + :type vpn_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnConnection or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + vpn_connection_parameters=vpn_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_connections_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnConnectionPacketCaptureStartParameters") + else: + _json = None + + _request = build_vpn_connections_start_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[_models.VpnConnectionPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Is either a VpnConnectionPacketCaptureStartParameters type or a IO[bytes] + type. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStartParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnConnectionPacketCaptureStopParameters") + else: + _json = None + + _request = build_vpn_connections_stop_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[_models.VpnConnectionPacketCaptureStopParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Is either a VpnConnectionPacketCaptureStopParameters type or a IO[bytes] + type. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStopParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_vpn_gateway( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnConnection"]: + """Retrieves all vpn connections for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either VpnConnection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_connections_list_by_vpn_gateway_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VpnSiteLinkConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_site_link_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> _models.VpnSiteLinkConnection: + """Retrieves the details of a vpn site link connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn connection. Required. + :type link_connection_name: str + :return: VpnSiteLinkConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnSiteLinkConnection] = kwargs.pop("cls", None) + + _request = build_vpn_site_link_connections_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSiteLinkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NatRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`nat_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> _models.VpnGatewayNatRule: + """Retrieves the details of a nat ruleGet. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: VpnGatewayNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + + _request = build_nat_rules_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VpnGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGatewayNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(nat_rule_parameters, (IOBase, bytes)): + _content = nat_rule_parameters + else: + _json = self._serialize.body(nat_rule_parameters, "VpnGatewayNatRule") + + _request = build_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: _models.VpnGatewayNatRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VpnGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Is either a + VpnGatewayNatRule type or a IO[bytes] type. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + nat_rule_parameters=nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnGatewayNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnGatewayNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nat_rules_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a nat rule. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_vpn_gateway( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VpnGatewayNatRule"]: + """Retrieves all nat rules for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either VpnGatewayNatRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnGatewayNatRulesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_rules_list_by_vpn_gateway_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewayNatRulesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class P2SVpnGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`p2_svpn_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.P2SVpnGateway: + """Retrieves the details of a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: P2SVpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.P2SVpnGateway, IO[bytes]], + **kwargs: Any + ) -> _models.P2SVpnGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "P2SVpnGateway") + + _request = build_p2_svpn_gateways_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: _models.P2SVpnGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Required. + :type p2_s_vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.P2SVpnGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Is either a P2SVpnGateway type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "TagsObject") + + _request = build_p2_svpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Required. + :type p2_s_vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.P2SVpnGateway"]: + """Lists all the P2SVpnGateways in a resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :return: An iterator like instance of either P2SVpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListP2SVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.P2SVpnGateway"]: + """Lists all the P2SVpnGateways in a subscription. + + :return: An iterator like instance of either P2SVpnGateway or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListP2SVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_gateways_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reset_initial( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_reset_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reset( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Resets the primary of the p2s vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _generate_vpn_profile_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.P2SVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnProfileResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnProfileResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "P2SVpnProfileParameters") + + _request = build_p2_svpn_gateways_generate_vpn_profile_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: _models.P2SVpnProfileParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnProfileParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.P2SVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Is either a P2SVpnProfileParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnProfileParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnProfileResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnProfileResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnProfileResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_p2_s_vpn_connection_health_initial( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_get_p2_s_vpn_connection_health_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_get_p2_s_vpn_connection_health( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnGateway]: + """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_p2_s_vpn_connection_health_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_p2_s_vpn_connection_health_detailed_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: Union[_models.P2SVpnConnectionHealthRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.P2SVpnConnectionHealth]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.P2SVpnConnectionHealth]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionHealthRequest") + + _request = build_p2_svpn_gateways_get_p2_s_vpn_connection_health_detailed_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnConnectionHealth", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: _models.P2SVpnConnectionHealthRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. + Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealthRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. + Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: Union[_models.P2SVpnConnectionHealthRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. Is + either a P2SVpnConnectionHealthRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealthRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnConnectionHealth] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._get_p2_s_vpn_connection_health_detailed_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnConnectionHealth", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.P2SVpnConnectionHealth].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.P2SVpnConnectionHealth]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _disconnect_p2_s_vpn_connections_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionRequest") + + _request = build_p2_svpn_gateways_disconnect_p2_s_vpn_connections_request( + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: _models.P2SVpnConnectionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Is either a + P2SVpnConnectionRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disconnect_p2_s_vpn_connections_initial( # type: ignore + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnServerConfigurationsAssociatedWithVirtualWanOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`vpn_server_configurations_associated_with_virtual_wan` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _list_initial( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> Optional[_models.VpnServerConfigurationsResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VpnServerConfigurationsResponse]] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_associated_with_virtual_wan_list_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfigurationsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.VpnServerConfigurationsResponse]: + """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnServerConfigurationsResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfigurationsResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VpnServerConfigurationsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VpnServerConfigurationsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualHubRouteTableV2SOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_hub_route_table_v2_s` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> _models.VirtualHubRouteTableV2: + """Retrieves the details of a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :return: VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + + _request = build_virtual_hub_route_table_v2_s_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: Union[_models.VirtualHubRouteTableV2, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHubRouteTableV2: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_route_table_v2_parameters, (IOBase, bytes)): + _content = virtual_hub_route_table_v2_parameters + else: + _json = self._serialize.body(virtual_hub_route_table_v2_parameters, "VirtualHubRouteTableV2") + + _request = build_virtual_hub_route_table_v2_s_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: _models.VirtualHubRouteTableV2, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Required. + :type virtual_hub_route_table_v2_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Required. + :type virtual_hub_route_table_v2_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: Union[_models.VirtualHubRouteTableV2, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Is either a VirtualHubRouteTableV2 type or a IO[bytes] type. Required. + :type virtual_hub_route_table_v2_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2 or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + virtual_hub_route_table_v2_parameters=virtual_hub_route_table_v2_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualHubRouteTableV2].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHubRouteTableV2]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_route_table_v2_s_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualHubRouteTableV2"]: + """Retrieves the details of all VirtualHubRouteTableV2s. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either VirtualHubRouteTableV2 or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubRouteTableV2SResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_route_table_v2_s_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubRouteTableV2SResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExpressRouteGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list_by_subscription(self, **kwargs: Any) -> _models.ExpressRouteGatewayList: + """Lists ExpressRoute gateways under a given subscription. + + :return: ExpressRouteGatewayList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteGatewayList] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGatewayList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.ExpressRouteGatewayList: + """Lists ExpressRoute gateways in a given resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: ExpressRouteGatewayList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteGatewayList] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGatewayList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: Union[_models.ExpressRouteGateway, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(put_express_route_gateway_parameters, (IOBase, bytes)): + _content = put_express_route_gateway_parameters + else: + _json = self._serialize.body(put_express_route_gateway_parameters, "ExpressRouteGateway") + + _request = build_express_route_gateways_create_or_update_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: _models.ExpressRouteGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Required. + :type put_express_route_gateway_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Required. + :type put_express_route_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: Union[_models.ExpressRouteGateway, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Is either a ExpressRouteGateway type or a IO[bytes] type. Required. + :type put_express_route_gateway_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + put_express_route_gateway_parameters=put_express_route_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ExpressRouteGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExpressRouteGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(express_route_gateway_parameters, (IOBase, bytes)): + _content = express_route_gateway_parameters + else: + _json = self._serialize.body(express_route_gateway_parameters, "TagsObject") + + _request = build_express_route_gateways_update_tags_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Required. + :type express_route_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Required. + :type express_route_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type express_route_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + express_route_gateway_parameters=express_route_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> _models.ExpressRouteGateway: + """Fetches the details of a ExpressRoute gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_get_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_delete_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway + resource can only be deleted when there are no connection subresources. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ExpressRouteConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`express_route_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: Union[_models.ExpressRouteConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(put_express_route_connection_parameters, (IOBase, bytes)): + _content = put_express_route_connection_parameters + else: + _json = self._serialize.body(put_express_route_connection_parameters, "ExpressRouteConnection") + + _request = build_express_route_connections_create_or_update_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: _models.ExpressRouteConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Required. + :type put_express_route_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Required. + :type put_express_route_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: Union[_models.ExpressRouteConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Is either a ExpressRouteConnection type or a IO[bytes] + type. Required. + :type put_express_route_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + put_express_route_connection_parameters=put_express_route_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExpressRouteConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExpressRouteConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteConnection: + """Gets the specified ExpressRouteConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the ExpressRoute connection. Required. + :type connection_name: str + :return: ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + + _request = build_express_route_connections_get_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_connections_delete_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a connection to a ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def list( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> _models.ExpressRouteConnectionList: + """Lists ExpressRouteConnections. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: ExpressRouteConnectionList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnectionList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteConnectionList] = kwargs.pop("cls", None) + + _request = build_express_route_connections_list_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteConnectionList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkVirtualApplianceConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`network_virtual_appliance_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: Union[_models.NetworkVirtualApplianceConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualApplianceConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(network_virtual_appliance_connection_parameters, (IOBase, bytes)): + _content = network_virtual_appliance_connection_parameters + else: + _json = self._serialize.body( + network_virtual_appliance_connection_parameters, "NetworkVirtualApplianceConnection" + ) + + _request = build_network_virtual_appliance_connections_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: _models.NetworkVirtualApplianceConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Required. + :type network_virtual_appliance_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkVirtualApplianceConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Required. + :type network_virtual_appliance_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NetworkVirtualApplianceConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: Union[_models.NetworkVirtualApplianceConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Is either a NetworkVirtualApplianceConnection + type or a IO[bytes] type. Required. + :type network_virtual_appliance_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkVirtualApplianceConnection or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + network_virtual_appliance_connection_parameters=network_virtual_appliance_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkVirtualApplianceConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkVirtualApplianceConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> _models.NetworkVirtualApplianceConnection: + """Retrieves the details of specified NVA connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :return: NetworkVirtualApplianceConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliance_connections_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliance_connections_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a NVA connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkVirtualApplianceConnection"]: + """Lists NetworkVirtualApplianceConnections under the NVA. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An iterator like instance of either NetworkVirtualApplianceConnection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceConnectionList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliance_connections_list_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceConnectionList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualHubBgpConnectionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_hub_bgp_connection` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> _models.BgpConnection: + """Retrieves the details of a Virtual Hub Bgp Connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: BgpConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BgpConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connection_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: Union[_models.BgpConnection, IO[bytes]], + **kwargs: Any + ) -> _models.BgpConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BgpConnection") + + _request = build_virtual_hub_bgp_connection_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: _models.BgpConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BgpConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: Union[_models.BgpConnection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Is either a BgpConnection type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BgpConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BgpConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BgpConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BgpConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connection_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualHubBgpConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_hub_bgp_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BgpConnection"]: + """Retrieves the details of all VirtualHubBgpConnections. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either BgpConnection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubBgpConnectionResults] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_bgp_connections_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubBgpConnectionResults", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _list_learned_routes_initial( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> Optional[Dict[str, List[_models.PeerRoute]]]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[Dict[str, List[_models.PeerRoute]]]] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connections_list_learned_routes_request( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_learned_routes( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]: + """Retrieves a list of routes the virtual hub bgp connection has learned. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. Required. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either dict mapping str to list of + PeerRoute or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[dict[str, + list[~azure.mgmt.network.v2023_09_01.models.PeerRoute]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Dict[str, List[_models.PeerRoute]]] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_learned_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_advertised_routes_initial( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> Optional[Dict[str, List[_models.PeerRoute]]]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[Dict[str, List[_models.PeerRoute]]]] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connections_list_advertised_routes_request( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_advertised_routes( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]: + """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. Required. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. Required. + :type connection_name: str + :return: An instance of AsyncLROPoller that returns either dict mapping str to list of + PeerRoute or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[dict[str, + list[~azure.mgmt.network.v2023_09_01.models.PeerRoute]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Dict[str, List[_models.PeerRoute]]] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._list_advertised_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[Dict[str, List[_models.PeerRoute]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualHubIpConfigurationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`virtual_hub_ip_configuration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> _models.HubIpConfiguration: + """Retrieves the details of a Virtual Hub Ip configuration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :return: HubIpConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + + _request = build_virtual_hub_ip_configuration_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: Union[_models.HubIpConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.HubIpConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "HubIpConfiguration") + + _request = build_virtual_hub_ip_configuration_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: _models.HubIpConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: Union[_models.HubIpConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Is either a HubIpConfiguration type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HubIpConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HubIpConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_ip_configuration_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HubIpConfiguration"]: + """Retrieves the details of all VirtualHubIpConfigurations. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubIpConfiguration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubIpConfigurationResults] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_ip_configuration_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubIpConfigurationResults", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class HubRouteTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`hub_route_tables` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: Union[_models.HubRouteTable, IO[bytes]], + **kwargs: Any + ) -> _models.HubRouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_table_parameters, (IOBase, bytes)): + _content = route_table_parameters + else: + _json = self._serialize.body(route_table_parameters, "HubRouteTable") + + _request = build_hub_route_tables_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: _models.HubRouteTable, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Required. + :type route_table_parameters: ~azure.mgmt.network.v2023_09_01.models.HubRouteTable + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Required. + :type route_table_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: Union[_models.HubRouteTable, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Is either a + HubRouteTable type or a IO[bytes] type. Required. + :type route_table_parameters: ~azure.mgmt.network.v2023_09_01.models.HubRouteTable or IO[bytes] + :return: An instance of AsyncLROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + route_table_parameters=route_table_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubRouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HubRouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HubRouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> _models.HubRouteTable: + """Retrieves the details of a RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :return: HubRouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.HubRouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + + _request = build_hub_route_tables_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_hub_route_tables_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a RouteTable. + + :param resource_group_name: The resource group name of the RouteTable. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HubRouteTable"]: + """Retrieves the details of all RouteTables. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubRouteTable or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListHubRouteTablesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_hub_route_tables_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListHubRouteTablesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RoutingIntentOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`routing_intent` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: Union[_models.RoutingIntent, IO[bytes]], + **kwargs: Any + ) -> _models.RoutingIntent: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(routing_intent_parameters, (IOBase, bytes)): + _content = routing_intent_parameters + else: + _json = self._serialize.body(routing_intent_parameters, "RoutingIntent") + + _request = build_routing_intent_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: _models.RoutingIntent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. + Required. + :type routing_intent_parameters: ~azure.mgmt.network.v2023_09_01.models.RoutingIntent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. + Required. + :type routing_intent_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: Union[_models.RoutingIntent, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. Is + either a RoutingIntent type or a IO[bytes] type. Required. + :type routing_intent_parameters: ~azure.mgmt.network.v2023_09_01.models.RoutingIntent or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + routing_intent_parameters=routing_intent_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RoutingIntent", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RoutingIntent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RoutingIntent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> _models.RoutingIntent: + """Retrieves the details of a RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the RoutingIntent. Required. + :type routing_intent_name: str + :return: RoutingIntent or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RoutingIntent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + + _request = build_routing_intent_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routing_intent_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the RoutingIntent. Required. + :type routing_intent_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> AsyncIterable["_models.RoutingIntent"]: + """Retrieves the details of all RoutingIntent child resources of the VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either RoutingIntent or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListRoutingIntentResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_routing_intent_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListRoutingIntentResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class WebApplicationFirewallPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.aio.NetworkManagementClient`'s + :attr:`web_application_firewall_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.WebApplicationFirewallPolicy"]: + """Lists all of the protection policies within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either WebApplicationFirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.WebApplicationFirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_application_firewall_policies_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WebApplicationFirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncIterable["_models.WebApplicationFirewallPolicy"]: + """Gets all the WAF policies in a subscription. + + :return: An iterator like instance of either WebApplicationFirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.WebApplicationFirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_application_firewall_policies_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WebApplicationFirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, policy_name: str, **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Retrieve protection policy with specified name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.WebApplicationFirewallPolicy] = kwargs.pop("cls", None) + + _request = build_web_application_firewall_policies_get_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: _models.WebApplicationFirewallPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: Union[_models.WebApplicationFirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Is either a WebApplicationFirewallPolicy type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy or + IO[bytes] + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WebApplicationFirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "WebApplicationFirewallPolicy") + + _request = build_web_application_firewall_policies_create_or_update_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_web_application_firewall_policies_delete_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, policy_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + policy_name=policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/__init__.py new file mode 100644 index 00000000000..4eba3021d4a --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/__init__.py @@ -0,0 +1,1847 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import AadAuthenticationParameters +from ._models_py3 import Action +from ._models_py3 import ActiveBaseSecurityAdminRule +from ._models_py3 import ActiveConfigurationParameter +from ._models_py3 import ActiveConnectivityConfiguration +from ._models_py3 import ActiveConnectivityConfigurationsListResult +from ._models_py3 import ActiveDefaultSecurityAdminRule +from ._models_py3 import ActiveSecurityAdminRule +from ._models_py3 import ActiveSecurityAdminRulesListResult +from ._models_py3 import AddressPrefixItem +from ._models_py3 import AddressSpace +from ._models_py3 import AdminRule +from ._models_py3 import AdminRuleCollection +from ._models_py3 import AdminRuleCollectionListResult +from ._models_py3 import AdminRuleListResult +from ._models_py3 import ApplicationGateway +from ._models_py3 import ApplicationGatewayAuthenticationCertificate +from ._models_py3 import ApplicationGatewayAutoscaleConfiguration +from ._models_py3 import ApplicationGatewayAvailableSslOptions +from ._models_py3 import ApplicationGatewayAvailableSslPredefinedPolicies +from ._models_py3 import ApplicationGatewayAvailableWafRuleSetsResult +from ._models_py3 import ApplicationGatewayBackendAddress +from ._models_py3 import ApplicationGatewayBackendAddressPool +from ._models_py3 import ApplicationGatewayBackendHealth +from ._models_py3 import ApplicationGatewayBackendHealthHttpSettings +from ._models_py3 import ApplicationGatewayBackendHealthOnDemand +from ._models_py3 import ApplicationGatewayBackendHealthPool +from ._models_py3 import ApplicationGatewayBackendHealthServer +from ._models_py3 import ApplicationGatewayBackendHttpSettings +from ._models_py3 import ApplicationGatewayBackendSettings +from ._models_py3 import ApplicationGatewayClientAuthConfiguration +from ._models_py3 import ApplicationGatewayConnectionDraining +from ._models_py3 import ApplicationGatewayCustomError +from ._models_py3 import ApplicationGatewayFirewallDisabledRuleGroup +from ._models_py3 import ApplicationGatewayFirewallExclusion +from ._models_py3 import ApplicationGatewayFirewallManifestRuleSet +from ._models_py3 import ApplicationGatewayFirewallRule +from ._models_py3 import ApplicationGatewayFirewallRuleGroup +from ._models_py3 import ApplicationGatewayFirewallRuleSet +from ._models_py3 import ApplicationGatewayFrontendIPConfiguration +from ._models_py3 import ApplicationGatewayFrontendPort +from ._models_py3 import ApplicationGatewayGlobalConfiguration +from ._models_py3 import ApplicationGatewayHeaderConfiguration +from ._models_py3 import ApplicationGatewayHttpListener +from ._models_py3 import ApplicationGatewayIPConfiguration +from ._models_py3 import ApplicationGatewayListResult +from ._models_py3 import ApplicationGatewayListener +from ._models_py3 import ApplicationGatewayLoadDistributionPolicy +from ._models_py3 import ApplicationGatewayLoadDistributionTarget +from ._models_py3 import ApplicationGatewayOnDemandProbe +from ._models_py3 import ApplicationGatewayPathRule +from ._models_py3 import ApplicationGatewayPrivateEndpointConnection +from ._models_py3 import ApplicationGatewayPrivateEndpointConnectionListResult +from ._models_py3 import ApplicationGatewayPrivateLinkConfiguration +from ._models_py3 import ApplicationGatewayPrivateLinkIpConfiguration +from ._models_py3 import ApplicationGatewayPrivateLinkResource +from ._models_py3 import ApplicationGatewayPrivateLinkResourceListResult +from ._models_py3 import ApplicationGatewayProbe +from ._models_py3 import ApplicationGatewayProbeHealthResponseMatch +from ._models_py3 import ApplicationGatewayRedirectConfiguration +from ._models_py3 import ApplicationGatewayRequestRoutingRule +from ._models_py3 import ApplicationGatewayRewriteRule +from ._models_py3 import ApplicationGatewayRewriteRuleActionSet +from ._models_py3 import ApplicationGatewayRewriteRuleCondition +from ._models_py3 import ApplicationGatewayRewriteRuleSet +from ._models_py3 import ApplicationGatewayRoutingRule +from ._models_py3 import ApplicationGatewaySku +from ._models_py3 import ApplicationGatewaySslCertificate +from ._models_py3 import ApplicationGatewaySslPolicy +from ._models_py3 import ApplicationGatewaySslPredefinedPolicy +from ._models_py3 import ApplicationGatewaySslProfile +from ._models_py3 import ApplicationGatewayTrustedClientCertificate +from ._models_py3 import ApplicationGatewayTrustedRootCertificate +from ._models_py3 import ApplicationGatewayUrlConfiguration +from ._models_py3 import ApplicationGatewayUrlPathMap +from ._models_py3 import ApplicationGatewayWafDynamicManifestResult +from ._models_py3 import ApplicationGatewayWafDynamicManifestResultList +from ._models_py3 import ApplicationGatewayWebApplicationFirewallConfiguration +from ._models_py3 import ApplicationRule +from ._models_py3 import ApplicationSecurityGroup +from ._models_py3 import ApplicationSecurityGroupListResult +from ._models_py3 import AuthorizationListResult +from ._models_py3 import AutoApprovedPrivateLinkService +from ._models_py3 import AutoApprovedPrivateLinkServicesResult +from ._models_py3 import Availability +from ._models_py3 import AvailableDelegation +from ._models_py3 import AvailableDelegationsResult +from ._models_py3 import AvailablePrivateEndpointType +from ._models_py3 import AvailablePrivateEndpointTypesResult +from ._models_py3 import AvailableProvidersList +from ._models_py3 import AvailableProvidersListCity +from ._models_py3 import AvailableProvidersListCountry +from ._models_py3 import AvailableProvidersListParameters +from ._models_py3 import AvailableProvidersListState +from ._models_py3 import AvailableServiceAlias +from ._models_py3 import AvailableServiceAliasesResult +from ._models_py3 import AzureAsyncOperationResult +from ._models_py3 import AzureFirewall +from ._models_py3 import AzureFirewallApplicationRule +from ._models_py3 import AzureFirewallApplicationRuleCollection +from ._models_py3 import AzureFirewallApplicationRuleProtocol +from ._models_py3 import AzureFirewallFqdnTag +from ._models_py3 import AzureFirewallFqdnTagListResult +from ._models_py3 import AzureFirewallIPConfiguration +from ._models_py3 import AzureFirewallIpGroups +from ._models_py3 import AzureFirewallListResult +from ._models_py3 import AzureFirewallNatRCAction +from ._models_py3 import AzureFirewallNatRule +from ._models_py3 import AzureFirewallNatRuleCollection +from ._models_py3 import AzureFirewallNetworkRule +from ._models_py3 import AzureFirewallNetworkRuleCollection +from ._models_py3 import AzureFirewallPacketCaptureFlags +from ._models_py3 import AzureFirewallPacketCaptureRule +from ._models_py3 import AzureFirewallPublicIPAddress +from ._models_py3 import AzureFirewallRCAction +from ._models_py3 import AzureFirewallSku +from ._models_py3 import AzureReachabilityReport +from ._models_py3 import AzureReachabilityReportItem +from ._models_py3 import AzureReachabilityReportLatencyInfo +from ._models_py3 import AzureReachabilityReportLocation +from ._models_py3 import AzureReachabilityReportParameters +from ._models_py3 import AzureWebCategory +from ._models_py3 import AzureWebCategoryListResult +from ._models_py3 import BGPCommunity +from ._models_py3 import BackendAddressInboundNatRulePortMappings +from ._models_py3 import BackendAddressPool +from ._models_py3 import BaseAdminRule +from ._models_py3 import BastionActiveSession +from ._models_py3 import BastionActiveSessionListResult +from ._models_py3 import BastionHost +from ._models_py3 import BastionHostIPConfiguration +from ._models_py3 import BastionHostListResult +from ._models_py3 import BastionHostPropertiesFormatNetworkAcls +from ._models_py3 import BastionSessionDeleteResult +from ._models_py3 import BastionSessionState +from ._models_py3 import BastionShareableLink +from ._models_py3 import BastionShareableLinkListRequest +from ._models_py3 import BastionShareableLinkListResult +from ._models_py3 import BastionShareableLinkTokenListRequest +from ._models_py3 import BgpConnection +from ._models_py3 import BgpPeerStatus +from ._models_py3 import BgpPeerStatusListResult +from ._models_py3 import BgpServiceCommunity +from ._models_py3 import BgpServiceCommunityListResult +from ._models_py3 import BgpSettings +from ._models_py3 import BreakOutCategoryPolicies +from ._models_py3 import CheckPrivateLinkServiceVisibilityRequest +from ._models_py3 import ChildResource +from ._models_py3 import CloudErrorBody +from ._models_py3 import ( + Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, +) +from ._models_py3 import ConfigurationGroup +from ._models_py3 import ConnectionMonitor +from ._models_py3 import ConnectionMonitorDestination +from ._models_py3 import ConnectionMonitorEndpoint +from ._models_py3 import ConnectionMonitorEndpointFilter +from ._models_py3 import ConnectionMonitorEndpointFilterItem +from ._models_py3 import ConnectionMonitorEndpointScope +from ._models_py3 import ConnectionMonitorEndpointScopeItem +from ._models_py3 import ConnectionMonitorHttpConfiguration +from ._models_py3 import ConnectionMonitorIcmpConfiguration +from ._models_py3 import ConnectionMonitorListResult +from ._models_py3 import ConnectionMonitorOutput +from ._models_py3 import ConnectionMonitorParameters +from ._models_py3 import ConnectionMonitorQueryResult +from ._models_py3 import ConnectionMonitorResult +from ._models_py3 import ConnectionMonitorResultProperties +from ._models_py3 import ConnectionMonitorSource +from ._models_py3 import ConnectionMonitorSuccessThreshold +from ._models_py3 import ConnectionMonitorTcpConfiguration +from ._models_py3 import ConnectionMonitorTestConfiguration +from ._models_py3 import ConnectionMonitorTestGroup +from ._models_py3 import ConnectionMonitorWorkspaceSettings +from ._models_py3 import ConnectionResetSharedKey +from ._models_py3 import ConnectionSharedKey +from ._models_py3 import ConnectionStateSnapshot +from ._models_py3 import ConnectivityConfiguration +from ._models_py3 import ConnectivityConfigurationListResult +from ._models_py3 import ConnectivityDestination +from ._models_py3 import ConnectivityGroupItem +from ._models_py3 import ConnectivityHop +from ._models_py3 import ConnectivityInformation +from ._models_py3 import ConnectivityIssue +from ._models_py3 import ConnectivityParameters +from ._models_py3 import ConnectivitySource +from ._models_py3 import Container +from ._models_py3 import ContainerNetworkInterface +from ._models_py3 import ContainerNetworkInterfaceConfiguration +from ._models_py3 import ContainerNetworkInterfaceIpConfiguration +from ._models_py3 import Criterion +from ._models_py3 import CrossTenantScopes +from ._models_py3 import CustomDnsConfigPropertiesFormat +from ._models_py3 import CustomIpPrefix +from ._models_py3 import CustomIpPrefixListResult +from ._models_py3 import DdosCustomPolicy +from ._models_py3 import DdosProtectionPlan +from ._models_py3 import DdosProtectionPlanListResult +from ._models_py3 import DdosSettings +from ._models_py3 import DefaultAdminRule +from ._models_py3 import Delegation +from ._models_py3 import DelegationProperties +from ._models_py3 import DeviceProperties +from ._models_py3 import DhcpOptions +from ._models_py3 import Dimension +from ._models_py3 import DnsNameAvailabilityResult +from ._models_py3 import DnsSettings +from ._models_py3 import DscpConfiguration +from ._models_py3 import DscpConfigurationListResult +from ._models_py3 import EffectiveBaseSecurityAdminRule +from ._models_py3 import EffectiveConnectivityConfiguration +from ._models_py3 import EffectiveDefaultSecurityAdminRule +from ._models_py3 import EffectiveNetworkSecurityGroup +from ._models_py3 import EffectiveNetworkSecurityGroupAssociation +from ._models_py3 import EffectiveNetworkSecurityGroupListResult +from ._models_py3 import EffectiveNetworkSecurityRule +from ._models_py3 import EffectiveRoute +from ._models_py3 import EffectiveRouteListResult +from ._models_py3 import EffectiveRouteMapRoute +from ._models_py3 import EffectiveRouteMapRouteList +from ._models_py3 import EffectiveRoutesParameters +from ._models_py3 import EffectiveSecurityAdminRule +from ._models_py3 import EndpointServiceResult +from ._models_py3 import EndpointServicesListResult +from ._models_py3 import Error +from ._models_py3 import ErrorDetails +from ._models_py3 import ErrorResponse +from ._models_py3 import EvaluatedNetworkSecurityGroup +from ._models_py3 import ExclusionManagedRule +from ._models_py3 import ExclusionManagedRuleGroup +from ._models_py3 import ExclusionManagedRuleSet +from ._models_py3 import ExplicitProxy +from ._models_py3 import ExpressRouteCircuit +from ._models_py3 import ExpressRouteCircuitArpTable +from ._models_py3 import ExpressRouteCircuitAuthorization +from ._models_py3 import ExpressRouteCircuitConnection +from ._models_py3 import ExpressRouteCircuitConnectionListResult +from ._models_py3 import ExpressRouteCircuitListResult +from ._models_py3 import ExpressRouteCircuitPeering +from ._models_py3 import ExpressRouteCircuitPeeringConfig +from ._models_py3 import ExpressRouteCircuitPeeringId +from ._models_py3 import ExpressRouteCircuitPeeringListResult +from ._models_py3 import ExpressRouteCircuitReference +from ._models_py3 import ExpressRouteCircuitRoutesTable +from ._models_py3 import ExpressRouteCircuitRoutesTableSummary +from ._models_py3 import ExpressRouteCircuitServiceProviderProperties +from ._models_py3 import ExpressRouteCircuitSku +from ._models_py3 import ExpressRouteCircuitStats +from ._models_py3 import ExpressRouteCircuitsArpTableListResult +from ._models_py3 import ExpressRouteCircuitsRoutesTableListResult +from ._models_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult +from ._models_py3 import ExpressRouteConnection +from ._models_py3 import ExpressRouteConnectionId +from ._models_py3 import ExpressRouteConnectionList +from ._models_py3 import ExpressRouteCrossConnection +from ._models_py3 import ExpressRouteCrossConnectionListResult +from ._models_py3 import ExpressRouteCrossConnectionPeering +from ._models_py3 import ExpressRouteCrossConnectionPeeringList +from ._models_py3 import ExpressRouteCrossConnectionRoutesTableSummary +from ._models_py3 import ExpressRouteCrossConnectionsRoutesTableSummaryListResult +from ._models_py3 import ExpressRouteGateway +from ._models_py3 import ExpressRouteGatewayList +from ._models_py3 import ExpressRouteGatewayPropertiesAutoScaleConfiguration +from ._models_py3 import ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds +from ._models_py3 import ExpressRouteLink +from ._models_py3 import ExpressRouteLinkListResult +from ._models_py3 import ExpressRouteLinkMacSecConfig +from ._models_py3 import ExpressRoutePort +from ._models_py3 import ExpressRoutePortAuthorization +from ._models_py3 import ExpressRoutePortAuthorizationListResult +from ._models_py3 import ExpressRoutePortListResult +from ._models_py3 import ExpressRoutePortsLocation +from ._models_py3 import ExpressRoutePortsLocationBandwidths +from ._models_py3 import ExpressRoutePortsLocationListResult +from ._models_py3 import ExpressRouteProviderPort +from ._models_py3 import ExpressRouteProviderPortListResult +from ._models_py3 import ExpressRouteServiceProvider +from ._models_py3 import ExpressRouteServiceProviderBandwidthsOffered +from ._models_py3 import ExpressRouteServiceProviderListResult +from ._models_py3 import ExtendedLocation +from ._models_py3 import FilterItems +from ._models_py3 import FirewallPacketCaptureParameters +from ._models_py3 import FirewallPolicy +from ._models_py3 import FirewallPolicyCertificateAuthority +from ._models_py3 import FirewallPolicyFilterRuleCollection +from ._models_py3 import FirewallPolicyFilterRuleCollectionAction +from ._models_py3 import FirewallPolicyHttpHeaderToInsert +from ._models_py3 import FirewallPolicyInsights +from ._models_py3 import FirewallPolicyIntrusionDetection +from ._models_py3 import FirewallPolicyIntrusionDetectionBypassTrafficSpecifications +from ._models_py3 import FirewallPolicyIntrusionDetectionConfiguration +from ._models_py3 import FirewallPolicyIntrusionDetectionSignatureSpecification +from ._models_py3 import FirewallPolicyListResult +from ._models_py3 import FirewallPolicyLogAnalyticsResources +from ._models_py3 import FirewallPolicyLogAnalyticsWorkspace +from ._models_py3 import FirewallPolicyNatRuleCollection +from ._models_py3 import FirewallPolicyNatRuleCollectionAction +from ._models_py3 import FirewallPolicyRule +from ._models_py3 import FirewallPolicyRuleApplicationProtocol +from ._models_py3 import FirewallPolicyRuleCollection +from ._models_py3 import FirewallPolicyRuleCollectionGroup +from ._models_py3 import FirewallPolicyRuleCollectionGroupListResult +from ._models_py3 import FirewallPolicySNAT +from ._models_py3 import FirewallPolicySQL +from ._models_py3 import FirewallPolicySku +from ._models_py3 import FirewallPolicyThreatIntelWhitelist +from ._models_py3 import FirewallPolicyTransportSecurity +from ._models_py3 import FlowLog +from ._models_py3 import FlowLogFormatParameters +from ._models_py3 import FlowLogInformation +from ._models_py3 import FlowLogListResult +from ._models_py3 import FlowLogStatusParameters +from ._models_py3 import FrontendIPConfiguration +from ._models_py3 import GatewayCustomBgpIpAddressIpConfiguration +from ._models_py3 import GatewayLoadBalancerTunnelInterface +from ._models_py3 import GatewayRoute +from ._models_py3 import GatewayRouteListResult +from ._models_py3 import GenerateExpressRoutePortsLOARequest +from ._models_py3 import GenerateExpressRoutePortsLOAResult +from ._models_py3 import GetInboundRoutesParameters +from ._models_py3 import GetOutboundRoutesParameters +from ._models_py3 import GetVpnSitesConfigurationRequest +from ._models_py3 import GroupByUserSession +from ._models_py3 import GroupByVariable +from ._models_py3 import HTTPConfiguration +from ._models_py3 import HTTPHeader +from ._models_py3 import HopLink +from ._models_py3 import Hub +from ._models_py3 import HubIPAddresses +from ._models_py3 import HubIpConfiguration +from ._models_py3 import HubPublicIPAddresses +from ._models_py3 import HubRoute +from ._models_py3 import HubRouteTable +from ._models_py3 import HubVirtualNetworkConnection +from ._models_py3 import IDPSQueryObject +from ._models_py3 import IPAddressAvailabilityResult +from ._models_py3 import IPConfiguration +from ._models_py3 import IPConfigurationBgpPeeringAddress +from ._models_py3 import IPConfigurationProfile +from ._models_py3 import IPPrefixesList +from ._models_py3 import IPRule +from ._models_py3 import InboundNatPool +from ._models_py3 import InboundNatRule +from ._models_py3 import InboundNatRuleListResult +from ._models_py3 import InboundNatRulePortMapping +from ._models_py3 import InboundSecurityRule +from ._models_py3 import InboundSecurityRules +from ._models_py3 import InternetIngressPublicIpsProperties +from ._models_py3 import IpAllocation +from ._models_py3 import IpAllocationListResult +from ._models_py3 import IpGroup +from ._models_py3 import IpGroupListResult +from ._models_py3 import IpTag +from ._models_py3 import IpsecPolicy +from ._models_py3 import Ipv6CircuitConnectionConfig +from ._models_py3 import Ipv6ExpressRouteCircuitPeeringConfig +from ._models_py3 import ListHubRouteTablesResult +from ._models_py3 import ListHubVirtualNetworkConnectionsResult +from ._models_py3 import ListP2SVpnGatewaysResult +from ._models_py3 import ListRouteMapsResult +from ._models_py3 import ListRoutingIntentResult +from ._models_py3 import ListVirtualHubBgpConnectionResults +from ._models_py3 import ListVirtualHubIpConfigurationResults +from ._models_py3 import ListVirtualHubRouteTableV2SResult +from ._models_py3 import ListVirtualHubsResult +from ._models_py3 import ListVirtualNetworkGatewayNatRulesResult +from ._models_py3 import ListVirtualWANsResult +from ._models_py3 import ListVpnConnectionsResult +from ._models_py3 import ListVpnGatewayNatRulesResult +from ._models_py3 import ListVpnGatewaysResult +from ._models_py3 import ListVpnServerConfigurationPolicyGroupsResult +from ._models_py3 import ListVpnServerConfigurationsResult +from ._models_py3 import ListVpnSiteLinkConnectionsResult +from ._models_py3 import ListVpnSiteLinksResult +from ._models_py3 import ListVpnSitesResult +from ._models_py3 import LoadBalancer +from ._models_py3 import LoadBalancerBackendAddress +from ._models_py3 import LoadBalancerBackendAddressPoolListResult +from ._models_py3 import LoadBalancerFrontendIPConfigurationListResult +from ._models_py3 import LoadBalancerListResult +from ._models_py3 import LoadBalancerLoadBalancingRuleListResult +from ._models_py3 import LoadBalancerOutboundRuleListResult +from ._models_py3 import LoadBalancerProbeListResult +from ._models_py3 import LoadBalancerSku +from ._models_py3 import LoadBalancerVipSwapRequest +from ._models_py3 import LoadBalancerVipSwapRequestFrontendIPConfiguration +from ._models_py3 import LoadBalancingRule +from ._models_py3 import LocalNetworkGateway +from ._models_py3 import LocalNetworkGatewayListResult +from ._models_py3 import LogSpecification +from ._models_py3 import ManagedRuleGroupOverride +from ._models_py3 import ManagedRuleOverride +from ._models_py3 import ManagedRuleSet +from ._models_py3 import ManagedRulesDefinition +from ._models_py3 import ManagedServiceIdentity +from ._models_py3 import MatchCondition +from ._models_py3 import MatchVariable +from ._models_py3 import MatchedRule +from ._models_py3 import MetricSpecification +from ._models_py3 import MigrateLoadBalancerToIpBasedRequest +from ._models_py3 import MigratedPools +from ._models_py3 import NatGateway +from ._models_py3 import NatGatewayListResult +from ._models_py3 import NatGatewaySku +from ._models_py3 import NatRule +from ._models_py3 import NatRulePortMapping +from ._models_py3 import NetworkConfigurationDiagnosticParameters +from ._models_py3 import NetworkConfigurationDiagnosticProfile +from ._models_py3 import NetworkConfigurationDiagnosticResponse +from ._models_py3 import NetworkConfigurationDiagnosticResult +from ._models_py3 import NetworkGroup +from ._models_py3 import NetworkGroupListResult +from ._models_py3 import NetworkIntentPolicy +from ._models_py3 import NetworkIntentPolicyConfiguration +from ._models_py3 import NetworkInterface +from ._models_py3 import NetworkInterfaceAssociation +from ._models_py3 import NetworkInterfaceDnsSettings +from ._models_py3 import NetworkInterfaceIPConfiguration +from ._models_py3 import NetworkInterfaceIPConfigurationListResult +from ._models_py3 import NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties +from ._models_py3 import NetworkInterfaceListResult +from ._models_py3 import NetworkInterfaceLoadBalancerListResult +from ._models_py3 import NetworkInterfaceTapConfiguration +from ._models_py3 import NetworkInterfaceTapConfigurationListResult +from ._models_py3 import NetworkManager +from ._models_py3 import NetworkManagerCommit +from ._models_py3 import NetworkManagerConnection +from ._models_py3 import NetworkManagerConnectionListResult +from ._models_py3 import NetworkManagerDeploymentStatus +from ._models_py3 import NetworkManagerDeploymentStatusListResult +from ._models_py3 import NetworkManagerDeploymentStatusParameter +from ._models_py3 import NetworkManagerEffectiveConnectivityConfigurationListResult +from ._models_py3 import NetworkManagerEffectiveSecurityAdminRulesListResult +from ._models_py3 import NetworkManagerListResult +from ._models_py3 import NetworkManagerPropertiesNetworkManagerScopes +from ._models_py3 import NetworkManagerSecurityGroupItem +from ._models_py3 import NetworkProfile +from ._models_py3 import NetworkProfileListResult +from ._models_py3 import NetworkRule +from ._models_py3 import NetworkSecurityGroup +from ._models_py3 import NetworkSecurityGroupListResult +from ._models_py3 import NetworkSecurityGroupResult +from ._models_py3 import NetworkSecurityRulesEvaluationResult +from ._models_py3 import NetworkVirtualAppliance +from ._models_py3 import NetworkVirtualApplianceConnection +from ._models_py3 import NetworkVirtualApplianceConnectionList +from ._models_py3 import NetworkVirtualApplianceListResult +from ._models_py3 import NetworkVirtualApplianceSiteListResult +from ._models_py3 import NetworkVirtualApplianceSku +from ._models_py3 import NetworkVirtualApplianceSkuInstances +from ._models_py3 import NetworkVirtualApplianceSkuListResult +from ._models_py3 import NetworkWatcher +from ._models_py3 import NetworkWatcherListResult +from ._models_py3 import NextHopParameters +from ._models_py3 import NextHopResult +from ._models_py3 import O365BreakOutCategoryPolicies +from ._models_py3 import O365PolicyProperties +from ._models_py3 import Office365PolicyProperties +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import OperationPropertiesFormatServiceSpecification +from ._models_py3 import OrderBy +from ._models_py3 import OutboundRule +from ._models_py3 import OwaspCrsExclusionEntry +from ._models_py3 import P2SConnectionConfiguration +from ._models_py3 import P2SVpnConnectionHealth +from ._models_py3 import P2SVpnConnectionHealthRequest +from ._models_py3 import P2SVpnConnectionRequest +from ._models_py3 import P2SVpnGateway +from ._models_py3 import P2SVpnProfileParameters +from ._models_py3 import PacketCapture +from ._models_py3 import PacketCaptureFilter +from ._models_py3 import PacketCaptureListResult +from ._models_py3 import PacketCaptureMachineScope +from ._models_py3 import PacketCaptureParameters +from ._models_py3 import PacketCaptureQueryStatusResult +from ._models_py3 import PacketCaptureResult +from ._models_py3 import PacketCaptureResultProperties +from ._models_py3 import PacketCaptureStorageLocation +from ._models_py3 import Parameter +from ._models_py3 import PartnerManagedResourceProperties +from ._models_py3 import PatchObject +from ._models_py3 import PatchRouteFilter +from ._models_py3 import PatchRouteFilterRule +from ._models_py3 import PeerExpressRouteCircuitConnection +from ._models_py3 import PeerExpressRouteCircuitConnectionListResult +from ._models_py3 import PeerRoute +from ._models_py3 import PolicySettings +from ._models_py3 import PolicySettingsLogScrubbing +from ._models_py3 import PrepareNetworkPoliciesRequest +from ._models_py3 import PrivateDnsZoneConfig +from ._models_py3 import PrivateDnsZoneGroup +from ._models_py3 import PrivateDnsZoneGroupListResult +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateEndpointIPConfiguration +from ._models_py3 import PrivateEndpointListResult +from ._models_py3 import PrivateLinkService +from ._models_py3 import PrivateLinkServiceConnection +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import PrivateLinkServiceIpConfiguration +from ._models_py3 import PrivateLinkServiceListResult +from ._models_py3 import PrivateLinkServicePropertiesAutoApproval +from ._models_py3 import PrivateLinkServicePropertiesVisibility +from ._models_py3 import PrivateLinkServiceVisibility +from ._models_py3 import Probe +from ._models_py3 import PropagatedRouteTable +from ._models_py3 import ProtocolConfiguration +from ._models_py3 import PublicIPAddress +from ._models_py3 import PublicIPAddressDnsSettings +from ._models_py3 import PublicIPAddressListResult +from ._models_py3 import PublicIPAddressSku +from ._models_py3 import PublicIPPrefix +from ._models_py3 import PublicIPPrefixListResult +from ._models_py3 import PublicIPPrefixSku +from ._models_py3 import PublicIpDdosProtectionStatusResult +from ._models_py3 import QosDefinition +from ._models_py3 import QosIpRange +from ._models_py3 import QosPortRange +from ._models_py3 import QueryInboundNatRulePortMappingRequest +from ._models_py3 import QueryRequestOptions +from ._models_py3 import QueryResults +from ._models_py3 import QueryTroubleshootingParameters +from ._models_py3 import RadiusServer +from ._models_py3 import RecordSet +from ._models_py3 import ReferencedPublicIpAddress +from ._models_py3 import Resource +from ._models_py3 import ResourceNavigationLink +from ._models_py3 import ResourceNavigationLinksListResult +from ._models_py3 import ResourceSet +from ._models_py3 import RetentionPolicyParameters +from ._models_py3 import Route +from ._models_py3 import RouteFilter +from ._models_py3 import RouteFilterListResult +from ._models_py3 import RouteFilterRule +from ._models_py3 import RouteFilterRuleListResult +from ._models_py3 import RouteListResult +from ._models_py3 import RouteMap +from ._models_py3 import RouteMapRule +from ._models_py3 import RouteTable +from ._models_py3 import RouteTableListResult +from ._models_py3 import RoutingConfiguration +from ._models_py3 import RoutingIntent +from ._models_py3 import RoutingPolicy +from ._models_py3 import ScopeConnection +from ._models_py3 import ScopeConnectionListResult +from ._models_py3 import SecurityAdminConfiguration +from ._models_py3 import SecurityAdminConfigurationListResult +from ._models_py3 import SecurityGroupNetworkInterface +from ._models_py3 import SecurityGroupViewParameters +from ._models_py3 import SecurityGroupViewResult +from ._models_py3 import SecurityPartnerProvider +from ._models_py3 import SecurityPartnerProviderListResult +from ._models_py3 import SecurityRule +from ._models_py3 import SecurityRuleAssociations +from ._models_py3 import SecurityRuleListResult +from ._models_py3 import ServiceAssociationLink +from ._models_py3 import ServiceAssociationLinksListResult +from ._models_py3 import ServiceEndpointPolicy +from ._models_py3 import ServiceEndpointPolicyDefinition +from ._models_py3 import ServiceEndpointPolicyDefinitionListResult +from ._models_py3 import ServiceEndpointPolicyListResult +from ._models_py3 import ServiceEndpointPropertiesFormat +from ._models_py3 import ServiceTagInformation +from ._models_py3 import ServiceTagInformationListResult +from ._models_py3 import ServiceTagInformationPropertiesFormat +from ._models_py3 import ServiceTagsListResult +from ._models_py3 import SessionIds +from ._models_py3 import SignatureOverridesFilterValuesQuery +from ._models_py3 import SignatureOverridesFilterValuesResponse +from ._models_py3 import SignaturesOverrides +from ._models_py3 import SignaturesOverridesList +from ._models_py3 import SignaturesOverridesProperties +from ._models_py3 import SingleQueryResult +from ._models_py3 import Sku +from ._models_py3 import StaticMember +from ._models_py3 import StaticMemberListResult +from ._models_py3 import StaticRoute +from ._models_py3 import StaticRoutesConfig +from ._models_py3 import SubResource +from ._models_py3 import Subnet +from ._models_py3 import SubnetAssociation +from ._models_py3 import SubnetListResult +from ._models_py3 import SwapResource +from ._models_py3 import SwapResourceListResult +from ._models_py3 import SwapResourceProperties +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import Topology +from ._models_py3 import TopologyAssociation +from ._models_py3 import TopologyParameters +from ._models_py3 import TopologyResource +from ._models_py3 import TrafficAnalyticsConfigurationProperties +from ._models_py3 import TrafficAnalyticsProperties +from ._models_py3 import TrafficSelectorPolicy +from ._models_py3 import TroubleshootingDetails +from ._models_py3 import TroubleshootingParameters +from ._models_py3 import TroubleshootingRecommendedActions +from ._models_py3 import TroubleshootingResult +from ._models_py3 import TunnelConnectionHealth +from ._models_py3 import UnprepareNetworkPoliciesRequest +from ._models_py3 import Usage +from ._models_py3 import UsageName +from ._models_py3 import UsagesListResult +from ._models_py3 import VM +from ._models_py3 import VerificationIPFlowParameters +from ._models_py3 import VerificationIPFlowResult +from ._models_py3 import VirtualApplianceAdditionalNicProperties +from ._models_py3 import VirtualApplianceNicProperties +from ._models_py3 import VirtualApplianceSite +from ._models_py3 import VirtualApplianceSkuProperties +from ._models_py3 import VirtualHub +from ._models_py3 import VirtualHubEffectiveRoute +from ._models_py3 import VirtualHubEffectiveRouteList +from ._models_py3 import VirtualHubId +from ._models_py3 import VirtualHubRoute +from ._models_py3 import VirtualHubRouteTable +from ._models_py3 import VirtualHubRouteTableV2 +from ._models_py3 import VirtualHubRouteV2 +from ._models_py3 import VirtualNetwork +from ._models_py3 import VirtualNetworkBgpCommunities +from ._models_py3 import VirtualNetworkConnectionGatewayReference +from ._models_py3 import VirtualNetworkDdosProtectionStatusResult +from ._models_py3 import VirtualNetworkEncryption +from ._models_py3 import VirtualNetworkGateway +from ._models_py3 import VirtualNetworkGatewayAutoScaleBounds +from ._models_py3 import VirtualNetworkGatewayAutoScaleConfiguration +from ._models_py3 import VirtualNetworkGatewayConnection +from ._models_py3 import VirtualNetworkGatewayConnectionListEntity +from ._models_py3 import VirtualNetworkGatewayConnectionListResult +from ._models_py3 import VirtualNetworkGatewayIPConfiguration +from ._models_py3 import VirtualNetworkGatewayListConnectionsResult +from ._models_py3 import VirtualNetworkGatewayListResult +from ._models_py3 import VirtualNetworkGatewayNatRule +from ._models_py3 import VirtualNetworkGatewayPolicyGroup +from ._models_py3 import VirtualNetworkGatewayPolicyGroupMember +from ._models_py3 import VirtualNetworkGatewaySku +from ._models_py3 import VirtualNetworkListResult +from ._models_py3 import VirtualNetworkListUsageResult +from ._models_py3 import VirtualNetworkPeering +from ._models_py3 import VirtualNetworkPeeringListResult +from ._models_py3 import VirtualNetworkTap +from ._models_py3 import VirtualNetworkTapListResult +from ._models_py3 import VirtualNetworkUsage +from ._models_py3 import VirtualNetworkUsageName +from ._models_py3 import VirtualRouter +from ._models_py3 import VirtualRouterAutoScaleConfiguration +from ._models_py3 import VirtualRouterListResult +from ._models_py3 import VirtualRouterPeering +from ._models_py3 import VirtualRouterPeeringListResult +from ._models_py3 import VirtualWAN +from ._models_py3 import VirtualWanSecurityProvider +from ._models_py3 import VirtualWanSecurityProviders +from ._models_py3 import VirtualWanVpnProfileParameters +from ._models_py3 import VnetRoute +from ._models_py3 import VngClientConnectionConfiguration +from ._models_py3 import VpnClientConfiguration +from ._models_py3 import VpnClientConnectionHealth +from ._models_py3 import VpnClientConnectionHealthDetail +from ._models_py3 import VpnClientConnectionHealthDetailListResult +from ._models_py3 import VpnClientIPsecParameters +from ._models_py3 import VpnClientParameters +from ._models_py3 import VpnClientRevokedCertificate +from ._models_py3 import VpnClientRootCertificate +from ._models_py3 import VpnConnection +from ._models_py3 import VpnConnectionPacketCaptureStartParameters +from ._models_py3 import VpnConnectionPacketCaptureStopParameters +from ._models_py3 import VpnDeviceScriptParameters +from ._models_py3 import VpnGateway +from ._models_py3 import VpnGatewayIpConfiguration +from ._models_py3 import VpnGatewayNatRule +from ._models_py3 import VpnGatewayPacketCaptureStartParameters +from ._models_py3 import VpnGatewayPacketCaptureStopParameters +from ._models_py3 import VpnLinkBgpSettings +from ._models_py3 import VpnLinkProviderProperties +from ._models_py3 import VpnNatRuleMapping +from ._models_py3 import VpnPacketCaptureStartParameters +from ._models_py3 import VpnPacketCaptureStopParameters +from ._models_py3 import VpnProfileResponse +from ._models_py3 import VpnServerConfigRadiusClientRootCertificate +from ._models_py3 import VpnServerConfigRadiusServerRootCertificate +from ._models_py3 import VpnServerConfigVpnClientRevokedCertificate +from ._models_py3 import VpnServerConfigVpnClientRootCertificate +from ._models_py3 import VpnServerConfiguration +from ._models_py3 import VpnServerConfigurationPolicyGroup +from ._models_py3 import VpnServerConfigurationPolicyGroupMember +from ._models_py3 import VpnServerConfigurationsResponse +from ._models_py3 import VpnSite +from ._models_py3 import VpnSiteId +from ._models_py3 import VpnSiteLink +from ._models_py3 import VpnSiteLinkConnection +from ._models_py3 import WebApplicationFirewallCustomRule +from ._models_py3 import WebApplicationFirewallPolicy +from ._models_py3 import WebApplicationFirewallPolicyListResult +from ._models_py3 import WebApplicationFirewallScrubbingRules + +from ._network_management_client_enums import Access +from ._network_management_client_enums import ActionType +from ._network_management_client_enums import AddressPrefixType +from ._network_management_client_enums import AdminRuleKind +from ._network_management_client_enums import AdminState +from ._network_management_client_enums import ApplicationGatewayBackendHealthServerHealth +from ._network_management_client_enums import ApplicationGatewayClientRevocationOptions +from ._network_management_client_enums import ApplicationGatewayCookieBasedAffinity +from ._network_management_client_enums import ApplicationGatewayCustomErrorStatusCode +from ._network_management_client_enums import ApplicationGatewayFirewallMode +from ._network_management_client_enums import ApplicationGatewayFirewallRateLimitDuration +from ._network_management_client_enums import ApplicationGatewayFirewallUserSessionVariable +from ._network_management_client_enums import ApplicationGatewayLoadDistributionAlgorithm +from ._network_management_client_enums import ApplicationGatewayOperationalState +from ._network_management_client_enums import ApplicationGatewayProtocol +from ._network_management_client_enums import ApplicationGatewayRedirectType +from ._network_management_client_enums import ApplicationGatewayRequestRoutingRuleType +from ._network_management_client_enums import ApplicationGatewayRuleSetStatusOptions +from ._network_management_client_enums import ApplicationGatewaySkuName +from ._network_management_client_enums import ApplicationGatewaySslCipherSuite +from ._network_management_client_enums import ApplicationGatewaySslPolicyName +from ._network_management_client_enums import ApplicationGatewaySslPolicyType +from ._network_management_client_enums import ApplicationGatewaySslProtocol +from ._network_management_client_enums import ApplicationGatewayTier +from ._network_management_client_enums import ApplicationGatewayTierTypes +from ._network_management_client_enums import ApplicationGatewayWafRuleActionTypes +from ._network_management_client_enums import ApplicationGatewayWafRuleStateTypes +from ._network_management_client_enums import AssociationType +from ._network_management_client_enums import AuthenticationMethod +from ._network_management_client_enums import AuthorizationUseStatus +from ._network_management_client_enums import AutoLearnPrivateRangesMode +from ._network_management_client_enums import AzureFirewallApplicationRuleProtocolType +from ._network_management_client_enums import AzureFirewallNatRCActionType +from ._network_management_client_enums import AzureFirewallNetworkRuleProtocol +from ._network_management_client_enums import AzureFirewallPacketCaptureFlagsType +from ._network_management_client_enums import AzureFirewallRCActionType +from ._network_management_client_enums import AzureFirewallSkuName +from ._network_management_client_enums import AzureFirewallSkuTier +from ._network_management_client_enums import AzureFirewallThreatIntelMode +from ._network_management_client_enums import BastionConnectProtocol +from ._network_management_client_enums import BastionHostSkuName +from ._network_management_client_enums import BgpPeerState +from ._network_management_client_enums import CircuitConnectionStatus +from ._network_management_client_enums import CommissionedState +from ._network_management_client_enums import ConfigurationType +from ._network_management_client_enums import ConnectionMonitorEndpointFilterItemType +from ._network_management_client_enums import ConnectionMonitorEndpointFilterType +from ._network_management_client_enums import ConnectionMonitorSourceStatus +from ._network_management_client_enums import ConnectionMonitorTestConfigurationProtocol +from ._network_management_client_enums import ConnectionMonitorType +from ._network_management_client_enums import ConnectionState +from ._network_management_client_enums import ConnectionStatus +from ._network_management_client_enums import ConnectivityTopology +from ._network_management_client_enums import CoverageLevel +from ._network_management_client_enums import CreatedByType +from ._network_management_client_enums import CustomIpPrefixType +from ._network_management_client_enums import DdosSettingsProtectionMode +from ._network_management_client_enums import DeleteExistingPeering +from ._network_management_client_enums import DeleteOptions +from ._network_management_client_enums import DeploymentStatus +from ._network_management_client_enums import DestinationPortBehavior +from ._network_management_client_enums import DhGroup +from ._network_management_client_enums import Direction +from ._network_management_client_enums import EffectiveAdminRuleKind +from ._network_management_client_enums import EffectiveRouteSource +from ._network_management_client_enums import EffectiveRouteState +from ._network_management_client_enums import EffectiveSecurityRuleProtocol +from ._network_management_client_enums import EndpointType +from ._network_management_client_enums import EvaluationState +from ._network_management_client_enums import ExpressRouteCircuitPeeringAdvertisedPublicPrefixState +from ._network_management_client_enums import ExpressRouteCircuitPeeringState +from ._network_management_client_enums import ExpressRouteCircuitSkuFamily +from ._network_management_client_enums import ExpressRouteCircuitSkuTier +from ._network_management_client_enums import ExpressRouteLinkAdminState +from ._network_management_client_enums import ExpressRouteLinkConnectorType +from ._network_management_client_enums import ExpressRouteLinkMacSecCipher +from ._network_management_client_enums import ExpressRouteLinkMacSecSciState +from ._network_management_client_enums import ExpressRoutePeeringState +from ._network_management_client_enums import ExpressRoutePeeringType +from ._network_management_client_enums import ExpressRoutePortAuthorizationUseStatus +from ._network_management_client_enums import ExpressRoutePortsBillingType +from ._network_management_client_enums import ExpressRoutePortsEncapsulation +from ._network_management_client_enums import ExtendedLocationTypes +from ._network_management_client_enums import FirewallPolicyFilterRuleCollectionActionType +from ._network_management_client_enums import FirewallPolicyIDPSQuerySortOrder +from ._network_management_client_enums import FirewallPolicyIDPSSignatureDirection +from ._network_management_client_enums import FirewallPolicyIDPSSignatureMode +from ._network_management_client_enums import FirewallPolicyIDPSSignatureSeverity +from ._network_management_client_enums import FirewallPolicyIntrusionDetectionProfileType +from ._network_management_client_enums import FirewallPolicyIntrusionDetectionProtocol +from ._network_management_client_enums import FirewallPolicyIntrusionDetectionStateType +from ._network_management_client_enums import FirewallPolicyNatRuleCollectionActionType +from ._network_management_client_enums import FirewallPolicyRuleApplicationProtocolType +from ._network_management_client_enums import FirewallPolicyRuleCollectionType +from ._network_management_client_enums import FirewallPolicyRuleNetworkProtocol +from ._network_management_client_enums import FirewallPolicyRuleType +from ._network_management_client_enums import FirewallPolicySkuTier +from ._network_management_client_enums import FlowLogFormatType +from ._network_management_client_enums import GatewayLoadBalancerTunnelInterfaceType +from ._network_management_client_enums import GatewayLoadBalancerTunnelProtocol +from ._network_management_client_enums import Geo +from ._network_management_client_enums import GroupConnectivity +from ._network_management_client_enums import HTTPConfigurationMethod +from ._network_management_client_enums import HTTPMethod +from ._network_management_client_enums import HubBgpConnectionStatus +from ._network_management_client_enums import HubRoutingPreference +from ._network_management_client_enums import HubVirtualNetworkConnectionStatus +from ._network_management_client_enums import IPAllocationMethod +from ._network_management_client_enums import IPVersion +from ._network_management_client_enums import IkeEncryption +from ._network_management_client_enums import IkeIntegrity +from ._network_management_client_enums import InboundSecurityRulesProtocol +from ._network_management_client_enums import IpAllocationType +from ._network_management_client_enums import IpFlowProtocol +from ._network_management_client_enums import IpsecEncryption +from ._network_management_client_enums import IpsecIntegrity +from ._network_management_client_enums import IsGlobal +from ._network_management_client_enums import IsWorkloadProtected +from ._network_management_client_enums import IssueType +from ._network_management_client_enums import LoadBalancerBackendAddressAdminState +from ._network_management_client_enums import LoadBalancerOutboundRuleProtocol +from ._network_management_client_enums import LoadBalancerSkuName +from ._network_management_client_enums import LoadBalancerSkuTier +from ._network_management_client_enums import LoadDistribution +from ._network_management_client_enums import ManagedRuleEnabledState +from ._network_management_client_enums import NatGatewaySkuName +from ._network_management_client_enums import NetworkIntentPolicyBasedService +from ._network_management_client_enums import NetworkInterfaceAuxiliaryMode +from ._network_management_client_enums import NetworkInterfaceAuxiliarySku +from ._network_management_client_enums import NetworkInterfaceMigrationPhase +from ._network_management_client_enums import NetworkInterfaceNicType +from ._network_management_client_enums import NetworkOperationStatus +from ._network_management_client_enums import NextHopType +from ._network_management_client_enums import NextStep +from ._network_management_client_enums import OfficeTrafficCategory +from ._network_management_client_enums import Origin +from ._network_management_client_enums import OutputType +from ._network_management_client_enums import OwaspCrsExclusionEntryMatchVariable +from ._network_management_client_enums import OwaspCrsExclusionEntrySelectorMatchOperator +from ._network_management_client_enums import PacketCaptureTargetType +from ._network_management_client_enums import PcError +from ._network_management_client_enums import PcProtocol +from ._network_management_client_enums import PcStatus +from ._network_management_client_enums import PfsGroup +from ._network_management_client_enums import PreferredIPVersion +from ._network_management_client_enums import PreferredRoutingGateway +from ._network_management_client_enums import ProbeProtocol +from ._network_management_client_enums import ProcessorArchitecture +from ._network_management_client_enums import Protocol +from ._network_management_client_enums import ProtocolType +from ._network_management_client_enums import ProvisioningState +from ._network_management_client_enums import PublicIPAddressMigrationPhase +from ._network_management_client_enums import PublicIPAddressSkuName +from ._network_management_client_enums import PublicIPAddressSkuTier +from ._network_management_client_enums import PublicIPPrefixSkuName +from ._network_management_client_enums import PublicIPPrefixSkuTier +from ._network_management_client_enums import PublicIpAddressDnsSettingsDomainNameLabelScope +from ._network_management_client_enums import ResourceIdentityType +from ._network_management_client_enums import RouteFilterRuleType +from ._network_management_client_enums import RouteMapActionType +from ._network_management_client_enums import RouteMapMatchCondition +from ._network_management_client_enums import RouteNextHopType +from ._network_management_client_enums import RoutingState +from ._network_management_client_enums import ScopeConnectionState +from ._network_management_client_enums import ScrubbingRuleEntryMatchOperator +from ._network_management_client_enums import ScrubbingRuleEntryMatchVariable +from ._network_management_client_enums import ScrubbingRuleEntryState +from ._network_management_client_enums import SecurityConfigurationRuleAccess +from ._network_management_client_enums import SecurityConfigurationRuleDirection +from ._network_management_client_enums import SecurityConfigurationRuleProtocol +from ._network_management_client_enums import SecurityPartnerProviderConnectionStatus +from ._network_management_client_enums import SecurityProviderName +from ._network_management_client_enums import SecurityRuleAccess +from ._network_management_client_enums import SecurityRuleDirection +from ._network_management_client_enums import SecurityRuleProtocol +from ._network_management_client_enums import ServiceProviderProvisioningState +from ._network_management_client_enums import Severity +from ._network_management_client_enums import SlotType +from ._network_management_client_enums import SyncMode +from ._network_management_client_enums import SyncRemoteAddressSpace +from ._network_management_client_enums import TransportProtocol +from ._network_management_client_enums import TunnelConnectionStatus +from ._network_management_client_enums import UsageUnit +from ._network_management_client_enums import UseHubGateway +from ._network_management_client_enums import VerbosityLevel +from ._network_management_client_enums import VirtualNetworkEncryptionEnforcement +from ._network_management_client_enums import VirtualNetworkGatewayConnectionMode +from ._network_management_client_enums import VirtualNetworkGatewayConnectionProtocol +from ._network_management_client_enums import VirtualNetworkGatewayConnectionStatus +from ._network_management_client_enums import VirtualNetworkGatewayConnectionType +from ._network_management_client_enums import VirtualNetworkGatewaySkuName +from ._network_management_client_enums import VirtualNetworkGatewaySkuTier +from ._network_management_client_enums import VirtualNetworkGatewayType +from ._network_management_client_enums import VirtualNetworkPeeringLevel +from ._network_management_client_enums import VirtualNetworkPeeringState +from ._network_management_client_enums import VirtualNetworkPrivateEndpointNetworkPolicies +from ._network_management_client_enums import VirtualNetworkPrivateLinkServiceNetworkPolicies +from ._network_management_client_enums import VirtualWanSecurityProviderType +from ._network_management_client_enums import VnetLocalRouteOverrideCriteria +from ._network_management_client_enums import VpnAuthenticationType +from ._network_management_client_enums import VpnClientProtocol +from ._network_management_client_enums import VpnConnectionStatus +from ._network_management_client_enums import VpnGatewayGeneration +from ._network_management_client_enums import VpnGatewayTunnelingProtocol +from ._network_management_client_enums import VpnLinkConnectionMode +from ._network_management_client_enums import VpnNatRuleMode +from ._network_management_client_enums import VpnNatRuleType +from ._network_management_client_enums import VpnPolicyMemberAttributeType +from ._network_management_client_enums import VpnType +from ._network_management_client_enums import WebApplicationFirewallAction +from ._network_management_client_enums import WebApplicationFirewallEnabledState +from ._network_management_client_enums import WebApplicationFirewallMatchVariable +from ._network_management_client_enums import WebApplicationFirewallMode +from ._network_management_client_enums import WebApplicationFirewallOperator +from ._network_management_client_enums import WebApplicationFirewallPolicyResourceState +from ._network_management_client_enums import WebApplicationFirewallRuleType +from ._network_management_client_enums import WebApplicationFirewallScrubbingState +from ._network_management_client_enums import WebApplicationFirewallState +from ._network_management_client_enums import WebApplicationFirewallTransform +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AadAuthenticationParameters", + "Action", + "ActiveBaseSecurityAdminRule", + "ActiveConfigurationParameter", + "ActiveConnectivityConfiguration", + "ActiveConnectivityConfigurationsListResult", + "ActiveDefaultSecurityAdminRule", + "ActiveSecurityAdminRule", + "ActiveSecurityAdminRulesListResult", + "AddressPrefixItem", + "AddressSpace", + "AdminRule", + "AdminRuleCollection", + "AdminRuleCollectionListResult", + "AdminRuleListResult", + "ApplicationGateway", + "ApplicationGatewayAuthenticationCertificate", + "ApplicationGatewayAutoscaleConfiguration", + "ApplicationGatewayAvailableSslOptions", + "ApplicationGatewayAvailableSslPredefinedPolicies", + "ApplicationGatewayAvailableWafRuleSetsResult", + "ApplicationGatewayBackendAddress", + "ApplicationGatewayBackendAddressPool", + "ApplicationGatewayBackendHealth", + "ApplicationGatewayBackendHealthHttpSettings", + "ApplicationGatewayBackendHealthOnDemand", + "ApplicationGatewayBackendHealthPool", + "ApplicationGatewayBackendHealthServer", + "ApplicationGatewayBackendHttpSettings", + "ApplicationGatewayBackendSettings", + "ApplicationGatewayClientAuthConfiguration", + "ApplicationGatewayConnectionDraining", + "ApplicationGatewayCustomError", + "ApplicationGatewayFirewallDisabledRuleGroup", + "ApplicationGatewayFirewallExclusion", + "ApplicationGatewayFirewallManifestRuleSet", + "ApplicationGatewayFirewallRule", + "ApplicationGatewayFirewallRuleGroup", + "ApplicationGatewayFirewallRuleSet", + "ApplicationGatewayFrontendIPConfiguration", + "ApplicationGatewayFrontendPort", + "ApplicationGatewayGlobalConfiguration", + "ApplicationGatewayHeaderConfiguration", + "ApplicationGatewayHttpListener", + "ApplicationGatewayIPConfiguration", + "ApplicationGatewayListResult", + "ApplicationGatewayListener", + "ApplicationGatewayLoadDistributionPolicy", + "ApplicationGatewayLoadDistributionTarget", + "ApplicationGatewayOnDemandProbe", + "ApplicationGatewayPathRule", + "ApplicationGatewayPrivateEndpointConnection", + "ApplicationGatewayPrivateEndpointConnectionListResult", + "ApplicationGatewayPrivateLinkConfiguration", + "ApplicationGatewayPrivateLinkIpConfiguration", + "ApplicationGatewayPrivateLinkResource", + "ApplicationGatewayPrivateLinkResourceListResult", + "ApplicationGatewayProbe", + "ApplicationGatewayProbeHealthResponseMatch", + "ApplicationGatewayRedirectConfiguration", + "ApplicationGatewayRequestRoutingRule", + "ApplicationGatewayRewriteRule", + "ApplicationGatewayRewriteRuleActionSet", + "ApplicationGatewayRewriteRuleCondition", + "ApplicationGatewayRewriteRuleSet", + "ApplicationGatewayRoutingRule", + "ApplicationGatewaySku", + "ApplicationGatewaySslCertificate", + "ApplicationGatewaySslPolicy", + "ApplicationGatewaySslPredefinedPolicy", + "ApplicationGatewaySslProfile", + "ApplicationGatewayTrustedClientCertificate", + "ApplicationGatewayTrustedRootCertificate", + "ApplicationGatewayUrlConfiguration", + "ApplicationGatewayUrlPathMap", + "ApplicationGatewayWafDynamicManifestResult", + "ApplicationGatewayWafDynamicManifestResultList", + "ApplicationGatewayWebApplicationFirewallConfiguration", + "ApplicationRule", + "ApplicationSecurityGroup", + "ApplicationSecurityGroupListResult", + "AuthorizationListResult", + "AutoApprovedPrivateLinkService", + "AutoApprovedPrivateLinkServicesResult", + "Availability", + "AvailableDelegation", + "AvailableDelegationsResult", + "AvailablePrivateEndpointType", + "AvailablePrivateEndpointTypesResult", + "AvailableProvidersList", + "AvailableProvidersListCity", + "AvailableProvidersListCountry", + "AvailableProvidersListParameters", + "AvailableProvidersListState", + "AvailableServiceAlias", + "AvailableServiceAliasesResult", + "AzureAsyncOperationResult", + "AzureFirewall", + "AzureFirewallApplicationRule", + "AzureFirewallApplicationRuleCollection", + "AzureFirewallApplicationRuleProtocol", + "AzureFirewallFqdnTag", + "AzureFirewallFqdnTagListResult", + "AzureFirewallIPConfiguration", + "AzureFirewallIpGroups", + "AzureFirewallListResult", + "AzureFirewallNatRCAction", + "AzureFirewallNatRule", + "AzureFirewallNatRuleCollection", + "AzureFirewallNetworkRule", + "AzureFirewallNetworkRuleCollection", + "AzureFirewallPacketCaptureFlags", + "AzureFirewallPacketCaptureRule", + "AzureFirewallPublicIPAddress", + "AzureFirewallRCAction", + "AzureFirewallSku", + "AzureReachabilityReport", + "AzureReachabilityReportItem", + "AzureReachabilityReportLatencyInfo", + "AzureReachabilityReportLocation", + "AzureReachabilityReportParameters", + "AzureWebCategory", + "AzureWebCategoryListResult", + "BGPCommunity", + "BackendAddressInboundNatRulePortMappings", + "BackendAddressPool", + "BaseAdminRule", + "BastionActiveSession", + "BastionActiveSessionListResult", + "BastionHost", + "BastionHostIPConfiguration", + "BastionHostListResult", + "BastionHostPropertiesFormatNetworkAcls", + "BastionSessionDeleteResult", + "BastionSessionState", + "BastionShareableLink", + "BastionShareableLinkListRequest", + "BastionShareableLinkListResult", + "BastionShareableLinkTokenListRequest", + "BgpConnection", + "BgpPeerStatus", + "BgpPeerStatusListResult", + "BgpServiceCommunity", + "BgpServiceCommunityListResult", + "BgpSettings", + "BreakOutCategoryPolicies", + "CheckPrivateLinkServiceVisibilityRequest", + "ChildResource", + "CloudErrorBody", + "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", + "ConfigurationGroup", + "ConnectionMonitor", + "ConnectionMonitorDestination", + "ConnectionMonitorEndpoint", + "ConnectionMonitorEndpointFilter", + "ConnectionMonitorEndpointFilterItem", + "ConnectionMonitorEndpointScope", + "ConnectionMonitorEndpointScopeItem", + "ConnectionMonitorHttpConfiguration", + "ConnectionMonitorIcmpConfiguration", + "ConnectionMonitorListResult", + "ConnectionMonitorOutput", + "ConnectionMonitorParameters", + "ConnectionMonitorQueryResult", + "ConnectionMonitorResult", + "ConnectionMonitorResultProperties", + "ConnectionMonitorSource", + "ConnectionMonitorSuccessThreshold", + "ConnectionMonitorTcpConfiguration", + "ConnectionMonitorTestConfiguration", + "ConnectionMonitorTestGroup", + "ConnectionMonitorWorkspaceSettings", + "ConnectionResetSharedKey", + "ConnectionSharedKey", + "ConnectionStateSnapshot", + "ConnectivityConfiguration", + "ConnectivityConfigurationListResult", + "ConnectivityDestination", + "ConnectivityGroupItem", + "ConnectivityHop", + "ConnectivityInformation", + "ConnectivityIssue", + "ConnectivityParameters", + "ConnectivitySource", + "Container", + "ContainerNetworkInterface", + "ContainerNetworkInterfaceConfiguration", + "ContainerNetworkInterfaceIpConfiguration", + "Criterion", + "CrossTenantScopes", + "CustomDnsConfigPropertiesFormat", + "CustomIpPrefix", + "CustomIpPrefixListResult", + "DdosCustomPolicy", + "DdosProtectionPlan", + "DdosProtectionPlanListResult", + "DdosSettings", + "DefaultAdminRule", + "Delegation", + "DelegationProperties", + "DeviceProperties", + "DhcpOptions", + "Dimension", + "DnsNameAvailabilityResult", + "DnsSettings", + "DscpConfiguration", + "DscpConfigurationListResult", + "EffectiveBaseSecurityAdminRule", + "EffectiveConnectivityConfiguration", + "EffectiveDefaultSecurityAdminRule", + "EffectiveNetworkSecurityGroup", + "EffectiveNetworkSecurityGroupAssociation", + "EffectiveNetworkSecurityGroupListResult", + "EffectiveNetworkSecurityRule", + "EffectiveRoute", + "EffectiveRouteListResult", + "EffectiveRouteMapRoute", + "EffectiveRouteMapRouteList", + "EffectiveRoutesParameters", + "EffectiveSecurityAdminRule", + "EndpointServiceResult", + "EndpointServicesListResult", + "Error", + "ErrorDetails", + "ErrorResponse", + "EvaluatedNetworkSecurityGroup", + "ExclusionManagedRule", + "ExclusionManagedRuleGroup", + "ExclusionManagedRuleSet", + "ExplicitProxy", + "ExpressRouteCircuit", + "ExpressRouteCircuitArpTable", + "ExpressRouteCircuitAuthorization", + "ExpressRouteCircuitConnection", + "ExpressRouteCircuitConnectionListResult", + "ExpressRouteCircuitListResult", + "ExpressRouteCircuitPeering", + "ExpressRouteCircuitPeeringConfig", + "ExpressRouteCircuitPeeringId", + "ExpressRouteCircuitPeeringListResult", + "ExpressRouteCircuitReference", + "ExpressRouteCircuitRoutesTable", + "ExpressRouteCircuitRoutesTableSummary", + "ExpressRouteCircuitServiceProviderProperties", + "ExpressRouteCircuitSku", + "ExpressRouteCircuitStats", + "ExpressRouteCircuitsArpTableListResult", + "ExpressRouteCircuitsRoutesTableListResult", + "ExpressRouteCircuitsRoutesTableSummaryListResult", + "ExpressRouteConnection", + "ExpressRouteConnectionId", + "ExpressRouteConnectionList", + "ExpressRouteCrossConnection", + "ExpressRouteCrossConnectionListResult", + "ExpressRouteCrossConnectionPeering", + "ExpressRouteCrossConnectionPeeringList", + "ExpressRouteCrossConnectionRoutesTableSummary", + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", + "ExpressRouteGateway", + "ExpressRouteGatewayList", + "ExpressRouteGatewayPropertiesAutoScaleConfiguration", + "ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds", + "ExpressRouteLink", + "ExpressRouteLinkListResult", + "ExpressRouteLinkMacSecConfig", + "ExpressRoutePort", + "ExpressRoutePortAuthorization", + "ExpressRoutePortAuthorizationListResult", + "ExpressRoutePortListResult", + "ExpressRoutePortsLocation", + "ExpressRoutePortsLocationBandwidths", + "ExpressRoutePortsLocationListResult", + "ExpressRouteProviderPort", + "ExpressRouteProviderPortListResult", + "ExpressRouteServiceProvider", + "ExpressRouteServiceProviderBandwidthsOffered", + "ExpressRouteServiceProviderListResult", + "ExtendedLocation", + "FilterItems", + "FirewallPacketCaptureParameters", + "FirewallPolicy", + "FirewallPolicyCertificateAuthority", + "FirewallPolicyFilterRuleCollection", + "FirewallPolicyFilterRuleCollectionAction", + "FirewallPolicyHttpHeaderToInsert", + "FirewallPolicyInsights", + "FirewallPolicyIntrusionDetection", + "FirewallPolicyIntrusionDetectionBypassTrafficSpecifications", + "FirewallPolicyIntrusionDetectionConfiguration", + "FirewallPolicyIntrusionDetectionSignatureSpecification", + "FirewallPolicyListResult", + "FirewallPolicyLogAnalyticsResources", + "FirewallPolicyLogAnalyticsWorkspace", + "FirewallPolicyNatRuleCollection", + "FirewallPolicyNatRuleCollectionAction", + "FirewallPolicyRule", + "FirewallPolicyRuleApplicationProtocol", + "FirewallPolicyRuleCollection", + "FirewallPolicyRuleCollectionGroup", + "FirewallPolicyRuleCollectionGroupListResult", + "FirewallPolicySNAT", + "FirewallPolicySQL", + "FirewallPolicySku", + "FirewallPolicyThreatIntelWhitelist", + "FirewallPolicyTransportSecurity", + "FlowLog", + "FlowLogFormatParameters", + "FlowLogInformation", + "FlowLogListResult", + "FlowLogStatusParameters", + "FrontendIPConfiguration", + "GatewayCustomBgpIpAddressIpConfiguration", + "GatewayLoadBalancerTunnelInterface", + "GatewayRoute", + "GatewayRouteListResult", + "GenerateExpressRoutePortsLOARequest", + "GenerateExpressRoutePortsLOAResult", + "GetInboundRoutesParameters", + "GetOutboundRoutesParameters", + "GetVpnSitesConfigurationRequest", + "GroupByUserSession", + "GroupByVariable", + "HTTPConfiguration", + "HTTPHeader", + "HopLink", + "Hub", + "HubIPAddresses", + "HubIpConfiguration", + "HubPublicIPAddresses", + "HubRoute", + "HubRouteTable", + "HubVirtualNetworkConnection", + "IDPSQueryObject", + "IPAddressAvailabilityResult", + "IPConfiguration", + "IPConfigurationBgpPeeringAddress", + "IPConfigurationProfile", + "IPPrefixesList", + "IPRule", + "InboundNatPool", + "InboundNatRule", + "InboundNatRuleListResult", + "InboundNatRulePortMapping", + "InboundSecurityRule", + "InboundSecurityRules", + "InternetIngressPublicIpsProperties", + "IpAllocation", + "IpAllocationListResult", + "IpGroup", + "IpGroupListResult", + "IpTag", + "IpsecPolicy", + "Ipv6CircuitConnectionConfig", + "Ipv6ExpressRouteCircuitPeeringConfig", + "ListHubRouteTablesResult", + "ListHubVirtualNetworkConnectionsResult", + "ListP2SVpnGatewaysResult", + "ListRouteMapsResult", + "ListRoutingIntentResult", + "ListVirtualHubBgpConnectionResults", + "ListVirtualHubIpConfigurationResults", + "ListVirtualHubRouteTableV2SResult", + "ListVirtualHubsResult", + "ListVirtualNetworkGatewayNatRulesResult", + "ListVirtualWANsResult", + "ListVpnConnectionsResult", + "ListVpnGatewayNatRulesResult", + "ListVpnGatewaysResult", + "ListVpnServerConfigurationPolicyGroupsResult", + "ListVpnServerConfigurationsResult", + "ListVpnSiteLinkConnectionsResult", + "ListVpnSiteLinksResult", + "ListVpnSitesResult", + "LoadBalancer", + "LoadBalancerBackendAddress", + "LoadBalancerBackendAddressPoolListResult", + "LoadBalancerFrontendIPConfigurationListResult", + "LoadBalancerListResult", + "LoadBalancerLoadBalancingRuleListResult", + "LoadBalancerOutboundRuleListResult", + "LoadBalancerProbeListResult", + "LoadBalancerSku", + "LoadBalancerVipSwapRequest", + "LoadBalancerVipSwapRequestFrontendIPConfiguration", + "LoadBalancingRule", + "LocalNetworkGateway", + "LocalNetworkGatewayListResult", + "LogSpecification", + "ManagedRuleGroupOverride", + "ManagedRuleOverride", + "ManagedRuleSet", + "ManagedRulesDefinition", + "ManagedServiceIdentity", + "MatchCondition", + "MatchVariable", + "MatchedRule", + "MetricSpecification", + "MigrateLoadBalancerToIpBasedRequest", + "MigratedPools", + "NatGateway", + "NatGatewayListResult", + "NatGatewaySku", + "NatRule", + "NatRulePortMapping", + "NetworkConfigurationDiagnosticParameters", + "NetworkConfigurationDiagnosticProfile", + "NetworkConfigurationDiagnosticResponse", + "NetworkConfigurationDiagnosticResult", + "NetworkGroup", + "NetworkGroupListResult", + "NetworkIntentPolicy", + "NetworkIntentPolicyConfiguration", + "NetworkInterface", + "NetworkInterfaceAssociation", + "NetworkInterfaceDnsSettings", + "NetworkInterfaceIPConfiguration", + "NetworkInterfaceIPConfigurationListResult", + "NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties", + "NetworkInterfaceListResult", + "NetworkInterfaceLoadBalancerListResult", + "NetworkInterfaceTapConfiguration", + "NetworkInterfaceTapConfigurationListResult", + "NetworkManager", + "NetworkManagerCommit", + "NetworkManagerConnection", + "NetworkManagerConnectionListResult", + "NetworkManagerDeploymentStatus", + "NetworkManagerDeploymentStatusListResult", + "NetworkManagerDeploymentStatusParameter", + "NetworkManagerEffectiveConnectivityConfigurationListResult", + "NetworkManagerEffectiveSecurityAdminRulesListResult", + "NetworkManagerListResult", + "NetworkManagerPropertiesNetworkManagerScopes", + "NetworkManagerSecurityGroupItem", + "NetworkProfile", + "NetworkProfileListResult", + "NetworkRule", + "NetworkSecurityGroup", + "NetworkSecurityGroupListResult", + "NetworkSecurityGroupResult", + "NetworkSecurityRulesEvaluationResult", + "NetworkVirtualAppliance", + "NetworkVirtualApplianceConnection", + "NetworkVirtualApplianceConnectionList", + "NetworkVirtualApplianceListResult", + "NetworkVirtualApplianceSiteListResult", + "NetworkVirtualApplianceSku", + "NetworkVirtualApplianceSkuInstances", + "NetworkVirtualApplianceSkuListResult", + "NetworkWatcher", + "NetworkWatcherListResult", + "NextHopParameters", + "NextHopResult", + "O365BreakOutCategoryPolicies", + "O365PolicyProperties", + "Office365PolicyProperties", + "Operation", + "OperationDisplay", + "OperationListResult", + "OperationPropertiesFormatServiceSpecification", + "OrderBy", + "OutboundRule", + "OwaspCrsExclusionEntry", + "P2SConnectionConfiguration", + "P2SVpnConnectionHealth", + "P2SVpnConnectionHealthRequest", + "P2SVpnConnectionRequest", + "P2SVpnGateway", + "P2SVpnProfileParameters", + "PacketCapture", + "PacketCaptureFilter", + "PacketCaptureListResult", + "PacketCaptureMachineScope", + "PacketCaptureParameters", + "PacketCaptureQueryStatusResult", + "PacketCaptureResult", + "PacketCaptureResultProperties", + "PacketCaptureStorageLocation", + "Parameter", + "PartnerManagedResourceProperties", + "PatchObject", + "PatchRouteFilter", + "PatchRouteFilterRule", + "PeerExpressRouteCircuitConnection", + "PeerExpressRouteCircuitConnectionListResult", + "PeerRoute", + "PolicySettings", + "PolicySettingsLogScrubbing", + "PrepareNetworkPoliciesRequest", + "PrivateDnsZoneConfig", + "PrivateDnsZoneGroup", + "PrivateDnsZoneGroupListResult", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateEndpointIPConfiguration", + "PrivateEndpointListResult", + "PrivateLinkService", + "PrivateLinkServiceConnection", + "PrivateLinkServiceConnectionState", + "PrivateLinkServiceIpConfiguration", + "PrivateLinkServiceListResult", + "PrivateLinkServicePropertiesAutoApproval", + "PrivateLinkServicePropertiesVisibility", + "PrivateLinkServiceVisibility", + "Probe", + "PropagatedRouteTable", + "ProtocolConfiguration", + "PublicIPAddress", + "PublicIPAddressDnsSettings", + "PublicIPAddressListResult", + "PublicIPAddressSku", + "PublicIPPrefix", + "PublicIPPrefixListResult", + "PublicIPPrefixSku", + "PublicIpDdosProtectionStatusResult", + "QosDefinition", + "QosIpRange", + "QosPortRange", + "QueryInboundNatRulePortMappingRequest", + "QueryRequestOptions", + "QueryResults", + "QueryTroubleshootingParameters", + "RadiusServer", + "RecordSet", + "ReferencedPublicIpAddress", + "Resource", + "ResourceNavigationLink", + "ResourceNavigationLinksListResult", + "ResourceSet", + "RetentionPolicyParameters", + "Route", + "RouteFilter", + "RouteFilterListResult", + "RouteFilterRule", + "RouteFilterRuleListResult", + "RouteListResult", + "RouteMap", + "RouteMapRule", + "RouteTable", + "RouteTableListResult", + "RoutingConfiguration", + "RoutingIntent", + "RoutingPolicy", + "ScopeConnection", + "ScopeConnectionListResult", + "SecurityAdminConfiguration", + "SecurityAdminConfigurationListResult", + "SecurityGroupNetworkInterface", + "SecurityGroupViewParameters", + "SecurityGroupViewResult", + "SecurityPartnerProvider", + "SecurityPartnerProviderListResult", + "SecurityRule", + "SecurityRuleAssociations", + "SecurityRuleListResult", + "ServiceAssociationLink", + "ServiceAssociationLinksListResult", + "ServiceEndpointPolicy", + "ServiceEndpointPolicyDefinition", + "ServiceEndpointPolicyDefinitionListResult", + "ServiceEndpointPolicyListResult", + "ServiceEndpointPropertiesFormat", + "ServiceTagInformation", + "ServiceTagInformationListResult", + "ServiceTagInformationPropertiesFormat", + "ServiceTagsListResult", + "SessionIds", + "SignatureOverridesFilterValuesQuery", + "SignatureOverridesFilterValuesResponse", + "SignaturesOverrides", + "SignaturesOverridesList", + "SignaturesOverridesProperties", + "SingleQueryResult", + "Sku", + "StaticMember", + "StaticMemberListResult", + "StaticRoute", + "StaticRoutesConfig", + "SubResource", + "Subnet", + "SubnetAssociation", + "SubnetListResult", + "SwapResource", + "SwapResourceListResult", + "SwapResourceProperties", + "SystemData", + "TagsObject", + "Topology", + "TopologyAssociation", + "TopologyParameters", + "TopologyResource", + "TrafficAnalyticsConfigurationProperties", + "TrafficAnalyticsProperties", + "TrafficSelectorPolicy", + "TroubleshootingDetails", + "TroubleshootingParameters", + "TroubleshootingRecommendedActions", + "TroubleshootingResult", + "TunnelConnectionHealth", + "UnprepareNetworkPoliciesRequest", + "Usage", + "UsageName", + "UsagesListResult", + "VM", + "VerificationIPFlowParameters", + "VerificationIPFlowResult", + "VirtualApplianceAdditionalNicProperties", + "VirtualApplianceNicProperties", + "VirtualApplianceSite", + "VirtualApplianceSkuProperties", + "VirtualHub", + "VirtualHubEffectiveRoute", + "VirtualHubEffectiveRouteList", + "VirtualHubId", + "VirtualHubRoute", + "VirtualHubRouteTable", + "VirtualHubRouteTableV2", + "VirtualHubRouteV2", + "VirtualNetwork", + "VirtualNetworkBgpCommunities", + "VirtualNetworkConnectionGatewayReference", + "VirtualNetworkDdosProtectionStatusResult", + "VirtualNetworkEncryption", + "VirtualNetworkGateway", + "VirtualNetworkGatewayAutoScaleBounds", + "VirtualNetworkGatewayAutoScaleConfiguration", + "VirtualNetworkGatewayConnection", + "VirtualNetworkGatewayConnectionListEntity", + "VirtualNetworkGatewayConnectionListResult", + "VirtualNetworkGatewayIPConfiguration", + "VirtualNetworkGatewayListConnectionsResult", + "VirtualNetworkGatewayListResult", + "VirtualNetworkGatewayNatRule", + "VirtualNetworkGatewayPolicyGroup", + "VirtualNetworkGatewayPolicyGroupMember", + "VirtualNetworkGatewaySku", + "VirtualNetworkListResult", + "VirtualNetworkListUsageResult", + "VirtualNetworkPeering", + "VirtualNetworkPeeringListResult", + "VirtualNetworkTap", + "VirtualNetworkTapListResult", + "VirtualNetworkUsage", + "VirtualNetworkUsageName", + "VirtualRouter", + "VirtualRouterAutoScaleConfiguration", + "VirtualRouterListResult", + "VirtualRouterPeering", + "VirtualRouterPeeringListResult", + "VirtualWAN", + "VirtualWanSecurityProvider", + "VirtualWanSecurityProviders", + "VirtualWanVpnProfileParameters", + "VnetRoute", + "VngClientConnectionConfiguration", + "VpnClientConfiguration", + "VpnClientConnectionHealth", + "VpnClientConnectionHealthDetail", + "VpnClientConnectionHealthDetailListResult", + "VpnClientIPsecParameters", + "VpnClientParameters", + "VpnClientRevokedCertificate", + "VpnClientRootCertificate", + "VpnConnection", + "VpnConnectionPacketCaptureStartParameters", + "VpnConnectionPacketCaptureStopParameters", + "VpnDeviceScriptParameters", + "VpnGateway", + "VpnGatewayIpConfiguration", + "VpnGatewayNatRule", + "VpnGatewayPacketCaptureStartParameters", + "VpnGatewayPacketCaptureStopParameters", + "VpnLinkBgpSettings", + "VpnLinkProviderProperties", + "VpnNatRuleMapping", + "VpnPacketCaptureStartParameters", + "VpnPacketCaptureStopParameters", + "VpnProfileResponse", + "VpnServerConfigRadiusClientRootCertificate", + "VpnServerConfigRadiusServerRootCertificate", + "VpnServerConfigVpnClientRevokedCertificate", + "VpnServerConfigVpnClientRootCertificate", + "VpnServerConfiguration", + "VpnServerConfigurationPolicyGroup", + "VpnServerConfigurationPolicyGroupMember", + "VpnServerConfigurationsResponse", + "VpnSite", + "VpnSiteId", + "VpnSiteLink", + "VpnSiteLinkConnection", + "WebApplicationFirewallCustomRule", + "WebApplicationFirewallPolicy", + "WebApplicationFirewallPolicyListResult", + "WebApplicationFirewallScrubbingRules", + "Access", + "ActionType", + "AddressPrefixType", + "AdminRuleKind", + "AdminState", + "ApplicationGatewayBackendHealthServerHealth", + "ApplicationGatewayClientRevocationOptions", + "ApplicationGatewayCookieBasedAffinity", + "ApplicationGatewayCustomErrorStatusCode", + "ApplicationGatewayFirewallMode", + "ApplicationGatewayFirewallRateLimitDuration", + "ApplicationGatewayFirewallUserSessionVariable", + "ApplicationGatewayLoadDistributionAlgorithm", + "ApplicationGatewayOperationalState", + "ApplicationGatewayProtocol", + "ApplicationGatewayRedirectType", + "ApplicationGatewayRequestRoutingRuleType", + "ApplicationGatewayRuleSetStatusOptions", + "ApplicationGatewaySkuName", + "ApplicationGatewaySslCipherSuite", + "ApplicationGatewaySslPolicyName", + "ApplicationGatewaySslPolicyType", + "ApplicationGatewaySslProtocol", + "ApplicationGatewayTier", + "ApplicationGatewayTierTypes", + "ApplicationGatewayWafRuleActionTypes", + "ApplicationGatewayWafRuleStateTypes", + "AssociationType", + "AuthenticationMethod", + "AuthorizationUseStatus", + "AutoLearnPrivateRangesMode", + "AzureFirewallApplicationRuleProtocolType", + "AzureFirewallNatRCActionType", + "AzureFirewallNetworkRuleProtocol", + "AzureFirewallPacketCaptureFlagsType", + "AzureFirewallRCActionType", + "AzureFirewallSkuName", + "AzureFirewallSkuTier", + "AzureFirewallThreatIntelMode", + "BastionConnectProtocol", + "BastionHostSkuName", + "BgpPeerState", + "CircuitConnectionStatus", + "CommissionedState", + "ConfigurationType", + "ConnectionMonitorEndpointFilterItemType", + "ConnectionMonitorEndpointFilterType", + "ConnectionMonitorSourceStatus", + "ConnectionMonitorTestConfigurationProtocol", + "ConnectionMonitorType", + "ConnectionState", + "ConnectionStatus", + "ConnectivityTopology", + "CoverageLevel", + "CreatedByType", + "CustomIpPrefixType", + "DdosSettingsProtectionMode", + "DeleteExistingPeering", + "DeleteOptions", + "DeploymentStatus", + "DestinationPortBehavior", + "DhGroup", + "Direction", + "EffectiveAdminRuleKind", + "EffectiveRouteSource", + "EffectiveRouteState", + "EffectiveSecurityRuleProtocol", + "EndpointType", + "EvaluationState", + "ExpressRouteCircuitPeeringAdvertisedPublicPrefixState", + "ExpressRouteCircuitPeeringState", + "ExpressRouteCircuitSkuFamily", + "ExpressRouteCircuitSkuTier", + "ExpressRouteLinkAdminState", + "ExpressRouteLinkConnectorType", + "ExpressRouteLinkMacSecCipher", + "ExpressRouteLinkMacSecSciState", + "ExpressRoutePeeringState", + "ExpressRoutePeeringType", + "ExpressRoutePortAuthorizationUseStatus", + "ExpressRoutePortsBillingType", + "ExpressRoutePortsEncapsulation", + "ExtendedLocationTypes", + "FirewallPolicyFilterRuleCollectionActionType", + "FirewallPolicyIDPSQuerySortOrder", + "FirewallPolicyIDPSSignatureDirection", + "FirewallPolicyIDPSSignatureMode", + "FirewallPolicyIDPSSignatureSeverity", + "FirewallPolicyIntrusionDetectionProfileType", + "FirewallPolicyIntrusionDetectionProtocol", + "FirewallPolicyIntrusionDetectionStateType", + "FirewallPolicyNatRuleCollectionActionType", + "FirewallPolicyRuleApplicationProtocolType", + "FirewallPolicyRuleCollectionType", + "FirewallPolicyRuleNetworkProtocol", + "FirewallPolicyRuleType", + "FirewallPolicySkuTier", + "FlowLogFormatType", + "GatewayLoadBalancerTunnelInterfaceType", + "GatewayLoadBalancerTunnelProtocol", + "Geo", + "GroupConnectivity", + "HTTPConfigurationMethod", + "HTTPMethod", + "HubBgpConnectionStatus", + "HubRoutingPreference", + "HubVirtualNetworkConnectionStatus", + "IPAllocationMethod", + "IPVersion", + "IkeEncryption", + "IkeIntegrity", + "InboundSecurityRulesProtocol", + "IpAllocationType", + "IpFlowProtocol", + "IpsecEncryption", + "IpsecIntegrity", + "IsGlobal", + "IsWorkloadProtected", + "IssueType", + "LoadBalancerBackendAddressAdminState", + "LoadBalancerOutboundRuleProtocol", + "LoadBalancerSkuName", + "LoadBalancerSkuTier", + "LoadDistribution", + "ManagedRuleEnabledState", + "NatGatewaySkuName", + "NetworkIntentPolicyBasedService", + "NetworkInterfaceAuxiliaryMode", + "NetworkInterfaceAuxiliarySku", + "NetworkInterfaceMigrationPhase", + "NetworkInterfaceNicType", + "NetworkOperationStatus", + "NextHopType", + "NextStep", + "OfficeTrafficCategory", + "Origin", + "OutputType", + "OwaspCrsExclusionEntryMatchVariable", + "OwaspCrsExclusionEntrySelectorMatchOperator", + "PacketCaptureTargetType", + "PcError", + "PcProtocol", + "PcStatus", + "PfsGroup", + "PreferredIPVersion", + "PreferredRoutingGateway", + "ProbeProtocol", + "ProcessorArchitecture", + "Protocol", + "ProtocolType", + "ProvisioningState", + "PublicIPAddressMigrationPhase", + "PublicIPAddressSkuName", + "PublicIPAddressSkuTier", + "PublicIPPrefixSkuName", + "PublicIPPrefixSkuTier", + "PublicIpAddressDnsSettingsDomainNameLabelScope", + "ResourceIdentityType", + "RouteFilterRuleType", + "RouteMapActionType", + "RouteMapMatchCondition", + "RouteNextHopType", + "RoutingState", + "ScopeConnectionState", + "ScrubbingRuleEntryMatchOperator", + "ScrubbingRuleEntryMatchVariable", + "ScrubbingRuleEntryState", + "SecurityConfigurationRuleAccess", + "SecurityConfigurationRuleDirection", + "SecurityConfigurationRuleProtocol", + "SecurityPartnerProviderConnectionStatus", + "SecurityProviderName", + "SecurityRuleAccess", + "SecurityRuleDirection", + "SecurityRuleProtocol", + "ServiceProviderProvisioningState", + "Severity", + "SlotType", + "SyncMode", + "SyncRemoteAddressSpace", + "TransportProtocol", + "TunnelConnectionStatus", + "UsageUnit", + "UseHubGateway", + "VerbosityLevel", + "VirtualNetworkEncryptionEnforcement", + "VirtualNetworkGatewayConnectionMode", + "VirtualNetworkGatewayConnectionProtocol", + "VirtualNetworkGatewayConnectionStatus", + "VirtualNetworkGatewayConnectionType", + "VirtualNetworkGatewaySkuName", + "VirtualNetworkGatewaySkuTier", + "VirtualNetworkGatewayType", + "VirtualNetworkPeeringLevel", + "VirtualNetworkPeeringState", + "VirtualNetworkPrivateEndpointNetworkPolicies", + "VirtualNetworkPrivateLinkServiceNetworkPolicies", + "VirtualWanSecurityProviderType", + "VnetLocalRouteOverrideCriteria", + "VpnAuthenticationType", + "VpnClientProtocol", + "VpnConnectionStatus", + "VpnGatewayGeneration", + "VpnGatewayTunnelingProtocol", + "VpnLinkConnectionMode", + "VpnNatRuleMode", + "VpnNatRuleType", + "VpnPolicyMemberAttributeType", + "VpnType", + "WebApplicationFirewallAction", + "WebApplicationFirewallEnabledState", + "WebApplicationFirewallMatchVariable", + "WebApplicationFirewallMode", + "WebApplicationFirewallOperator", + "WebApplicationFirewallPolicyResourceState", + "WebApplicationFirewallRuleType", + "WebApplicationFirewallScrubbingState", + "WebApplicationFirewallState", + "WebApplicationFirewallTransform", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_models_py3.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_models_py3.py new file mode 100644 index 00000000000..4e9a94331e2 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_models_py3.py @@ -0,0 +1,39014 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AadAuthenticationParameters(_serialization.Model): + """AAD Vpn authentication type related parameters. + + :ivar aad_tenant: AAD Vpn authentication parameter AAD tenant. + :vartype aad_tenant: str + :ivar aad_audience: AAD Vpn authentication parameter AAD audience. + :vartype aad_audience: str + :ivar aad_issuer: AAD Vpn authentication parameter AAD issuer. + :vartype aad_issuer: str + """ + + _attribute_map = { + "aad_tenant": {"key": "aadTenant", "type": "str"}, + "aad_audience": {"key": "aadAudience", "type": "str"}, + "aad_issuer": {"key": "aadIssuer", "type": "str"}, + } + + def __init__( + self, + *, + aad_tenant: Optional[str] = None, + aad_audience: Optional[str] = None, + aad_issuer: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword aad_tenant: AAD Vpn authentication parameter AAD tenant. + :paramtype aad_tenant: str + :keyword aad_audience: AAD Vpn authentication parameter AAD audience. + :paramtype aad_audience: str + :keyword aad_issuer: AAD Vpn authentication parameter AAD issuer. + :paramtype aad_issuer: str + """ + super().__init__(**kwargs) + self.aad_tenant = aad_tenant + self.aad_audience = aad_audience + self.aad_issuer = aad_issuer + + +class Action(_serialization.Model): + """Action to be taken on a route matching a RouteMap criterion. + + :ivar type: Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and + 'Drop.'. Known values are: "Unknown", "Remove", "Add", "Replace", and "Drop". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.RouteMapActionType + :ivar parameters: List of parameters relevant to the action.For instance if type is drop then + parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN + numbers to be added. + :vartype parameters: list[~azure.mgmt.network.v2023_09_01.models.Parameter] + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "parameters": {"key": "parameters", "type": "[Parameter]"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.RouteMapActionType"]] = None, + parameters: Optional[List["_models.Parameter"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and + 'Drop.'. Known values are: "Unknown", "Remove", "Add", "Replace", and "Drop". + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.RouteMapActionType + :keyword parameters: List of parameters relevant to the action.For instance if type is drop + then parameters has list of prefixes to be dropped.If type is add, parameters would have list + of ASN numbers to be added. + :paramtype parameters: list[~azure.mgmt.network.v2023_09_01.models.Parameter] + """ + super().__init__(**kwargs) + self.type = type + self.parameters = parameters + + +class ActiveBaseSecurityAdminRule(_serialization.Model): + """Network base admin rule. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ActiveSecurityAdminRule, ActiveDefaultSecurityAdminRule + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar commit_time: Deployment time string. + :vartype commit_time: ~datetime.datetime + :ivar region: Deployment region. + :vartype region: str + :ivar configuration_description: A description of the security admin configuration. + :vartype configuration_description: str + :ivar rule_collection_description: A description of the rule collection. + :vartype rule_collection_description: str + :ivar rule_collection_applies_to_groups: Groups for rule collection. + :vartype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar rule_groups: Effective configuration groups. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveAdminRuleKind + """ + + _validation = { + "kind": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "commit_time": {"key": "commitTime", "type": "iso-8601"}, + "region": {"key": "region", "type": "str"}, + "configuration_description": {"key": "configurationDescription", "type": "str"}, + "rule_collection_description": {"key": "ruleCollectionDescription", "type": "str"}, + "rule_collection_applies_to_groups": { + "key": "ruleCollectionAppliesToGroups", + "type": "[NetworkManagerSecurityGroupItem]", + }, + "rule_groups": {"key": "ruleGroups", "type": "[ConfigurationGroup]"}, + "kind": {"key": "kind", "type": "str"}, + } + + _subtype_map = {"kind": {"Custom": "ActiveSecurityAdminRule", "Default": "ActiveDefaultSecurityAdminRule"}} + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + commit_time: Optional[datetime.datetime] = None, + region: Optional[str] = None, + configuration_description: Optional[str] = None, + rule_collection_description: Optional[str] = None, + rule_collection_applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + rule_groups: Optional[List["_models.ConfigurationGroup"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword commit_time: Deployment time string. + :paramtype commit_time: ~datetime.datetime + :keyword region: Deployment region. + :paramtype region: str + :keyword configuration_description: A description of the security admin configuration. + :paramtype configuration_description: str + :keyword rule_collection_description: A description of the rule collection. + :paramtype rule_collection_description: str + :keyword rule_collection_applies_to_groups: Groups for rule collection. + :paramtype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :keyword rule_groups: Effective configuration groups. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + """ + super().__init__(**kwargs) + self.id = id + self.commit_time = commit_time + self.region = region + self.configuration_description = configuration_description + self.rule_collection_description = rule_collection_description + self.rule_collection_applies_to_groups = rule_collection_applies_to_groups + self.rule_groups = rule_groups + self.kind: Optional[str] = None + + +class ActiveConfigurationParameter(_serialization.Model): + """Effective Virtual Networks Parameter. + + :ivar regions: List of regions. + :vartype regions: list[str] + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "regions": {"key": "regions", "type": "[str]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__(self, *, regions: Optional[List[str]] = None, skip_token: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword regions: List of regions. + :paramtype regions: list[str] + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.regions = regions + self.skip_token = skip_token + + +class EffectiveConnectivityConfiguration(_serialization.Model): + """The network manager effective connectivity configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Connectivity configuration ID. + :vartype id: str + :ivar configuration_groups: Effective configuration groups. + :vartype configuration_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar description: A description of the connectivity configuration. + :vartype description: str + :ivar connectivity_topology: Connectivity topology type. Known values are: "HubAndSpoke" and + "Mesh". + :vartype connectivity_topology: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectivityTopology + :ivar hubs: List of hubItems. + :vartype hubs: list[~azure.mgmt.network.v2023_09_01.models.Hub] + :ivar is_global: Flag if global mesh is supported. Known values are: "False" and "True". + :vartype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :ivar applies_to_groups: Groups for configuration. + :vartype applies_to_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityGroupItem] + :ivar provisioning_state: The provisioning state of the connectivity configuration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar delete_existing_peering: Flag if need to remove current existing peerings. Known values + are: "False" and "True". + :vartype delete_existing_peering: str or + ~azure.mgmt.network.v2023_09_01.models.DeleteExistingPeering + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "configuration_groups": {"key": "configurationGroups", "type": "[ConfigurationGroup]"}, + "description": {"key": "properties.description", "type": "str"}, + "connectivity_topology": {"key": "properties.connectivityTopology", "type": "str"}, + "hubs": {"key": "properties.hubs", "type": "[Hub]"}, + "is_global": {"key": "properties.isGlobal", "type": "str"}, + "applies_to_groups": {"key": "properties.appliesToGroups", "type": "[ConnectivityGroupItem]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "delete_existing_peering": {"key": "properties.deleteExistingPeering", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + configuration_groups: Optional[List["_models.ConfigurationGroup"]] = None, + description: Optional[str] = None, + connectivity_topology: Optional[Union[str, "_models.ConnectivityTopology"]] = None, + hubs: Optional[List["_models.Hub"]] = None, + is_global: Optional[Union[str, "_models.IsGlobal"]] = None, + applies_to_groups: Optional[List["_models.ConnectivityGroupItem"]] = None, + delete_existing_peering: Optional[Union[str, "_models.DeleteExistingPeering"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Connectivity configuration ID. + :paramtype id: str + :keyword configuration_groups: Effective configuration groups. + :paramtype configuration_groups: + list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :keyword description: A description of the connectivity configuration. + :paramtype description: str + :keyword connectivity_topology: Connectivity topology type. Known values are: "HubAndSpoke" and + "Mesh". + :paramtype connectivity_topology: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectivityTopology + :keyword hubs: List of hubItems. + :paramtype hubs: list[~azure.mgmt.network.v2023_09_01.models.Hub] + :keyword is_global: Flag if global mesh is supported. Known values are: "False" and "True". + :paramtype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :keyword applies_to_groups: Groups for configuration. + :paramtype applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.ConnectivityGroupItem] + :keyword delete_existing_peering: Flag if need to remove current existing peerings. Known + values are: "False" and "True". + :paramtype delete_existing_peering: str or + ~azure.mgmt.network.v2023_09_01.models.DeleteExistingPeering + """ + super().__init__(**kwargs) + self.id = id + self.configuration_groups = configuration_groups + self.description = description + self.connectivity_topology = connectivity_topology + self.hubs = hubs + self.is_global = is_global + self.applies_to_groups = applies_to_groups + self.provisioning_state = None + self.delete_existing_peering = delete_existing_peering + self.resource_guid = None + + +class ActiveConnectivityConfiguration( + EffectiveConnectivityConfiguration +): # pylint: disable=too-many-instance-attributes + """Active connectivity configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Connectivity configuration ID. + :vartype id: str + :ivar configuration_groups: Effective configuration groups. + :vartype configuration_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar description: A description of the connectivity configuration. + :vartype description: str + :ivar connectivity_topology: Connectivity topology type. Known values are: "HubAndSpoke" and + "Mesh". + :vartype connectivity_topology: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectivityTopology + :ivar hubs: List of hubItems. + :vartype hubs: list[~azure.mgmt.network.v2023_09_01.models.Hub] + :ivar is_global: Flag if global mesh is supported. Known values are: "False" and "True". + :vartype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :ivar applies_to_groups: Groups for configuration. + :vartype applies_to_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityGroupItem] + :ivar provisioning_state: The provisioning state of the connectivity configuration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar delete_existing_peering: Flag if need to remove current existing peerings. Known values + are: "False" and "True". + :vartype delete_existing_peering: str or + ~azure.mgmt.network.v2023_09_01.models.DeleteExistingPeering + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + :ivar commit_time: Deployment time string. + :vartype commit_time: ~datetime.datetime + :ivar region: Deployment region. + :vartype region: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "configuration_groups": {"key": "configurationGroups", "type": "[ConfigurationGroup]"}, + "description": {"key": "properties.description", "type": "str"}, + "connectivity_topology": {"key": "properties.connectivityTopology", "type": "str"}, + "hubs": {"key": "properties.hubs", "type": "[Hub]"}, + "is_global": {"key": "properties.isGlobal", "type": "str"}, + "applies_to_groups": {"key": "properties.appliesToGroups", "type": "[ConnectivityGroupItem]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "delete_existing_peering": {"key": "properties.deleteExistingPeering", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "commit_time": {"key": "commitTime", "type": "iso-8601"}, + "region": {"key": "region", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + configuration_groups: Optional[List["_models.ConfigurationGroup"]] = None, + description: Optional[str] = None, + connectivity_topology: Optional[Union[str, "_models.ConnectivityTopology"]] = None, + hubs: Optional[List["_models.Hub"]] = None, + is_global: Optional[Union[str, "_models.IsGlobal"]] = None, + applies_to_groups: Optional[List["_models.ConnectivityGroupItem"]] = None, + delete_existing_peering: Optional[Union[str, "_models.DeleteExistingPeering"]] = None, + commit_time: Optional[datetime.datetime] = None, + region: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Connectivity configuration ID. + :paramtype id: str + :keyword configuration_groups: Effective configuration groups. + :paramtype configuration_groups: + list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :keyword description: A description of the connectivity configuration. + :paramtype description: str + :keyword connectivity_topology: Connectivity topology type. Known values are: "HubAndSpoke" and + "Mesh". + :paramtype connectivity_topology: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectivityTopology + :keyword hubs: List of hubItems. + :paramtype hubs: list[~azure.mgmt.network.v2023_09_01.models.Hub] + :keyword is_global: Flag if global mesh is supported. Known values are: "False" and "True". + :paramtype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :keyword applies_to_groups: Groups for configuration. + :paramtype applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.ConnectivityGroupItem] + :keyword delete_existing_peering: Flag if need to remove current existing peerings. Known + values are: "False" and "True". + :paramtype delete_existing_peering: str or + ~azure.mgmt.network.v2023_09_01.models.DeleteExistingPeering + :keyword commit_time: Deployment time string. + :paramtype commit_time: ~datetime.datetime + :keyword region: Deployment region. + :paramtype region: str + """ + super().__init__( + id=id, + configuration_groups=configuration_groups, + description=description, + connectivity_topology=connectivity_topology, + hubs=hubs, + is_global=is_global, + applies_to_groups=applies_to_groups, + delete_existing_peering=delete_existing_peering, + **kwargs + ) + self.commit_time = commit_time + self.region = region + + +class ActiveConnectivityConfigurationsListResult(_serialization.Model): # pylint: disable=name-too-long + """Result of the request to list active connectivity configurations. It contains a list of active + connectivity configurations and a skiptoken to get the next set of results. + + :ivar value: Gets a page of active connectivity configurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfiguration] + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ActiveConnectivityConfiguration]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ActiveConnectivityConfiguration"]] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of active connectivity configurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfiguration] + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.value = value + self.skip_token = skip_token + + +class ActiveDefaultSecurityAdminRule(ActiveBaseSecurityAdminRule): # pylint: disable=too-many-instance-attributes + """Network default admin rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar commit_time: Deployment time string. + :vartype commit_time: ~datetime.datetime + :ivar region: Deployment region. + :vartype region: str + :ivar configuration_description: A description of the security admin configuration. + :vartype configuration_description: str + :ivar rule_collection_description: A description of the rule collection. + :vartype rule_collection_description: str + :ivar rule_collection_applies_to_groups: Groups for rule collection. + :vartype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar rule_groups: Effective configuration groups. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveAdminRuleKind + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar flag: Default rule flag. + :vartype flag: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "Any", and "Ah". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :ivar sources: The CIDR or source IP ranges. + :vartype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar destinations: The destination address prefixes. CIDR or destination IP ranges. + :vartype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: Indicates the access allowed for this particular rule. Known values are: "Allow", + "Deny", and "AlwaysAllow". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :ivar priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :vartype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "kind": {"required": True}, + "description": {"readonly": True}, + "protocol": {"readonly": True}, + "sources": {"readonly": True}, + "destinations": {"readonly": True}, + "source_port_ranges": {"readonly": True}, + "destination_port_ranges": {"readonly": True}, + "access": {"readonly": True}, + "priority": {"readonly": True}, + "direction": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "commit_time": {"key": "commitTime", "type": "iso-8601"}, + "region": {"key": "region", "type": "str"}, + "configuration_description": {"key": "configurationDescription", "type": "str"}, + "rule_collection_description": {"key": "ruleCollectionDescription", "type": "str"}, + "rule_collection_applies_to_groups": { + "key": "ruleCollectionAppliesToGroups", + "type": "[NetworkManagerSecurityGroupItem]", + }, + "rule_groups": {"key": "ruleGroups", "type": "[ConfigurationGroup]"}, + "kind": {"key": "kind", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "flag": {"key": "properties.flag", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "sources": {"key": "properties.sources", "type": "[AddressPrefixItem]"}, + "destinations": {"key": "properties.destinations", "type": "[AddressPrefixItem]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + commit_time: Optional[datetime.datetime] = None, + region: Optional[str] = None, + configuration_description: Optional[str] = None, + rule_collection_description: Optional[str] = None, + rule_collection_applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + rule_groups: Optional[List["_models.ConfigurationGroup"]] = None, + flag: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword commit_time: Deployment time string. + :paramtype commit_time: ~datetime.datetime + :keyword region: Deployment region. + :paramtype region: str + :keyword configuration_description: A description of the security admin configuration. + :paramtype configuration_description: str + :keyword rule_collection_description: A description of the rule collection. + :paramtype rule_collection_description: str + :keyword rule_collection_applies_to_groups: Groups for rule collection. + :paramtype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :keyword rule_groups: Effective configuration groups. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :keyword flag: Default rule flag. + :paramtype flag: str + """ + super().__init__( + id=id, + commit_time=commit_time, + region=region, + configuration_description=configuration_description, + rule_collection_description=rule_collection_description, + rule_collection_applies_to_groups=rule_collection_applies_to_groups, + rule_groups=rule_groups, + **kwargs + ) + self.kind: str = "Default" + self.description = None + self.flag = flag + self.protocol = None + self.sources = None + self.destinations = None + self.source_port_ranges = None + self.destination_port_ranges = None + self.access = None + self.priority = None + self.direction = None + self.provisioning_state = None + self.resource_guid = None + + +class ActiveSecurityAdminRule(ActiveBaseSecurityAdminRule): # pylint: disable=too-many-instance-attributes + """Network admin rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar commit_time: Deployment time string. + :vartype commit_time: ~datetime.datetime + :ivar region: Deployment region. + :vartype region: str + :ivar configuration_description: A description of the security admin configuration. + :vartype configuration_description: str + :ivar rule_collection_description: A description of the rule collection. + :vartype rule_collection_description: str + :ivar rule_collection_applies_to_groups: Groups for rule collection. + :vartype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar rule_groups: Effective configuration groups. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveAdminRuleKind + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "Any", and "Ah". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :ivar sources: The CIDR or source IP ranges. + :vartype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar destinations: The destination address prefixes. CIDR or destination IP ranges. + :vartype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: Indicates the access allowed for this particular rule. Known values are: "Allow", + "Deny", and "AlwaysAllow". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :ivar priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :vartype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "kind": {"required": True}, + "priority": {"maximum": 4096, "minimum": 1}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "commit_time": {"key": "commitTime", "type": "iso-8601"}, + "region": {"key": "region", "type": "str"}, + "configuration_description": {"key": "configurationDescription", "type": "str"}, + "rule_collection_description": {"key": "ruleCollectionDescription", "type": "str"}, + "rule_collection_applies_to_groups": { + "key": "ruleCollectionAppliesToGroups", + "type": "[NetworkManagerSecurityGroupItem]", + }, + "rule_groups": {"key": "ruleGroups", "type": "[ConfigurationGroup]"}, + "kind": {"key": "kind", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "sources": {"key": "properties.sources", "type": "[AddressPrefixItem]"}, + "destinations": {"key": "properties.destinations", "type": "[AddressPrefixItem]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + commit_time: Optional[datetime.datetime] = None, + region: Optional[str] = None, + configuration_description: Optional[str] = None, + rule_collection_description: Optional[str] = None, + rule_collection_applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + rule_groups: Optional[List["_models.ConfigurationGroup"]] = None, + description: Optional[str] = None, + protocol: Optional[Union[str, "_models.SecurityConfigurationRuleProtocol"]] = None, + sources: Optional[List["_models.AddressPrefixItem"]] = None, + destinations: Optional[List["_models.AddressPrefixItem"]] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + access: Optional[Union[str, "_models.SecurityConfigurationRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "_models.SecurityConfigurationRuleDirection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword commit_time: Deployment time string. + :paramtype commit_time: ~datetime.datetime + :keyword region: Deployment region. + :paramtype region: str + :keyword configuration_description: A description of the security admin configuration. + :paramtype configuration_description: str + :keyword rule_collection_description: A description of the rule collection. + :paramtype rule_collection_description: str + :keyword rule_collection_applies_to_groups: Groups for rule collection. + :paramtype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :keyword rule_groups: Effective configuration groups. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :keyword description: A description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", + "Icmp", "Esp", "Any", and "Ah". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :keyword sources: The CIDR or source IP ranges. + :paramtype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :keyword destinations: The destination address prefixes. CIDR or destination IP ranges. + :paramtype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :keyword source_port_ranges: The source port ranges. + :paramtype source_port_ranges: list[str] + :keyword destination_port_ranges: The destination port ranges. + :paramtype destination_port_ranges: list[str] + :keyword access: Indicates the access allowed for this particular rule. Known values are: + "Allow", "Deny", and "AlwaysAllow". + :paramtype access: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :keyword priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :paramtype priority: int + :keyword direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :paramtype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + """ + super().__init__( + id=id, + commit_time=commit_time, + region=region, + configuration_description=configuration_description, + rule_collection_description=rule_collection_description, + rule_collection_applies_to_groups=rule_collection_applies_to_groups, + rule_groups=rule_groups, + **kwargs + ) + self.kind: str = "Custom" + self.description = description + self.protocol = protocol + self.sources = sources + self.destinations = destinations + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = None + self.resource_guid = None + + +class ActiveSecurityAdminRulesListResult(_serialization.Model): + """Result of the request to list active security admin rules. It contains a list of active + security admin rules and a skiptoken to get the next set of results. + + :ivar value: Gets a page of active security admin rules. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ActiveBaseSecurityAdminRule] + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ActiveBaseSecurityAdminRule]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ActiveBaseSecurityAdminRule"]] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of active security admin rules. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ActiveBaseSecurityAdminRule] + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.value = value + self.skip_token = skip_token + + +class AddressPrefixItem(_serialization.Model): + """Address prefix item. + + :ivar address_prefix: Address prefix. + :vartype address_prefix: str + :ivar address_prefix_type: Address prefix type. Known values are: "IPPrefix" and "ServiceTag". + :vartype address_prefix_type: str or ~azure.mgmt.network.v2023_09_01.models.AddressPrefixType + """ + + _attribute_map = { + "address_prefix": {"key": "addressPrefix", "type": "str"}, + "address_prefix_type": {"key": "addressPrefixType", "type": "str"}, + } + + def __init__( + self, + *, + address_prefix: Optional[str] = None, + address_prefix_type: Optional[Union[str, "_models.AddressPrefixType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword address_prefix: Address prefix. + :paramtype address_prefix: str + :keyword address_prefix_type: Address prefix type. Known values are: "IPPrefix" and + "ServiceTag". + :paramtype address_prefix_type: str or ~azure.mgmt.network.v2023_09_01.models.AddressPrefixType + """ + super().__init__(**kwargs) + self.address_prefix = address_prefix + self.address_prefix_type = address_prefix_type + + +class AddressSpace(_serialization.Model): + """AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual + network. + + :ivar address_prefixes: A list of address blocks reserved for this virtual network in CIDR + notation. + :vartype address_prefixes: list[str] + """ + + _attribute_map = { + "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, + } + + def __init__(self, *, address_prefixes: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword address_prefixes: A list of address blocks reserved for this virtual network in CIDR + notation. + :paramtype address_prefixes: list[str] + """ + super().__init__(**kwargs) + self.address_prefixes = address_prefixes + + +class ChildResource(_serialization.Model): + """Proxy resource representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + + +class BaseAdminRule(ChildResource): + """Network base admin rule. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AdminRule, DefaultAdminRule + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.AdminRuleKind + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "kind": {"required": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + _subtype_map = {"kind": {"Custom": "AdminRule", "Default": "DefaultAdminRule"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.kind: Optional[str] = None + self.system_data = None + + +class AdminRule(BaseAdminRule): # pylint: disable=too-many-instance-attributes + """Network admin rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.AdminRuleKind + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "Any", and "Ah". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :ivar sources: The CIDR or source IP ranges. + :vartype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar destinations: The destination address prefixes. CIDR or destination IP ranges. + :vartype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: Indicates the access allowed for this particular rule. Known values are: "Allow", + "Deny", and "AlwaysAllow". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :ivar priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :vartype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "kind": {"required": True}, + "system_data": {"readonly": True}, + "priority": {"maximum": 4096, "minimum": 1}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "sources": {"key": "properties.sources", "type": "[AddressPrefixItem]"}, + "destinations": {"key": "properties.destinations", "type": "[AddressPrefixItem]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + protocol: Optional[Union[str, "_models.SecurityConfigurationRuleProtocol"]] = None, + sources: Optional[List["_models.AddressPrefixItem"]] = None, + destinations: Optional[List["_models.AddressPrefixItem"]] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + access: Optional[Union[str, "_models.SecurityConfigurationRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "_models.SecurityConfigurationRuleDirection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword description: A description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", + "Icmp", "Esp", "Any", and "Ah". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :keyword sources: The CIDR or source IP ranges. + :paramtype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :keyword destinations: The destination address prefixes. CIDR or destination IP ranges. + :paramtype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :keyword source_port_ranges: The source port ranges. + :paramtype source_port_ranges: list[str] + :keyword destination_port_ranges: The destination port ranges. + :paramtype destination_port_ranges: list[str] + :keyword access: Indicates the access allowed for this particular rule. Known values are: + "Allow", "Deny", and "AlwaysAllow". + :paramtype access: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :keyword priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :paramtype priority: int + :keyword direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :paramtype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + """ + super().__init__(**kwargs) + self.kind: str = "Custom" + self.description = description + self.protocol = protocol + self.sources = sources + self.destinations = destinations + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = None + self.resource_guid = None + + +class AdminRuleCollection(ChildResource): + """Defines the admin rule collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description of the admin rule collection. + :vartype description: str + :ivar applies_to_groups: Groups for configuration. + :vartype applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "applies_to_groups": {"key": "properties.appliesToGroups", "type": "[NetworkManagerSecurityGroupItem]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword description: A description of the admin rule collection. + :paramtype description: str + :keyword applies_to_groups: Groups for configuration. + :paramtype applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + """ + super().__init__(**kwargs) + self.system_data = None + self.description = description + self.applies_to_groups = applies_to_groups + self.provisioning_state = None + self.resource_guid = None + + +class AdminRuleCollectionListResult(_serialization.Model): + """Security admin configuration rule collection list result. + + :ivar value: A list of network manager security admin configuration rule collections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection] + :ivar next_link: Gets the URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[AdminRuleCollection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.AdminRuleCollection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of network manager security admin configuration rule collections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection] + :keyword next_link: Gets the URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AdminRuleListResult(_serialization.Model): + """security configuration admin rule list result. + + :ivar value: A list of admin rules. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BaseAdminRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BaseAdminRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BaseAdminRule"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of admin rules. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BaseAdminRule] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Resource(_serialization.Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ApplicationGateway(Resource): # pylint: disable=too-many-instance-attributes + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar zones: A list of availability zones denoting where the resource needs to come from. + :vartype zones: list[str] + :ivar identity: The identity of the application gateway, if configured. + :vartype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :ivar sku: SKU of the application gateway resource. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySku + :ivar ssl_policy: SSL policy of the application gateway resource. + :vartype ssl_policy: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway resource. Known values + are: "Stopped", "Starting", "Running", and "Stopping". + :vartype operational_state: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayOperationalState + :ivar gateway_ip_configurations: Subnets of the application gateway resource. For default + limits, see `Application Gateway limits + `_. + :vartype gateway_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayIPConfiguration] + :ivar authentication_certificates: Authentication certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :vartype authentication_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAuthenticationCertificate] + :ivar trusted_root_certificates: Trusted Root certificates of the application gateway resource. + For default limits, see `Application Gateway limits + `_. + :vartype trusted_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTrustedRootCertificate] + :ivar trusted_client_certificates: Trusted client certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :vartype trusted_client_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTrustedClientCertificate] + :ivar ssl_certificates: SSL certificates of the application gateway resource. For default + limits, see `Application Gateway limits + `_. + :vartype ssl_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCertificate] + :ivar frontend_ip_configurations: Frontend IP addresses of the application gateway resource. + For default limits, see `Application Gateway limits + `_. + :vartype frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFrontendIPConfiguration] + :ivar frontend_ports: Frontend ports of the application gateway resource. For default limits, + see `Application Gateway limits + `_. + :vartype frontend_ports: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFrontendPort] + :ivar probes: Probes of the application gateway resource. + :vartype probes: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProbe] + :ivar backend_address_pools: Backend address pool of the application gateway resource. For + default limits, see `Application Gateway limits + `_. + :vartype backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool] + :ivar backend_http_settings_collection: Backend http settings of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :vartype backend_http_settings_collection: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHttpSettings] + :ivar backend_settings_collection: Backend settings of the application gateway resource. For + default limits, see `Application Gateway limits + `_. + :vartype backend_settings_collection: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendSettings] + :ivar http_listeners: Http listeners of the application gateway resource. For default limits, + see `Application Gateway limits + `_. + :vartype http_listeners: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayHttpListener] + :ivar listeners: Listeners of the application gateway resource. For default limits, see + `Application Gateway limits + `_. + :vartype listeners: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayListener] + :ivar ssl_profiles: SSL profiles of the application gateway resource. For default limits, see + `Application Gateway limits + `_. + :vartype ssl_profiles: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProfile] + :ivar url_path_maps: URL path map of the application gateway resource. For default limits, see + `Application Gateway limits + `_. + :vartype url_path_maps: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayUrlPathMap] + :ivar request_routing_rules: Request routing rules of the application gateway resource. + :vartype request_routing_rules: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRequestRoutingRule] + :ivar routing_rules: Routing rules of the application gateway resource. + :vartype routing_rules: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRoutingRule] + :ivar rewrite_rule_sets: Rewrite rules for the application gateway resource. + :vartype rewrite_rule_sets: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRuleSet] + :ivar redirect_configurations: Redirect configurations of the application gateway resource. For + default limits, see `Application Gateway limits + `_. + :vartype redirect_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRedirectConfiguration] + :ivar web_application_firewall_configuration: Web application firewall configuration. + :vartype web_application_firewall_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :ivar firewall_policy: Reference to the FirewallPolicy resource. + :vartype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar enable_http2: Whether HTTP2 is enabled on the application gateway resource. + :vartype enable_http2: bool + :ivar enable_fips: Whether FIPS is enabled on the application gateway resource. + :vartype enable_fips: bool + :ivar autoscale_configuration: Autoscale Configuration. + :vartype autoscale_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAutoscaleConfiguration + :ivar private_link_configurations: PrivateLink configurations on application gateway. + :vartype private_link_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :ivar resource_guid: The resource GUID property of the application gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application gateway resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar custom_error_configurations: Custom error configurations of the application gateway + resource. + :vartype custom_error_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCustomError] + :ivar force_firewall_policy_association: If true, associates a firewall policy with an + application gateway regardless whether the policy differs from the WAF Config. + :vartype force_firewall_policy_association: bool + :ivar load_distribution_policies: Load distribution policies of the application gateway + resource. + :vartype load_distribution_policies: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayLoadDistributionPolicy] + :ivar global_configuration: Global Configuration. + :vartype global_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayGlobalConfiguration + :ivar default_predefined_ssl_policy: The default predefined SSL Policy applied on the + application gateway resource. Known values are: "AppGwSslPolicy20150501", + "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S", "AppGwSslPolicy20220101", and + "AppGwSslPolicy20220101S". + :vartype default_predefined_ssl_policy: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyName + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "operational_state": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "default_predefined_ssl_policy": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "sku": {"key": "properties.sku", "type": "ApplicationGatewaySku"}, + "ssl_policy": {"key": "properties.sslPolicy", "type": "ApplicationGatewaySslPolicy"}, + "operational_state": {"key": "properties.operationalState", "type": "str"}, + "gateway_ip_configurations": { + "key": "properties.gatewayIPConfigurations", + "type": "[ApplicationGatewayIPConfiguration]", + }, + "authentication_certificates": { + "key": "properties.authenticationCertificates", + "type": "[ApplicationGatewayAuthenticationCertificate]", + }, + "trusted_root_certificates": { + "key": "properties.trustedRootCertificates", + "type": "[ApplicationGatewayTrustedRootCertificate]", + }, + "trusted_client_certificates": { + "key": "properties.trustedClientCertificates", + "type": "[ApplicationGatewayTrustedClientCertificate]", + }, + "ssl_certificates": {"key": "properties.sslCertificates", "type": "[ApplicationGatewaySslCertificate]"}, + "frontend_ip_configurations": { + "key": "properties.frontendIPConfigurations", + "type": "[ApplicationGatewayFrontendIPConfiguration]", + }, + "frontend_ports": {"key": "properties.frontendPorts", "type": "[ApplicationGatewayFrontendPort]"}, + "probes": {"key": "properties.probes", "type": "[ApplicationGatewayProbe]"}, + "backend_address_pools": { + "key": "properties.backendAddressPools", + "type": "[ApplicationGatewayBackendAddressPool]", + }, + "backend_http_settings_collection": { + "key": "properties.backendHttpSettingsCollection", + "type": "[ApplicationGatewayBackendHttpSettings]", + }, + "backend_settings_collection": { + "key": "properties.backendSettingsCollection", + "type": "[ApplicationGatewayBackendSettings]", + }, + "http_listeners": {"key": "properties.httpListeners", "type": "[ApplicationGatewayHttpListener]"}, + "listeners": {"key": "properties.listeners", "type": "[ApplicationGatewayListener]"}, + "ssl_profiles": {"key": "properties.sslProfiles", "type": "[ApplicationGatewaySslProfile]"}, + "url_path_maps": {"key": "properties.urlPathMaps", "type": "[ApplicationGatewayUrlPathMap]"}, + "request_routing_rules": { + "key": "properties.requestRoutingRules", + "type": "[ApplicationGatewayRequestRoutingRule]", + }, + "routing_rules": {"key": "properties.routingRules", "type": "[ApplicationGatewayRoutingRule]"}, + "rewrite_rule_sets": {"key": "properties.rewriteRuleSets", "type": "[ApplicationGatewayRewriteRuleSet]"}, + "redirect_configurations": { + "key": "properties.redirectConfigurations", + "type": "[ApplicationGatewayRedirectConfiguration]", + }, + "web_application_firewall_configuration": { + "key": "properties.webApplicationFirewallConfiguration", + "type": "ApplicationGatewayWebApplicationFirewallConfiguration", + }, + "firewall_policy": {"key": "properties.firewallPolicy", "type": "SubResource"}, + "enable_http2": {"key": "properties.enableHttp2", "type": "bool"}, + "enable_fips": {"key": "properties.enableFips", "type": "bool"}, + "autoscale_configuration": { + "key": "properties.autoscaleConfiguration", + "type": "ApplicationGatewayAutoscaleConfiguration", + }, + "private_link_configurations": { + "key": "properties.privateLinkConfigurations", + "type": "[ApplicationGatewayPrivateLinkConfiguration]", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[ApplicationGatewayPrivateEndpointConnection]", + }, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "custom_error_configurations": { + "key": "properties.customErrorConfigurations", + "type": "[ApplicationGatewayCustomError]", + }, + "force_firewall_policy_association": {"key": "properties.forceFirewallPolicyAssociation", "type": "bool"}, + "load_distribution_policies": { + "key": "properties.loadDistributionPolicies", + "type": "[ApplicationGatewayLoadDistributionPolicy]", + }, + "global_configuration": { + "key": "properties.globalConfiguration", + "type": "ApplicationGatewayGlobalConfiguration", + }, + "default_predefined_ssl_policy": {"key": "properties.defaultPredefinedSslPolicy", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + sku: Optional["_models.ApplicationGatewaySku"] = None, + ssl_policy: Optional["_models.ApplicationGatewaySslPolicy"] = None, + gateway_ip_configurations: Optional[List["_models.ApplicationGatewayIPConfiguration"]] = None, + authentication_certificates: Optional[List["_models.ApplicationGatewayAuthenticationCertificate"]] = None, + trusted_root_certificates: Optional[List["_models.ApplicationGatewayTrustedRootCertificate"]] = None, + trusted_client_certificates: Optional[List["_models.ApplicationGatewayTrustedClientCertificate"]] = None, + ssl_certificates: Optional[List["_models.ApplicationGatewaySslCertificate"]] = None, + frontend_ip_configurations: Optional[List["_models.ApplicationGatewayFrontendIPConfiguration"]] = None, + frontend_ports: Optional[List["_models.ApplicationGatewayFrontendPort"]] = None, + probes: Optional[List["_models.ApplicationGatewayProbe"]] = None, + backend_address_pools: Optional[List["_models.ApplicationGatewayBackendAddressPool"]] = None, + backend_http_settings_collection: Optional[List["_models.ApplicationGatewayBackendHttpSettings"]] = None, + backend_settings_collection: Optional[List["_models.ApplicationGatewayBackendSettings"]] = None, + http_listeners: Optional[List["_models.ApplicationGatewayHttpListener"]] = None, + listeners: Optional[List["_models.ApplicationGatewayListener"]] = None, + ssl_profiles: Optional[List["_models.ApplicationGatewaySslProfile"]] = None, + url_path_maps: Optional[List["_models.ApplicationGatewayUrlPathMap"]] = None, + request_routing_rules: Optional[List["_models.ApplicationGatewayRequestRoutingRule"]] = None, + routing_rules: Optional[List["_models.ApplicationGatewayRoutingRule"]] = None, + rewrite_rule_sets: Optional[List["_models.ApplicationGatewayRewriteRuleSet"]] = None, + redirect_configurations: Optional[List["_models.ApplicationGatewayRedirectConfiguration"]] = None, + web_application_firewall_configuration: Optional[ + "_models.ApplicationGatewayWebApplicationFirewallConfiguration" + ] = None, + firewall_policy: Optional["_models.SubResource"] = None, + enable_http2: Optional[bool] = None, + enable_fips: Optional[bool] = None, + autoscale_configuration: Optional["_models.ApplicationGatewayAutoscaleConfiguration"] = None, + private_link_configurations: Optional[List["_models.ApplicationGatewayPrivateLinkConfiguration"]] = None, + custom_error_configurations: Optional[List["_models.ApplicationGatewayCustomError"]] = None, + force_firewall_policy_association: Optional[bool] = None, + load_distribution_policies: Optional[List["_models.ApplicationGatewayLoadDistributionPolicy"]] = None, + global_configuration: Optional["_models.ApplicationGatewayGlobalConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword zones: A list of availability zones denoting where the resource needs to come from. + :paramtype zones: list[str] + :keyword identity: The identity of the application gateway, if configured. + :paramtype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :keyword sku: SKU of the application gateway resource. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySku + :keyword ssl_policy: SSL policy of the application gateway resource. + :paramtype ssl_policy: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicy + :keyword gateway_ip_configurations: Subnets of the application gateway resource. For default + limits, see `Application Gateway limits + `_. + :paramtype gateway_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayIPConfiguration] + :keyword authentication_certificates: Authentication certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :paramtype authentication_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAuthenticationCertificate] + :keyword trusted_root_certificates: Trusted Root certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :paramtype trusted_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTrustedRootCertificate] + :keyword trusted_client_certificates: Trusted client certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :paramtype trusted_client_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTrustedClientCertificate] + :keyword ssl_certificates: SSL certificates of the application gateway resource. For default + limits, see `Application Gateway limits + `_. + :paramtype ssl_certificates: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCertificate] + :keyword frontend_ip_configurations: Frontend IP addresses of the application gateway resource. + For default limits, see `Application Gateway limits + `_. + :paramtype frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFrontendIPConfiguration] + :keyword frontend_ports: Frontend ports of the application gateway resource. For default + limits, see `Application Gateway limits + `_. + :paramtype frontend_ports: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFrontendPort] + :keyword probes: Probes of the application gateway resource. + :paramtype probes: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProbe] + :keyword backend_address_pools: Backend address pool of the application gateway resource. For + default limits, see `Application Gateway limits + `_. + :paramtype backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool] + :keyword backend_http_settings_collection: Backend http settings of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :paramtype backend_http_settings_collection: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHttpSettings] + :keyword backend_settings_collection: Backend settings of the application gateway resource. For + default limits, see `Application Gateway limits + `_. + :paramtype backend_settings_collection: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendSettings] + :keyword http_listeners: Http listeners of the application gateway resource. For default + limits, see `Application Gateway limits + `_. + :paramtype http_listeners: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayHttpListener] + :keyword listeners: Listeners of the application gateway resource. For default limits, see + `Application Gateway limits + `_. + :paramtype listeners: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayListener] + :keyword ssl_profiles: SSL profiles of the application gateway resource. For default limits, + see `Application Gateway limits + `_. + :paramtype ssl_profiles: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProfile] + :keyword url_path_maps: URL path map of the application gateway resource. For default limits, + see `Application Gateway limits + `_. + :paramtype url_path_maps: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayUrlPathMap] + :keyword request_routing_rules: Request routing rules of the application gateway resource. + :paramtype request_routing_rules: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRequestRoutingRule] + :keyword routing_rules: Routing rules of the application gateway resource. + :paramtype routing_rules: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRoutingRule] + :keyword rewrite_rule_sets: Rewrite rules for the application gateway resource. + :paramtype rewrite_rule_sets: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRuleSet] + :keyword redirect_configurations: Redirect configurations of the application gateway resource. + For default limits, see `Application Gateway limits + `_. + :paramtype redirect_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRedirectConfiguration] + :keyword web_application_firewall_configuration: Web application firewall configuration. + :paramtype web_application_firewall_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :keyword firewall_policy: Reference to the FirewallPolicy resource. + :paramtype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword enable_http2: Whether HTTP2 is enabled on the application gateway resource. + :paramtype enable_http2: bool + :keyword enable_fips: Whether FIPS is enabled on the application gateway resource. + :paramtype enable_fips: bool + :keyword autoscale_configuration: Autoscale Configuration. + :paramtype autoscale_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAutoscaleConfiguration + :keyword private_link_configurations: PrivateLink configurations on application gateway. + :paramtype private_link_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkConfiguration] + :keyword custom_error_configurations: Custom error configurations of the application gateway + resource. + :paramtype custom_error_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCustomError] + :keyword force_firewall_policy_association: If true, associates a firewall policy with an + application gateway regardless whether the policy differs from the WAF Config. + :paramtype force_firewall_policy_association: bool + :keyword load_distribution_policies: Load distribution policies of the application gateway + resource. + :paramtype load_distribution_policies: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayLoadDistributionPolicy] + :keyword global_configuration: Global Configuration. + :paramtype global_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayGlobalConfiguration + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.zones = zones + self.identity = identity + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.trusted_root_certificates = trusted_root_certificates + self.trusted_client_certificates = trusted_client_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.backend_settings_collection = backend_settings_collection + self.http_listeners = http_listeners + self.listeners = listeners + self.ssl_profiles = ssl_profiles + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.routing_rules = routing_rules + self.rewrite_rule_sets = rewrite_rule_sets + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.firewall_policy = firewall_policy + self.enable_http2 = enable_http2 + self.enable_fips = enable_fips + self.autoscale_configuration = autoscale_configuration + self.private_link_configurations = private_link_configurations + self.private_endpoint_connections = None + self.resource_guid = None + self.provisioning_state = None + self.custom_error_configurations = custom_error_configurations + self.force_firewall_policy_association = force_firewall_policy_association + self.load_distribution_policies = load_distribution_policies + self.global_configuration = global_configuration + self.default_predefined_ssl_policy = None + + +class SubResource(_serialization.Model): + """Reference to another subresource. + + :ivar id: Resource ID. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource ID. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class ApplicationGatewayAuthenticationCertificate(SubResource): # pylint: disable=name-too-long + """Authentication certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the authentication certificate that is unique within an Application + Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar data: Certificate public data. + :vartype data: str + :ivar provisioning_state: The provisioning state of the authentication certificate resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "data": {"key": "properties.data", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + data: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the authentication certificate that is unique within an Application + Gateway. + :paramtype name: str + :keyword data: Certificate public data. + :paramtype data: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.provisioning_state = None + + +class ApplicationGatewayAutoscaleConfiguration(_serialization.Model): + """Application Gateway autoscale configuration. + + All required parameters must be populated in order to send to server. + + :ivar min_capacity: Lower bound on number of Application Gateway capacity. Required. + :vartype min_capacity: int + :ivar max_capacity: Upper bound on number of Application Gateway capacity. + :vartype max_capacity: int + """ + + _validation = { + "min_capacity": {"required": True, "minimum": 0}, + "max_capacity": {"minimum": 2}, + } + + _attribute_map = { + "min_capacity": {"key": "minCapacity", "type": "int"}, + "max_capacity": {"key": "maxCapacity", "type": "int"}, + } + + def __init__(self, *, min_capacity: int, max_capacity: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword min_capacity: Lower bound on number of Application Gateway capacity. Required. + :paramtype min_capacity: int + :keyword max_capacity: Upper bound on number of Application Gateway capacity. + :paramtype max_capacity: int + """ + super().__init__(**kwargs) + self.min_capacity = min_capacity + self.max_capacity = max_capacity + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar predefined_policies: List of available Ssl predefined policy. + :vartype predefined_policies: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar default_policy: Name of the Ssl predefined policy applied by default to application + gateway. Known values are: "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", + "AppGwSslPolicy20170401S", "AppGwSslPolicy20220101", and "AppGwSslPolicy20220101S". + :vartype default_policy: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyName + :ivar available_cipher_suites: List of available Ssl cipher suites. + :vartype available_cipher_suites: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCipherSuite] + :ivar available_protocols: List of available Ssl protocols. + :vartype available_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "predefined_policies": {"key": "properties.predefinedPolicies", "type": "[SubResource]"}, + "default_policy": {"key": "properties.defaultPolicy", "type": "str"}, + "available_cipher_suites": {"key": "properties.availableCipherSuites", "type": "[str]"}, + "available_protocols": {"key": "properties.availableProtocols", "type": "[str]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + predefined_policies: Optional[List["_models.SubResource"]] = None, + default_policy: Optional[Union[str, "_models.ApplicationGatewaySslPolicyName"]] = None, + available_cipher_suites: Optional[List[Union[str, "_models.ApplicationGatewaySslCipherSuite"]]] = None, + available_protocols: Optional[List[Union[str, "_models.ApplicationGatewaySslProtocol"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword predefined_policies: List of available Ssl predefined policy. + :paramtype predefined_policies: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword default_policy: Name of the Ssl predefined policy applied by default to application + gateway. Known values are: "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", + "AppGwSslPolicy20170401S", "AppGwSslPolicy20220101", and "AppGwSslPolicy20220101S". + :paramtype default_policy: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyName + :keyword available_cipher_suites: List of available Ssl cipher suites. + :paramtype available_cipher_suites: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCipherSuite] + :keyword available_protocols: List of available Ssl protocols. + :paramtype available_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols + + +class ApplicationGatewayAvailableSslPredefinedPolicies(_serialization.Model): # pylint: disable=name-too-long + """Response for ApplicationGatewayAvailableSslOptions API service call. + + :ivar value: List of available Ssl predefined policy. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPredefinedPolicy] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationGatewaySslPredefinedPolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationGatewaySslPredefinedPolicy"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of available Ssl predefined policy. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPredefinedPolicy] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayAvailableWafRuleSetsResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :ivar value: The list of application gateway rule sets. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationGatewayFirewallRuleSet]"}, + } + + def __init__( + self, *, value: Optional[List["_models.ApplicationGatewayFirewallRuleSet"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list of application gateway rule sets. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRuleSet] + """ + super().__init__(**kwargs) + self.value = value + + +class ApplicationGatewayBackendAddress(_serialization.Model): + """Backend address of an application gateway. + + :ivar fqdn: Fully qualified domain name (FQDN). + :vartype fqdn: str + :ivar ip_address: IP address. + :vartype ip_address: str + """ + + _attribute_map = { + "fqdn": {"key": "fqdn", "type": "str"}, + "ip_address": {"key": "ipAddress", "type": "str"}, + } + + def __init__(self, *, fqdn: Optional[str] = None, ip_address: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword fqdn: Fully qualified domain name (FQDN). + :paramtype fqdn: str + :keyword ip_address: IP address. + :paramtype ip_address: str + """ + super().__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the backend address pool that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar backend_ip_configurations: Collection of references to IPs defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :ivar backend_addresses: Backend addresses. + :vartype backend_addresses: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddress] + :ivar provisioning_state: The provisioning state of the backend address pool resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "backend_ip_configurations": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "backend_ip_configurations": { + "key": "properties.backendIPConfigurations", + "type": "[NetworkInterfaceIPConfiguration]", + }, + "backend_addresses": {"key": "properties.backendAddresses", "type": "[ApplicationGatewayBackendAddress]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + backend_addresses: Optional[List["_models.ApplicationGatewayBackendAddress"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the backend address pool that is unique within an Application Gateway. + :paramtype name: str + :keyword backend_addresses: Backend addresses. + :paramtype backend_addresses: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddress] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.backend_ip_configurations = None + self.backend_addresses = backend_addresses + self.provisioning_state = None + + +class ApplicationGatewayBackendHealth(_serialization.Model): + """Response for ApplicationGatewayBackendHealth API service call. + + :ivar backend_address_pools: A list of ApplicationGatewayBackendHealthPool resources. + :vartype backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + "backend_address_pools": {"key": "backendAddressPools", "type": "[ApplicationGatewayBackendHealthPool]"}, + } + + def __init__( + self, + *, + backend_address_pools: Optional[List["_models.ApplicationGatewayBackendHealthPool"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword backend_address_pools: A list of ApplicationGatewayBackendHealthPool resources. + :paramtype backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthPool] + """ + super().__init__(**kwargs) + self.backend_address_pools = backend_address_pools + + +class ApplicationGatewayBackendHealthHttpSettings(_serialization.Model): # pylint: disable=name-too-long + """Application gateway BackendHealthHttp settings. + + :ivar backend_http_settings: Reference to an ApplicationGatewayBackendHttpSettings resource. + :vartype backend_http_settings: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHttpSettings + :ivar servers: List of ApplicationGatewayBackendHealthServer resources. + :vartype servers: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + "backend_http_settings": {"key": "backendHttpSettings", "type": "ApplicationGatewayBackendHttpSettings"}, + "servers": {"key": "servers", "type": "[ApplicationGatewayBackendHealthServer]"}, + } + + def __init__( + self, + *, + backend_http_settings: Optional["_models.ApplicationGatewayBackendHttpSettings"] = None, + servers: Optional[List["_models.ApplicationGatewayBackendHealthServer"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword backend_http_settings: Reference to an ApplicationGatewayBackendHttpSettings resource. + :paramtype backend_http_settings: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHttpSettings + :keyword servers: List of ApplicationGatewayBackendHealthServer resources. + :paramtype servers: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthServer] + """ + super().__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers + + +class ApplicationGatewayBackendHealthOnDemand(_serialization.Model): + """Result of on demand test probe. + + :ivar backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :vartype backend_address_pool: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool + :ivar backend_health_http_settings: Application gateway BackendHealthHttp settings. + :vartype backend_health_http_settings: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthHttpSettings + """ + + _attribute_map = { + "backend_address_pool": {"key": "backendAddressPool", "type": "ApplicationGatewayBackendAddressPool"}, + "backend_health_http_settings": { + "key": "backendHealthHttpSettings", + "type": "ApplicationGatewayBackendHealthHttpSettings", + }, + } + + def __init__( + self, + *, + backend_address_pool: Optional["_models.ApplicationGatewayBackendAddressPool"] = None, + backend_health_http_settings: Optional["_models.ApplicationGatewayBackendHealthHttpSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :paramtype backend_address_pool: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool + :keyword backend_health_http_settings: Application gateway BackendHealthHttp settings. + :paramtype backend_health_http_settings: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthHttpSettings + """ + super().__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_health_http_settings = backend_health_http_settings + + +class ApplicationGatewayBackendHealthPool(_serialization.Model): + """Application gateway BackendHealth pool. + + :ivar backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :vartype backend_address_pool: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool + :ivar backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :vartype backend_http_settings_collection: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + "backend_address_pool": {"key": "backendAddressPool", "type": "ApplicationGatewayBackendAddressPool"}, + "backend_http_settings_collection": { + "key": "backendHttpSettingsCollection", + "type": "[ApplicationGatewayBackendHealthHttpSettings]", + }, + } + + def __init__( + self, + *, + backend_address_pool: Optional["_models.ApplicationGatewayBackendAddressPool"] = None, + backend_http_settings_collection: Optional[List["_models.ApplicationGatewayBackendHealthHttpSettings"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :paramtype backend_address_pool: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool + :keyword backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :paramtype backend_http_settings_collection: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + super().__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection + + +class ApplicationGatewayBackendHealthServer(_serialization.Model): + """Application gateway backendhealth http settings. + + :ivar address: IP address or FQDN of backend server. + :vartype address: str + :ivar ip_configuration: Reference to IP configuration of backend server. + :vartype ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :ivar health: Health of backend server. Known values are: "Unknown", "Up", "Down", "Partial", + and "Draining". + :vartype health: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthServerHealth + :ivar health_probe_log: Health Probe Log. + :vartype health_probe_log: str + """ + + _attribute_map = { + "address": {"key": "address", "type": "str"}, + "ip_configuration": {"key": "ipConfiguration", "type": "NetworkInterfaceIPConfiguration"}, + "health": {"key": "health", "type": "str"}, + "health_probe_log": {"key": "healthProbeLog", "type": "str"}, + } + + def __init__( + self, + *, + address: Optional[str] = None, + ip_configuration: Optional["_models.NetworkInterfaceIPConfiguration"] = None, + health: Optional[Union[str, "_models.ApplicationGatewayBackendHealthServerHealth"]] = None, + health_probe_log: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword address: IP address or FQDN of backend server. + :paramtype address: str + :keyword ip_configuration: Reference to IP configuration of backend server. + :paramtype ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :keyword health: Health of backend server. Known values are: "Unknown", "Up", "Down", + "Partial", and "Draining". + :paramtype health: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthServerHealth + :keyword health_probe_log: Health Probe Log. + :paramtype health_probe_log: str + """ + super().__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health + self.health_probe_log = health_probe_log + + +class ApplicationGatewayBackendHttpSettings(SubResource): # pylint: disable=too-many-instance-attributes + """Backend address pool settings of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the backend http settings that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar port: The destination port on the backend. + :vartype port: int + :ivar protocol: The protocol used to communicate with the backend. Known values are: "Http", + "Https", "Tcp", and "Tls". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :ivar cookie_based_affinity: Cookie based affinity. Known values are: "Enabled" and "Disabled". + :vartype cookie_based_affinity: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCookieBasedAffinity + :ivar request_timeout: Request timeout in seconds. Application Gateway will fail the request if + response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 + seconds. + :vartype request_timeout: int + :ivar probe: Probe resource of an application gateway. + :vartype probe: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar authentication_certificates: Array of references to application gateway authentication + certificates. + :vartype authentication_certificates: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar trusted_root_certificates: Array of references to application gateway trusted root + certificates. + :vartype trusted_root_certificates: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar connection_draining: Connection draining of the backend http settings resource. + :vartype connection_draining: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayConnectionDraining + :ivar host_name: Host header to be sent to the backend servers. + :vartype host_name: str + :ivar pick_host_name_from_backend_address: Whether to pick host header should be picked from + the host name of the backend server. Default value is false. + :vartype pick_host_name_from_backend_address: bool + :ivar affinity_cookie_name: Cookie name to use for the affinity cookie. + :vartype affinity_cookie_name: str + :ivar probe_enabled: Whether the probe is enabled. Default value is false. + :vartype probe_enabled: bool + :ivar path: Path which should be used as a prefix for all HTTP requests. Null means no path + will be prefixed. Default value is null. + :vartype path: str + :ivar provisioning_state: The provisioning state of the backend HTTP settings resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "properties.port", "type": "int"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "cookie_based_affinity": {"key": "properties.cookieBasedAffinity", "type": "str"}, + "request_timeout": {"key": "properties.requestTimeout", "type": "int"}, + "probe": {"key": "properties.probe", "type": "SubResource"}, + "authentication_certificates": {"key": "properties.authenticationCertificates", "type": "[SubResource]"}, + "trusted_root_certificates": {"key": "properties.trustedRootCertificates", "type": "[SubResource]"}, + "connection_draining": {"key": "properties.connectionDraining", "type": "ApplicationGatewayConnectionDraining"}, + "host_name": {"key": "properties.hostName", "type": "str"}, + "pick_host_name_from_backend_address": {"key": "properties.pickHostNameFromBackendAddress", "type": "bool"}, + "affinity_cookie_name": {"key": "properties.affinityCookieName", "type": "str"}, + "probe_enabled": {"key": "properties.probeEnabled", "type": "bool"}, + "path": {"key": "properties.path", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[Union[str, "_models.ApplicationGatewayProtocol"]] = None, + cookie_based_affinity: Optional[Union[str, "_models.ApplicationGatewayCookieBasedAffinity"]] = None, + request_timeout: Optional[int] = None, + probe: Optional["_models.SubResource"] = None, + authentication_certificates: Optional[List["_models.SubResource"]] = None, + trusted_root_certificates: Optional[List["_models.SubResource"]] = None, + connection_draining: Optional["_models.ApplicationGatewayConnectionDraining"] = None, + host_name: Optional[str] = None, + pick_host_name_from_backend_address: Optional[bool] = None, + affinity_cookie_name: Optional[str] = None, + probe_enabled: Optional[bool] = None, + path: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the backend http settings that is unique within an Application Gateway. + :paramtype name: str + :keyword port: The destination port on the backend. + :paramtype port: int + :keyword protocol: The protocol used to communicate with the backend. Known values are: "Http", + "Https", "Tcp", and "Tls". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :keyword cookie_based_affinity: Cookie based affinity. Known values are: "Enabled" and + "Disabled". + :paramtype cookie_based_affinity: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCookieBasedAffinity + :keyword request_timeout: Request timeout in seconds. Application Gateway will fail the request + if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 + seconds. + :paramtype request_timeout: int + :keyword probe: Probe resource of an application gateway. + :paramtype probe: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword authentication_certificates: Array of references to application gateway authentication + certificates. + :paramtype authentication_certificates: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword trusted_root_certificates: Array of references to application gateway trusted root + certificates. + :paramtype trusted_root_certificates: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword connection_draining: Connection draining of the backend http settings resource. + :paramtype connection_draining: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayConnectionDraining + :keyword host_name: Host header to be sent to the backend servers. + :paramtype host_name: str + :keyword pick_host_name_from_backend_address: Whether to pick host header should be picked from + the host name of the backend server. Default value is false. + :paramtype pick_host_name_from_backend_address: bool + :keyword affinity_cookie_name: Cookie name to use for the affinity cookie. + :paramtype affinity_cookie_name: str + :keyword probe_enabled: Whether the probe is enabled. Default value is false. + :paramtype probe_enabled: bool + :keyword path: Path which should be used as a prefix for all HTTP requests. Null means no path + will be prefixed. Default value is null. + :paramtype path: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.trusted_root_certificates = trusted_root_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = None + + +class ApplicationGatewayBackendSettings(SubResource): # pylint: disable=too-many-instance-attributes + """Backend address pool settings of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the backend settings that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar port: The destination port on the backend. + :vartype port: int + :ivar protocol: The protocol used to communicate with the backend. Known values are: "Http", + "Https", "Tcp", and "Tls". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :ivar timeout: Connection timeout in seconds. Application Gateway will fail the request if + response is not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 + seconds. + :vartype timeout: int + :ivar probe: Probe resource of an application gateway. + :vartype probe: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar trusted_root_certificates: Array of references to application gateway trusted root + certificates. + :vartype trusted_root_certificates: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar host_name: Server name indication to be sent to the backend servers for Tls protocol. + :vartype host_name: str + :ivar pick_host_name_from_backend_address: Whether to pick server name indication from the host + name of the backend server for Tls protocol. Default value is false. + :vartype pick_host_name_from_backend_address: bool + :ivar provisioning_state: The provisioning state of the backend HTTP settings resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "properties.port", "type": "int"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "timeout": {"key": "properties.timeout", "type": "int"}, + "probe": {"key": "properties.probe", "type": "SubResource"}, + "trusted_root_certificates": {"key": "properties.trustedRootCertificates", "type": "[SubResource]"}, + "host_name": {"key": "properties.hostName", "type": "str"}, + "pick_host_name_from_backend_address": {"key": "properties.pickHostNameFromBackendAddress", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[Union[str, "_models.ApplicationGatewayProtocol"]] = None, + timeout: Optional[int] = None, + probe: Optional["_models.SubResource"] = None, + trusted_root_certificates: Optional[List["_models.SubResource"]] = None, + host_name: Optional[str] = None, + pick_host_name_from_backend_address: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the backend settings that is unique within an Application Gateway. + :paramtype name: str + :keyword port: The destination port on the backend. + :paramtype port: int + :keyword protocol: The protocol used to communicate with the backend. Known values are: "Http", + "Https", "Tcp", and "Tls". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :keyword timeout: Connection timeout in seconds. Application Gateway will fail the request if + response is not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 + seconds. + :paramtype timeout: int + :keyword probe: Probe resource of an application gateway. + :paramtype probe: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword trusted_root_certificates: Array of references to application gateway trusted root + certificates. + :paramtype trusted_root_certificates: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword host_name: Server name indication to be sent to the backend servers for Tls protocol. + :paramtype host_name: str + :keyword pick_host_name_from_backend_address: Whether to pick server name indication from the + host name of the backend server for Tls protocol. Default value is false. + :paramtype pick_host_name_from_backend_address: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.port = port + self.protocol = protocol + self.timeout = timeout + self.probe = probe + self.trusted_root_certificates = trusted_root_certificates + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.provisioning_state = None + + +class ApplicationGatewayClientAuthConfiguration(_serialization.Model): # pylint: disable=name-too-long + """Application gateway client authentication configuration. + + :ivar verify_client_cert_issuer_dn: Verify client certificate issuer name on the application + gateway. + :vartype verify_client_cert_issuer_dn: bool + :ivar verify_client_revocation: Verify client certificate revocation status. Known values are: + "None" and "OCSP". + :vartype verify_client_revocation: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayClientRevocationOptions + """ + + _attribute_map = { + "verify_client_cert_issuer_dn": {"key": "verifyClientCertIssuerDN", "type": "bool"}, + "verify_client_revocation": {"key": "verifyClientRevocation", "type": "str"}, + } + + def __init__( + self, + *, + verify_client_cert_issuer_dn: Optional[bool] = None, + verify_client_revocation: Optional[Union[str, "_models.ApplicationGatewayClientRevocationOptions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword verify_client_cert_issuer_dn: Verify client certificate issuer name on the application + gateway. + :paramtype verify_client_cert_issuer_dn: bool + :keyword verify_client_revocation: Verify client certificate revocation status. Known values + are: "None" and "OCSP". + :paramtype verify_client_revocation: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayClientRevocationOptions + """ + super().__init__(**kwargs) + self.verify_client_cert_issuer_dn = verify_client_cert_issuer_dn + self.verify_client_revocation = verify_client_revocation + + +class ApplicationGatewayConnectionDraining(_serialization.Model): + """Connection draining allows open connections to a backend server to be active for a specified + time after the backend server got removed from the configuration. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether connection draining is enabled or not. Required. + :vartype enabled: bool + :ivar drain_timeout_in_sec: The number of seconds connection draining is active. Acceptable + values are from 1 second to 3600 seconds. Required. + :vartype drain_timeout_in_sec: int + """ + + _validation = { + "enabled": {"required": True}, + "drain_timeout_in_sec": {"required": True, "maximum": 3600, "minimum": 1}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "drain_timeout_in_sec": {"key": "drainTimeoutInSec", "type": "int"}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs: Any) -> None: + """ + :keyword enabled: Whether connection draining is enabled or not. Required. + :paramtype enabled: bool + :keyword drain_timeout_in_sec: The number of seconds connection draining is active. Acceptable + values are from 1 second to 3600 seconds. Required. + :paramtype drain_timeout_in_sec: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec + + +class ApplicationGatewayCustomError(_serialization.Model): + """Custom error of an application gateway. + + :ivar status_code: Status code of the application gateway custom error. Known values are: + "HttpStatus400", "HttpStatus403", "HttpStatus404", "HttpStatus405", "HttpStatus408", + "HttpStatus500", "HttpStatus502", "HttpStatus503", and "HttpStatus504". + :vartype status_code: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCustomErrorStatusCode + :ivar custom_error_page_url: Error page URL of the application gateway custom error. + :vartype custom_error_page_url: str + """ + + _attribute_map = { + "status_code": {"key": "statusCode", "type": "str"}, + "custom_error_page_url": {"key": "customErrorPageUrl", "type": "str"}, + } + + def __init__( + self, + *, + status_code: Optional[Union[str, "_models.ApplicationGatewayCustomErrorStatusCode"]] = None, + custom_error_page_url: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword status_code: Status code of the application gateway custom error. Known values are: + "HttpStatus400", "HttpStatus403", "HttpStatus404", "HttpStatus405", "HttpStatus408", + "HttpStatus500", "HttpStatus502", "HttpStatus503", and "HttpStatus504". + :paramtype status_code: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCustomErrorStatusCode + :keyword custom_error_page_url: Error page URL of the application gateway custom error. + :paramtype custom_error_page_url: str + """ + super().__init__(**kwargs) + self.status_code = status_code + self.custom_error_page_url = custom_error_page_url + + +class ApplicationGatewayFirewallDisabledRuleGroup(_serialization.Model): # pylint: disable=name-too-long + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to server. + + :ivar rule_group_name: The name of the rule group that will be disabled. Required. + :vartype rule_group_name: str + :ivar rules: The list of rules that will be disabled. If null, all rules of the rule group will + be disabled. + :vartype rules: list[int] + """ + + _validation = { + "rule_group_name": {"required": True}, + } + + _attribute_map = { + "rule_group_name": {"key": "ruleGroupName", "type": "str"}, + "rules": {"key": "rules", "type": "[int]"}, + } + + def __init__(self, *, rule_group_name: str, rules: Optional[List[int]] = None, **kwargs: Any) -> None: + """ + :keyword rule_group_name: The name of the rule group that will be disabled. Required. + :paramtype rule_group_name: str + :keyword rules: The list of rules that will be disabled. If null, all rules of the rule group + will be disabled. + :paramtype rules: list[int] + """ + super().__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules + + +class ApplicationGatewayFirewallExclusion(_serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to server. + + :ivar match_variable: The variable to be excluded. Required. + :vartype match_variable: str + :ivar selector_match_operator: When matchVariable is a collection, operate on the selector to + specify which elements in the collection this exclusion applies to. Required. + :vartype selector_match_operator: str + :ivar selector: When matchVariable is a collection, operator used to specify which elements in + the collection this exclusion applies to. Required. + :vartype selector: str + """ + + _validation = { + "match_variable": {"required": True}, + "selector_match_operator": {"required": True}, + "selector": {"required": True}, + } + + _attribute_map = { + "match_variable": {"key": "matchVariable", "type": "str"}, + "selector_match_operator": {"key": "selectorMatchOperator", "type": "str"}, + "selector": {"key": "selector", "type": "str"}, + } + + def __init__(self, *, match_variable: str, selector_match_operator: str, selector: str, **kwargs: Any) -> None: + """ + :keyword match_variable: The variable to be excluded. Required. + :paramtype match_variable: str + :keyword selector_match_operator: When matchVariable is a collection, operate on the selector + to specify which elements in the collection this exclusion applies to. Required. + :paramtype selector_match_operator: str + :keyword selector: When matchVariable is a collection, operator used to specify which elements + in the collection this exclusion applies to. Required. + :paramtype selector: str + """ + super().__init__(**kwargs) + self.match_variable = match_variable + self.selector_match_operator = selector_match_operator + self.selector = selector + + +class ApplicationGatewayFirewallManifestRuleSet(_serialization.Model): # pylint: disable=name-too-long + """Properties of the web application firewall rule set. + + All required parameters must be populated in order to send to server. + + :ivar rule_set_type: The type of the web application firewall rule set. Required. + :vartype rule_set_type: str + :ivar rule_set_version: The version of the web application firewall rule set type. Required. + :vartype rule_set_version: str + :ivar status: The rule set status. Known values are: "Preview", "GA", "Supported", and + "Deprecated". + :vartype status: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRuleSetStatusOptions + :ivar tiers: Tier of an application gateway that support the rule set. + :vartype tiers: list[str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTierTypes] + :ivar rule_groups: The rule groups of the web application firewall rule set. Required. + :vartype rule_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + "rule_set_type": {"required": True}, + "rule_set_version": {"required": True}, + "rule_groups": {"required": True}, + } + + _attribute_map = { + "rule_set_type": {"key": "ruleSetType", "type": "str"}, + "rule_set_version": {"key": "ruleSetVersion", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "tiers": {"key": "tiers", "type": "[str]"}, + "rule_groups": {"key": "ruleGroups", "type": "[ApplicationGatewayFirewallRuleGroup]"}, + } + + def __init__( + self, + *, + rule_set_type: str, + rule_set_version: str, + rule_groups: List["_models.ApplicationGatewayFirewallRuleGroup"], + status: Optional[Union[str, "_models.ApplicationGatewayRuleSetStatusOptions"]] = None, + tiers: Optional[List[Union[str, "_models.ApplicationGatewayTierTypes"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword rule_set_type: The type of the web application firewall rule set. Required. + :paramtype rule_set_type: str + :keyword rule_set_version: The version of the web application firewall rule set type. Required. + :paramtype rule_set_version: str + :keyword status: The rule set status. Known values are: "Preview", "GA", "Supported", and + "Deprecated". + :paramtype status: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRuleSetStatusOptions + :keyword tiers: Tier of an application gateway that support the rule set. + :paramtype tiers: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTierTypes] + :keyword rule_groups: The rule groups of the web application firewall rule set. Required. + :paramtype rule_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRuleGroup] + """ + super().__init__(**kwargs) + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.status = status + self.tiers = tiers + self.rule_groups = rule_groups + + +class ApplicationGatewayFirewallRule(_serialization.Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to server. + + :ivar rule_id: The identifier of the web application firewall rule. Required. + :vartype rule_id: int + :ivar rule_id_string: The string representation of the web application firewall rule + identifier. + :vartype rule_id_string: str + :ivar state: The string representation of the web application firewall rule state. Known values + are: "Enabled" and "Disabled". + :vartype state: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafRuleStateTypes + :ivar action: The string representation of the web application firewall rule action. Known + values are: "None", "AnomalyScoring", "Allow", "Block", and "Log". + :vartype action: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafRuleActionTypes + :ivar description: The description of the web application firewall rule. + :vartype description: str + """ + + _validation = { + "rule_id": {"required": True}, + } + + _attribute_map = { + "rule_id": {"key": "ruleId", "type": "int"}, + "rule_id_string": {"key": "ruleIdString", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + rule_id: int, + rule_id_string: Optional[str] = None, + state: Optional[Union[str, "_models.ApplicationGatewayWafRuleStateTypes"]] = None, + action: Optional[Union[str, "_models.ApplicationGatewayWafRuleActionTypes"]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword rule_id: The identifier of the web application firewall rule. Required. + :paramtype rule_id: int + :keyword rule_id_string: The string representation of the web application firewall rule + identifier. + :paramtype rule_id_string: str + :keyword state: The string representation of the web application firewall rule state. Known + values are: "Enabled" and "Disabled". + :paramtype state: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafRuleStateTypes + :keyword action: The string representation of the web application firewall rule action. Known + values are: "None", "AnomalyScoring", "Allow", "Block", and "Log". + :paramtype action: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafRuleActionTypes + :keyword description: The description of the web application firewall rule. + :paramtype description: str + """ + super().__init__(**kwargs) + self.rule_id = rule_id + self.rule_id_string = rule_id_string + self.state = state + self.action = action + self.description = description + + +class ApplicationGatewayFirewallRuleGroup(_serialization.Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to server. + + :ivar rule_group_name: The name of the web application firewall rule group. Required. + :vartype rule_group_name: str + :ivar description: The description of the web application firewall rule group. + :vartype description: str + :ivar rules: The rules of the web application firewall rule group. Required. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + "rule_group_name": {"required": True}, + "rules": {"required": True}, + } + + _attribute_map = { + "rule_group_name": {"key": "ruleGroupName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "rules": {"key": "rules", "type": "[ApplicationGatewayFirewallRule]"}, + } + + def __init__( + self, + *, + rule_group_name: str, + rules: List["_models.ApplicationGatewayFirewallRule"], + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword rule_group_name: The name of the web application firewall rule group. Required. + :paramtype rule_group_name: str + :keyword description: The description of the web application firewall rule group. + :paramtype description: str + :keyword rules: The rules of the web application firewall rule group. Required. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRule] + """ + super().__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the web application firewall rule set. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar rule_set_type: The type of the web application firewall rule set. + :vartype rule_set_type: str + :ivar rule_set_version: The version of the web application firewall rule set type. + :vartype rule_set_version: str + :ivar rule_groups: The rule groups of the web application firewall rule set. + :vartype rule_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRuleGroup] + :ivar tiers: Tier of an application gateway that support the rule set. + :vartype tiers: list[str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTierTypes] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "rule_set_type": {"key": "properties.ruleSetType", "type": "str"}, + "rule_set_version": {"key": "properties.ruleSetVersion", "type": "str"}, + "rule_groups": {"key": "properties.ruleGroups", "type": "[ApplicationGatewayFirewallRuleGroup]"}, + "tiers": {"key": "properties.tiers", "type": "[str]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + rule_set_type: Optional[str] = None, + rule_set_version: Optional[str] = None, + rule_groups: Optional[List["_models.ApplicationGatewayFirewallRuleGroup"]] = None, + tiers: Optional[List[Union[str, "_models.ApplicationGatewayTierTypes"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword rule_set_type: The type of the web application firewall rule set. + :paramtype rule_set_type: str + :keyword rule_set_version: The version of the web application firewall rule set type. + :paramtype rule_set_version: str + :keyword rule_groups: The rule groups of the web application firewall rule set. + :paramtype rule_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRuleGroup] + :keyword tiers: Tier of an application gateway that support the rule set. + :paramtype tiers: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTierTypes] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups + self.tiers = tiers + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): # pylint: disable=name-too-long + """Frontend IP configuration of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the frontend IP configuration that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_ip_address: PrivateIPAddress of the network interface IP Configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar subnet: Reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar public_ip_address: Reference to the PublicIP resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar private_link_configuration: Reference to the application gateway private link + configuration. + :vartype private_link_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the frontend IP configuration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "SubResource"}, + "private_link_configuration": {"key": "properties.privateLinkConfiguration", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + subnet: Optional["_models.SubResource"] = None, + public_ip_address: Optional["_models.SubResource"] = None, + private_link_configuration: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the frontend IP configuration that is unique within an Application + Gateway. + :paramtype name: str + :keyword private_ip_address: PrivateIPAddress of the network interface IP Configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword subnet: Reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword public_ip_address: Reference to the PublicIP resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword private_link_configuration: Reference to the application gateway private link + configuration. + :paramtype private_link_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.private_link_configuration = private_link_configuration + self.provisioning_state = None + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the frontend port that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar port: Frontend port. + :vartype port: int + :ivar provisioning_state: The provisioning state of the frontend port resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "properties.port", "type": "int"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the frontend port that is unique within an Application Gateway. + :paramtype name: str + :keyword port: Frontend port. + :paramtype port: int + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.port = port + self.provisioning_state = None + + +class ApplicationGatewayGlobalConfiguration(_serialization.Model): + """Application Gateway global configuration. + + :ivar enable_request_buffering: Enable request buffering. + :vartype enable_request_buffering: bool + :ivar enable_response_buffering: Enable response buffering. + :vartype enable_response_buffering: bool + """ + + _attribute_map = { + "enable_request_buffering": {"key": "enableRequestBuffering", "type": "bool"}, + "enable_response_buffering": {"key": "enableResponseBuffering", "type": "bool"}, + } + + def __init__( + self, + *, + enable_request_buffering: Optional[bool] = None, + enable_response_buffering: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword enable_request_buffering: Enable request buffering. + :paramtype enable_request_buffering: bool + :keyword enable_response_buffering: Enable response buffering. + :paramtype enable_response_buffering: bool + """ + super().__init__(**kwargs) + self.enable_request_buffering = enable_request_buffering + self.enable_response_buffering = enable_response_buffering + + +class ApplicationGatewayHeaderConfiguration(_serialization.Model): + """Header configuration of the Actions set in Application Gateway. + + :ivar header_name: Header name of the header configuration. + :vartype header_name: str + :ivar header_value: Header value of the header configuration. + :vartype header_value: str + """ + + _attribute_map = { + "header_name": {"key": "headerName", "type": "str"}, + "header_value": {"key": "headerValue", "type": "str"}, + } + + def __init__(self, *, header_name: Optional[str] = None, header_value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword header_name: Header name of the header configuration. + :paramtype header_name: str + :keyword header_value: Header value of the header configuration. + :paramtype header_value: str + """ + super().__init__(**kwargs) + self.header_name = header_name + self.header_value = header_value + + +class ApplicationGatewayHttpListener(SubResource): # pylint: disable=too-many-instance-attributes + """Http listener of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the HTTP listener that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar frontend_ip_configuration: Frontend IP configuration resource of an application gateway. + :vartype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar frontend_port: Frontend port resource of an application gateway. + :vartype frontend_port: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar protocol: Protocol of the HTTP listener. Known values are: "Http", "Https", "Tcp", and + "Tls". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :ivar host_name: Host name of HTTP listener. + :vartype host_name: str + :ivar ssl_certificate: SSL certificate resource of an application gateway. + :vartype ssl_certificate: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar ssl_profile: SSL profile resource of the application gateway. + :vartype ssl_profile: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar require_server_name_indication: Applicable only if protocol is https. Enables SNI for + multi-hosting. + :vartype require_server_name_indication: bool + :ivar provisioning_state: The provisioning state of the HTTP listener resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar custom_error_configurations: Custom error configurations of the HTTP listener. + :vartype custom_error_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCustomError] + :ivar firewall_policy: Reference to the FirewallPolicy resource. + :vartype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar host_names: List of Host names for HTTP Listener that allows special wildcard characters + as well. + :vartype host_names: list[str] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "frontend_ip_configuration": {"key": "properties.frontendIPConfiguration", "type": "SubResource"}, + "frontend_port": {"key": "properties.frontendPort", "type": "SubResource"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "host_name": {"key": "properties.hostName", "type": "str"}, + "ssl_certificate": {"key": "properties.sslCertificate", "type": "SubResource"}, + "ssl_profile": {"key": "properties.sslProfile", "type": "SubResource"}, + "require_server_name_indication": {"key": "properties.requireServerNameIndication", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "custom_error_configurations": { + "key": "properties.customErrorConfigurations", + "type": "[ApplicationGatewayCustomError]", + }, + "firewall_policy": {"key": "properties.firewallPolicy", "type": "SubResource"}, + "host_names": {"key": "properties.hostNames", "type": "[str]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + frontend_ip_configuration: Optional["_models.SubResource"] = None, + frontend_port: Optional["_models.SubResource"] = None, + protocol: Optional[Union[str, "_models.ApplicationGatewayProtocol"]] = None, + host_name: Optional[str] = None, + ssl_certificate: Optional["_models.SubResource"] = None, + ssl_profile: Optional["_models.SubResource"] = None, + require_server_name_indication: Optional[bool] = None, + custom_error_configurations: Optional[List["_models.ApplicationGatewayCustomError"]] = None, + firewall_policy: Optional["_models.SubResource"] = None, + host_names: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the HTTP listener that is unique within an Application Gateway. + :paramtype name: str + :keyword frontend_ip_configuration: Frontend IP configuration resource of an application + gateway. + :paramtype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword frontend_port: Frontend port resource of an application gateway. + :paramtype frontend_port: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword protocol: Protocol of the HTTP listener. Known values are: "Http", "Https", "Tcp", and + "Tls". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :keyword host_name: Host name of HTTP listener. + :paramtype host_name: str + :keyword ssl_certificate: SSL certificate resource of an application gateway. + :paramtype ssl_certificate: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword ssl_profile: SSL profile resource of the application gateway. + :paramtype ssl_profile: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword require_server_name_indication: Applicable only if protocol is https. Enables SNI for + multi-hosting. + :paramtype require_server_name_indication: bool + :keyword custom_error_configurations: Custom error configurations of the HTTP listener. + :paramtype custom_error_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayCustomError] + :keyword firewall_policy: Reference to the FirewallPolicy resource. + :paramtype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword host_names: List of Host names for HTTP Listener that allows special wildcard + characters as well. + :paramtype host_names: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.ssl_profile = ssl_profile + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = None + self.custom_error_configurations = custom_error_configurations + self.firewall_policy = firewall_policy + self.host_names = host_names + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 private IP configuration + is allowed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the IP configuration that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar subnet: Reference to the subnet resource. A subnet from where application gateway gets + its private address. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the application gateway IP configuration + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + subnet: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the IP configuration that is unique within an Application Gateway. + :paramtype name: str + :keyword subnet: Reference to the subnet resource. A subnet from where application gateway gets + its private address. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.subnet = subnet + self.provisioning_state = None + + +class ApplicationGatewayListener(SubResource): # pylint: disable=too-many-instance-attributes + """Listener of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the listener that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar frontend_ip_configuration: Frontend IP configuration resource of an application gateway. + :vartype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar frontend_port: Frontend port resource of an application gateway. + :vartype frontend_port: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar protocol: Protocol of the listener. Known values are: "Http", "Https", "Tcp", and "Tls". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :ivar ssl_certificate: SSL certificate resource of an application gateway. + :vartype ssl_certificate: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar ssl_profile: SSL profile resource of the application gateway. + :vartype ssl_profile: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the listener resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar host_names: List of Server Name Indications(SNI) for TLS Multi-site Listener that allows + special wildcard characters as well. + :vartype host_names: list[str] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "frontend_ip_configuration": {"key": "properties.frontendIPConfiguration", "type": "SubResource"}, + "frontend_port": {"key": "properties.frontendPort", "type": "SubResource"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "ssl_certificate": {"key": "properties.sslCertificate", "type": "SubResource"}, + "ssl_profile": {"key": "properties.sslProfile", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "host_names": {"key": "properties.hostNames", "type": "[str]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + frontend_ip_configuration: Optional["_models.SubResource"] = None, + frontend_port: Optional["_models.SubResource"] = None, + protocol: Optional[Union[str, "_models.ApplicationGatewayProtocol"]] = None, + ssl_certificate: Optional["_models.SubResource"] = None, + ssl_profile: Optional["_models.SubResource"] = None, + host_names: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the listener that is unique within an Application Gateway. + :paramtype name: str + :keyword frontend_ip_configuration: Frontend IP configuration resource of an application + gateway. + :paramtype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword frontend_port: Frontend port resource of an application gateway. + :paramtype frontend_port: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword protocol: Protocol of the listener. Known values are: "Http", "Https", "Tcp", and + "Tls". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :keyword ssl_certificate: SSL certificate resource of an application gateway. + :paramtype ssl_certificate: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword ssl_profile: SSL profile resource of the application gateway. + :paramtype ssl_profile: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword host_names: List of Server Name Indications(SNI) for TLS Multi-site Listener that + allows special wildcard characters as well. + :paramtype host_names: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.ssl_certificate = ssl_certificate + self.ssl_profile = ssl_profile + self.provisioning_state = None + self.host_names = host_names + + +class ApplicationGatewayListResult(_serialization.Model): + """Response for ListApplicationGateways API service call. + + :ivar value: List of an application gateways in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationGateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationGateway"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of an application gateways in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayLoadDistributionPolicy(SubResource): + """Load Distribution Policy of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the load distribution policy that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar load_distribution_targets: Load Distribution Targets resource of an application gateway. + :vartype load_distribution_targets: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayLoadDistributionTarget] + :ivar load_distribution_algorithm: Load Distribution Targets resource of an application + gateway. Known values are: "RoundRobin", "LeastConnections", and "IpHash". + :vartype load_distribution_algorithm: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayLoadDistributionAlgorithm + :ivar provisioning_state: The provisioning state of the Load Distribution Policy resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "load_distribution_targets": { + "key": "properties.loadDistributionTargets", + "type": "[ApplicationGatewayLoadDistributionTarget]", + }, + "load_distribution_algorithm": {"key": "properties.loadDistributionAlgorithm", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + load_distribution_targets: Optional[List["_models.ApplicationGatewayLoadDistributionTarget"]] = None, + load_distribution_algorithm: Optional[Union[str, "_models.ApplicationGatewayLoadDistributionAlgorithm"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the load distribution policy that is unique within an Application + Gateway. + :paramtype name: str + :keyword load_distribution_targets: Load Distribution Targets resource of an application + gateway. + :paramtype load_distribution_targets: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayLoadDistributionTarget] + :keyword load_distribution_algorithm: Load Distribution Targets resource of an application + gateway. Known values are: "RoundRobin", "LeastConnections", and "IpHash". + :paramtype load_distribution_algorithm: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayLoadDistributionAlgorithm + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.load_distribution_targets = load_distribution_targets + self.load_distribution_algorithm = load_distribution_algorithm + self.provisioning_state = None + + +class ApplicationGatewayLoadDistributionTarget(SubResource): + """Load Distribution Target of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the load distribution policy that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar weight_per_server: Weight per server. Range between 1 and 100. + :vartype weight_per_server: int + :ivar backend_address_pool: Backend address pool resource of the application gateway. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "weight_per_server": {"maximum": 100, "minimum": 1}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "weight_per_server": {"key": "properties.weightPerServer", "type": "int"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + weight_per_server: Optional[int] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the load distribution policy that is unique within an Application + Gateway. + :paramtype name: str + :keyword weight_per_server: Weight per server. Range between 1 and 100. + :paramtype weight_per_server: int + :keyword backend_address_pool: Backend address pool resource of the application gateway. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.weight_per_server = weight_per_server + self.backend_address_pool = backend_address_pool + + +class ApplicationGatewayOnDemandProbe(_serialization.Model): + """Details of on demand test probe request. + + :ivar protocol: The protocol used for the probe. Known values are: "Http", "Https", "Tcp", and + "Tls". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :ivar host: Host name to send the probe to. + :vartype host: str + :ivar path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :vartype path: str + :ivar timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :vartype timeout: int + :ivar pick_host_name_from_backend_http_settings: Whether the host header should be picked from + the backend http settings. Default value is false. + :vartype pick_host_name_from_backend_http_settings: bool + :ivar match: Criterion for classifying a healthy probe response. + :vartype match: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProbeHealthResponseMatch + :ivar backend_address_pool: Reference to backend pool of application gateway to which probe + request will be sent. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_http_settings: Reference to backend http setting of application gateway to be + used for test probe. + :vartype backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "protocol": {"key": "protocol", "type": "str"}, + "host": {"key": "host", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "timeout": {"key": "timeout", "type": "int"}, + "pick_host_name_from_backend_http_settings": {"key": "pickHostNameFromBackendHttpSettings", "type": "bool"}, + "match": {"key": "match", "type": "ApplicationGatewayProbeHealthResponseMatch"}, + "backend_address_pool": {"key": "backendAddressPool", "type": "SubResource"}, + "backend_http_settings": {"key": "backendHttpSettings", "type": "SubResource"}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "_models.ApplicationGatewayProtocol"]] = None, + host: Optional[str] = None, + path: Optional[str] = None, + timeout: Optional[int] = None, + pick_host_name_from_backend_http_settings: Optional[bool] = None, + match: Optional["_models.ApplicationGatewayProbeHealthResponseMatch"] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + backend_http_settings: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword protocol: The protocol used for the probe. Known values are: "Http", "Https", "Tcp", + and "Tls". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :keyword host: Host name to send the probe to. + :paramtype host: str + :keyword path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :paramtype path: str + :keyword timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :paramtype timeout: int + :keyword pick_host_name_from_backend_http_settings: Whether the host header should be picked + from the backend http settings. Default value is false. + :paramtype pick_host_name_from_backend_http_settings: bool + :keyword match: Criterion for classifying a healthy probe response. + :paramtype match: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProbeHealthResponseMatch + :keyword backend_address_pool: Reference to backend pool of application gateway to which probe + request will be sent. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword backend_http_settings: Reference to backend http setting of application gateway to be + used for test probe. + :paramtype backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.timeout = timeout + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.match = match + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + + +class ApplicationGatewayPathRule(SubResource): # pylint: disable=too-many-instance-attributes + """Path rule of URL path map of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the path rule that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar paths: Path rules of URL path map. + :vartype paths: list[str] + :ivar backend_address_pool: Backend address pool resource of URL path map path rule. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_http_settings: Backend http settings resource of URL path map path rule. + :vartype backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar redirect_configuration: Redirect configuration resource of URL path map path rule. + :vartype redirect_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar rewrite_rule_set: Rewrite rule set resource of URL path map path rule. + :vartype rewrite_rule_set: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar load_distribution_policy: Load Distribution Policy resource of URL path map path rule. + :vartype load_distribution_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the path rule resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar firewall_policy: Reference to the FirewallPolicy resource. + :vartype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "paths": {"key": "properties.paths", "type": "[str]"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + "backend_http_settings": {"key": "properties.backendHttpSettings", "type": "SubResource"}, + "redirect_configuration": {"key": "properties.redirectConfiguration", "type": "SubResource"}, + "rewrite_rule_set": {"key": "properties.rewriteRuleSet", "type": "SubResource"}, + "load_distribution_policy": {"key": "properties.loadDistributionPolicy", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "firewall_policy": {"key": "properties.firewallPolicy", "type": "SubResource"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + paths: Optional[List[str]] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + backend_http_settings: Optional["_models.SubResource"] = None, + redirect_configuration: Optional["_models.SubResource"] = None, + rewrite_rule_set: Optional["_models.SubResource"] = None, + load_distribution_policy: Optional["_models.SubResource"] = None, + firewall_policy: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the path rule that is unique within an Application Gateway. + :paramtype name: str + :keyword paths: Path rules of URL path map. + :paramtype paths: list[str] + :keyword backend_address_pool: Backend address pool resource of URL path map path rule. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword backend_http_settings: Backend http settings resource of URL path map path rule. + :paramtype backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword redirect_configuration: Redirect configuration resource of URL path map path rule. + :paramtype redirect_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword rewrite_rule_set: Rewrite rule set resource of URL path map path rule. + :paramtype rewrite_rule_set: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword load_distribution_policy: Load Distribution Policy resource of URL path map path rule. + :paramtype load_distribution_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword firewall_policy: Reference to the FirewallPolicy resource. + :paramtype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.rewrite_rule_set = rewrite_rule_set + self.load_distribution_policy = load_distribution_policy + self.provisioning_state = None + self.firewall_policy = firewall_policy + + +class ApplicationGatewayPrivateEndpointConnection(SubResource): # pylint: disable=name-too-long + """Private Endpoint connection on an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the private endpoint connection on an application gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the application gateway private endpoint + connection resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar link_identifier: The consumer link id. + :vartype link_identifier: str + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "private_endpoint": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "link_identifier": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "link_identifier": {"key": "properties.linkIdentifier", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the private endpoint connection on an application gateway. + :paramtype name: str + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnectionState + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_endpoint = None + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + self.link_identifier = None + + +class ApplicationGatewayPrivateEndpointConnectionListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private + endpoint connections for an application gateway. + + :ivar value: List of private endpoint connections on an application gateway. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationGatewayPrivateEndpointConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationGatewayPrivateEndpointConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of private endpoint connections on an application gateway. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayPrivateLinkConfiguration(SubResource): # pylint: disable=name-too-long + """Private Link Configuration on an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the private link configuration that is unique within an Application + Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar ip_configurations: An array of application gateway private link ip configurations. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkIpConfiguration] + :ivar provisioning_state: The provisioning state of the application gateway private link + configuration. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "ip_configurations": { + "key": "properties.ipConfigurations", + "type": "[ApplicationGatewayPrivateLinkIpConfiguration]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + ip_configurations: Optional[List["_models.ApplicationGatewayPrivateLinkIpConfiguration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the private link configuration that is unique within an Application + Gateway. + :paramtype name: str + :keyword ip_configurations: An array of application gateway private link ip configurations. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkIpConfiguration] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.ip_configurations = ip_configurations + self.provisioning_state = None + + +class ApplicationGatewayPrivateLinkIpConfiguration(SubResource): # pylint: disable=name-too-long + """The application gateway private link ip configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of application gateway private link ip configuration. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + :ivar private_ip_address: The private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar subnet: Reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar primary: Whether the ip configuration is primary or not. + :vartype primary: bool + :ivar provisioning_state: The provisioning state of the application gateway private link IP + configuration. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "primary": {"key": "properties.primary", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + subnet: Optional["_models.SubResource"] = None, + primary: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of application gateway private link ip configuration. + :paramtype name: str + :keyword private_ip_address: The private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword subnet: Reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword primary: Whether the ip configuration is primary or not. + :paramtype primary: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.primary = primary + self.provisioning_state = None + + +class ApplicationGatewayPrivateLinkResource(SubResource): + """PrivateLink Resource of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the private link resource that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar group_id: Group identifier of private link resource. + :vartype group_id: str + :ivar required_members: Required member names of private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: Required DNS zone names of the the private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, + "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the private link resource that is unique within an Application Gateway. + :paramtype name: str + :keyword required_zone_names: Required DNS zone names of the the private link resource. + :paramtype required_zone_names: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class ApplicationGatewayPrivateLinkResourceListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link + resources for an application gateway. + + :ivar value: List of private link resources of an application gateway. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkResource] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationGatewayPrivateLinkResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationGatewayPrivateLinkResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of private link resources of an application gateway. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkResource] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayProbe(SubResource): # pylint: disable=too-many-instance-attributes + """Probe of the application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the probe that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar protocol: The protocol used for the probe. Known values are: "Http", "Https", "Tcp", and + "Tls". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :ivar host: Host name to send the probe to. + :vartype host: str + :ivar path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :vartype path: str + :ivar interval: The probing interval in seconds. This is the time interval between two + consecutive probes. Acceptable values are from 1 second to 86400 seconds. + :vartype interval: int + :ivar timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :vartype timeout: int + :ivar unhealthy_threshold: The probe retry count. Backend server is marked down after + consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second + to 20. + :vartype unhealthy_threshold: int + :ivar pick_host_name_from_backend_http_settings: Whether the host header should be picked from + the backend http settings. Default value is false. + :vartype pick_host_name_from_backend_http_settings: bool + :ivar pick_host_name_from_backend_settings: Whether the server name indication should be picked + from the backend settings for Tls protocol. Default value is false. + :vartype pick_host_name_from_backend_settings: bool + :ivar min_servers: Minimum number of servers that are always marked healthy. Default value is + 0. + :vartype min_servers: int + :ivar match: Criterion for classifying a healthy probe response. + :vartype match: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProbeHealthResponseMatch + :ivar provisioning_state: The provisioning state of the probe resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar port: Custom port which will be used for probing the backend servers. The valid value + ranges from 1 to 65535. In case not set, port from http settings will be used. This property is + valid for Basic, Standard_v2 and WAF_v2 only. + :vartype port: int + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "port": {"maximum": 65535, "minimum": 1}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "host": {"key": "properties.host", "type": "str"}, + "path": {"key": "properties.path", "type": "str"}, + "interval": {"key": "properties.interval", "type": "int"}, + "timeout": {"key": "properties.timeout", "type": "int"}, + "unhealthy_threshold": {"key": "properties.unhealthyThreshold", "type": "int"}, + "pick_host_name_from_backend_http_settings": { + "key": "properties.pickHostNameFromBackendHttpSettings", + "type": "bool", + }, + "pick_host_name_from_backend_settings": {"key": "properties.pickHostNameFromBackendSettings", "type": "bool"}, + "min_servers": {"key": "properties.minServers", "type": "int"}, + "match": {"key": "properties.match", "type": "ApplicationGatewayProbeHealthResponseMatch"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "port": {"key": "properties.port", "type": "int"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + protocol: Optional[Union[str, "_models.ApplicationGatewayProtocol"]] = None, + host: Optional[str] = None, + path: Optional[str] = None, + interval: Optional[int] = None, + timeout: Optional[int] = None, + unhealthy_threshold: Optional[int] = None, + pick_host_name_from_backend_http_settings: Optional[bool] = None, + pick_host_name_from_backend_settings: Optional[bool] = None, + min_servers: Optional[int] = None, + match: Optional["_models.ApplicationGatewayProbeHealthResponseMatch"] = None, + port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the probe that is unique within an Application Gateway. + :paramtype name: str + :keyword protocol: The protocol used for the probe. Known values are: "Http", "Https", "Tcp", + and "Tls". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProtocol + :keyword host: Host name to send the probe to. + :paramtype host: str + :keyword path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :paramtype path: str + :keyword interval: The probing interval in seconds. This is the time interval between two + consecutive probes. Acceptable values are from 1 second to 86400 seconds. + :paramtype interval: int + :keyword timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :paramtype timeout: int + :keyword unhealthy_threshold: The probe retry count. Backend server is marked down after + consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second + to 20. + :paramtype unhealthy_threshold: int + :keyword pick_host_name_from_backend_http_settings: Whether the host header should be picked + from the backend http settings. Default value is false. + :paramtype pick_host_name_from_backend_http_settings: bool + :keyword pick_host_name_from_backend_settings: Whether the server name indication should be + picked from the backend settings for Tls protocol. Default value is false. + :paramtype pick_host_name_from_backend_settings: bool + :keyword min_servers: Minimum number of servers that are always marked healthy. Default value + is 0. + :paramtype min_servers: int + :keyword match: Criterion for classifying a healthy probe response. + :paramtype match: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayProbeHealthResponseMatch + :keyword port: Custom port which will be used for probing the backend servers. The valid value + ranges from 1 to 65535. In case not set, port from http settings will be used. This property is + valid for Basic, Standard_v2 and WAF_v2 only. + :paramtype port: int + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.pick_host_name_from_backend_settings = pick_host_name_from_backend_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = None + self.port = port + + +class ApplicationGatewayProbeHealthResponseMatch(_serialization.Model): # pylint: disable=name-too-long + """Application gateway probe health response match. + + :ivar body: Body that must be contained in the health response. Default value is empty. + :vartype body: str + :ivar status_codes: Allowed ranges of healthy status codes. Default range of healthy status + codes is 200-399. + :vartype status_codes: list[str] + """ + + _attribute_map = { + "body": {"key": "body", "type": "str"}, + "status_codes": {"key": "statusCodes", "type": "[str]"}, + } + + def __init__(self, *, body: Optional[str] = None, status_codes: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword body: Body that must be contained in the health response. Default value is empty. + :paramtype body: str + :keyword status_codes: Allowed ranges of healthy status codes. Default range of healthy status + codes is 200-399. + :paramtype status_codes: list[str] + """ + super().__init__(**kwargs) + self.body = body + self.status_codes = status_codes + + +class ApplicationGatewayRedirectConfiguration(SubResource): # pylint: disable=too-many-instance-attributes + """Redirect configuration of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the redirect configuration that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar redirect_type: HTTP redirection type. Known values are: "Permanent", "Found", "SeeOther", + and "Temporary". + :vartype redirect_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRedirectType + :ivar target_listener: Reference to a listener to redirect the request to. + :vartype target_listener: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar target_url: Url to redirect the request to. + :vartype target_url: str + :ivar include_path: Include path in the redirected url. + :vartype include_path: bool + :ivar include_query_string: Include query string in the redirected url. + :vartype include_query_string: bool + :ivar request_routing_rules: Request routing specifying redirect configuration. + :vartype request_routing_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar url_path_maps: Url path maps specifying default redirect configuration. + :vartype url_path_maps: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar path_rules: Path rules specifying redirect configuration. + :vartype path_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "redirect_type": {"key": "properties.redirectType", "type": "str"}, + "target_listener": {"key": "properties.targetListener", "type": "SubResource"}, + "target_url": {"key": "properties.targetUrl", "type": "str"}, + "include_path": {"key": "properties.includePath", "type": "bool"}, + "include_query_string": {"key": "properties.includeQueryString", "type": "bool"}, + "request_routing_rules": {"key": "properties.requestRoutingRules", "type": "[SubResource]"}, + "url_path_maps": {"key": "properties.urlPathMaps", "type": "[SubResource]"}, + "path_rules": {"key": "properties.pathRules", "type": "[SubResource]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + redirect_type: Optional[Union[str, "_models.ApplicationGatewayRedirectType"]] = None, + target_listener: Optional["_models.SubResource"] = None, + target_url: Optional[str] = None, + include_path: Optional[bool] = None, + include_query_string: Optional[bool] = None, + request_routing_rules: Optional[List["_models.SubResource"]] = None, + url_path_maps: Optional[List["_models.SubResource"]] = None, + path_rules: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the redirect configuration that is unique within an Application Gateway. + :paramtype name: str + :keyword redirect_type: HTTP redirection type. Known values are: "Permanent", "Found", + "SeeOther", and "Temporary". + :paramtype redirect_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRedirectType + :keyword target_listener: Reference to a listener to redirect the request to. + :paramtype target_listener: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword target_url: Url to redirect the request to. + :paramtype target_url: str + :keyword include_path: Include path in the redirected url. + :paramtype include_path: bool + :keyword include_query_string: Include query string in the redirected url. + :paramtype include_query_string: bool + :keyword request_routing_rules: Request routing specifying redirect configuration. + :paramtype request_routing_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword url_path_maps: Url path maps specifying default redirect configuration. + :paramtype url_path_maps: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword path_rules: Path rules specifying redirect configuration. + :paramtype path_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + + +class ApplicationGatewayRequestRoutingRule(SubResource): # pylint: disable=too-many-instance-attributes + """Request routing rule of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the request routing rule that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar rule_type: Rule type. Known values are: "Basic" and "PathBasedRouting". + :vartype rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRequestRoutingRuleType + :ivar priority: Priority of the request routing rule. + :vartype priority: int + :ivar backend_address_pool: Backend address pool resource of the application gateway. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_http_settings: Backend http settings resource of the application gateway. + :vartype backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar http_listener: Http listener resource of the application gateway. + :vartype http_listener: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar url_path_map: URL path map resource of the application gateway. + :vartype url_path_map: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar rewrite_rule_set: Rewrite Rule Set resource in Basic rule of the application gateway. + :vartype rewrite_rule_set: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar redirect_configuration: Redirect configuration resource of the application gateway. + :vartype redirect_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar load_distribution_policy: Load Distribution Policy resource of the application gateway. + :vartype load_distribution_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the request routing rule resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "priority": {"maximum": 20000, "minimum": 1}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "rule_type": {"key": "properties.ruleType", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + "backend_http_settings": {"key": "properties.backendHttpSettings", "type": "SubResource"}, + "http_listener": {"key": "properties.httpListener", "type": "SubResource"}, + "url_path_map": {"key": "properties.urlPathMap", "type": "SubResource"}, + "rewrite_rule_set": {"key": "properties.rewriteRuleSet", "type": "SubResource"}, + "redirect_configuration": {"key": "properties.redirectConfiguration", "type": "SubResource"}, + "load_distribution_policy": {"key": "properties.loadDistributionPolicy", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + rule_type: Optional[Union[str, "_models.ApplicationGatewayRequestRoutingRuleType"]] = None, + priority: Optional[int] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + backend_http_settings: Optional["_models.SubResource"] = None, + http_listener: Optional["_models.SubResource"] = None, + url_path_map: Optional["_models.SubResource"] = None, + rewrite_rule_set: Optional["_models.SubResource"] = None, + redirect_configuration: Optional["_models.SubResource"] = None, + load_distribution_policy: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the request routing rule that is unique within an Application Gateway. + :paramtype name: str + :keyword rule_type: Rule type. Known values are: "Basic" and "PathBasedRouting". + :paramtype rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRequestRoutingRuleType + :keyword priority: Priority of the request routing rule. + :paramtype priority: int + :keyword backend_address_pool: Backend address pool resource of the application gateway. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword backend_http_settings: Backend http settings resource of the application gateway. + :paramtype backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword http_listener: Http listener resource of the application gateway. + :paramtype http_listener: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword url_path_map: URL path map resource of the application gateway. + :paramtype url_path_map: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword rewrite_rule_set: Rewrite Rule Set resource in Basic rule of the application gateway. + :paramtype rewrite_rule_set: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword redirect_configuration: Redirect configuration resource of the application gateway. + :paramtype redirect_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword load_distribution_policy: Load Distribution Policy resource of the application + gateway. + :paramtype load_distribution_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.rule_type = rule_type + self.priority = priority + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.rewrite_rule_set = rewrite_rule_set + self.redirect_configuration = redirect_configuration + self.load_distribution_policy = load_distribution_policy + self.provisioning_state = None + + +class ApplicationGatewayRewriteRule(_serialization.Model): + """Rewrite rule of an application gateway. + + :ivar name: Name of the rewrite rule that is unique within an Application Gateway. + :vartype name: str + :ivar rule_sequence: Rule Sequence of the rewrite rule that determines the order of execution + of a particular rule in a RewriteRuleSet. + :vartype rule_sequence: int + :ivar conditions: Conditions based on which the action set execution will be evaluated. + :vartype conditions: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRuleCondition] + :ivar action_set: Set of actions to be done as part of the rewrite Rule. + :vartype action_set: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRuleActionSet + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "rule_sequence": {"key": "ruleSequence", "type": "int"}, + "conditions": {"key": "conditions", "type": "[ApplicationGatewayRewriteRuleCondition]"}, + "action_set": {"key": "actionSet", "type": "ApplicationGatewayRewriteRuleActionSet"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + rule_sequence: Optional[int] = None, + conditions: Optional[List["_models.ApplicationGatewayRewriteRuleCondition"]] = None, + action_set: Optional["_models.ApplicationGatewayRewriteRuleActionSet"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the rewrite rule that is unique within an Application Gateway. + :paramtype name: str + :keyword rule_sequence: Rule Sequence of the rewrite rule that determines the order of + execution of a particular rule in a RewriteRuleSet. + :paramtype rule_sequence: int + :keyword conditions: Conditions based on which the action set execution will be evaluated. + :paramtype conditions: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRuleCondition] + :keyword action_set: Set of actions to be done as part of the rewrite Rule. + :paramtype action_set: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRuleActionSet + """ + super().__init__(**kwargs) + self.name = name + self.rule_sequence = rule_sequence + self.conditions = conditions + self.action_set = action_set + + +class ApplicationGatewayRewriteRuleActionSet(_serialization.Model): + """Set of actions in the Rewrite Rule in Application Gateway. + + :ivar request_header_configurations: Request Header Actions in the Action Set. + :vartype request_header_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayHeaderConfiguration] + :ivar response_header_configurations: Response Header Actions in the Action Set. + :vartype response_header_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayHeaderConfiguration] + :ivar url_configuration: Url Configuration Action in the Action Set. + :vartype url_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayUrlConfiguration + """ + + _attribute_map = { + "request_header_configurations": { + "key": "requestHeaderConfigurations", + "type": "[ApplicationGatewayHeaderConfiguration]", + }, + "response_header_configurations": { + "key": "responseHeaderConfigurations", + "type": "[ApplicationGatewayHeaderConfiguration]", + }, + "url_configuration": {"key": "urlConfiguration", "type": "ApplicationGatewayUrlConfiguration"}, + } + + def __init__( + self, + *, + request_header_configurations: Optional[List["_models.ApplicationGatewayHeaderConfiguration"]] = None, + response_header_configurations: Optional[List["_models.ApplicationGatewayHeaderConfiguration"]] = None, + url_configuration: Optional["_models.ApplicationGatewayUrlConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword request_header_configurations: Request Header Actions in the Action Set. + :paramtype request_header_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayHeaderConfiguration] + :keyword response_header_configurations: Response Header Actions in the Action Set. + :paramtype response_header_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayHeaderConfiguration] + :keyword url_configuration: Url Configuration Action in the Action Set. + :paramtype url_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayUrlConfiguration + """ + super().__init__(**kwargs) + self.request_header_configurations = request_header_configurations + self.response_header_configurations = response_header_configurations + self.url_configuration = url_configuration + + +class ApplicationGatewayRewriteRuleCondition(_serialization.Model): + """Set of conditions in the Rewrite Rule in Application Gateway. + + :ivar variable: The condition parameter of the RewriteRuleCondition. + :vartype variable: str + :ivar pattern: The pattern, either fixed string or regular expression, that evaluates the + truthfulness of the condition. + :vartype pattern: str + :ivar ignore_case: Setting this parameter to truth value with force the pattern to do a case + in-sensitive comparison. + :vartype ignore_case: bool + :ivar negate: Setting this value as truth will force to check the negation of the condition + given by the user. + :vartype negate: bool + """ + + _attribute_map = { + "variable": {"key": "variable", "type": "str"}, + "pattern": {"key": "pattern", "type": "str"}, + "ignore_case": {"key": "ignoreCase", "type": "bool"}, + "negate": {"key": "negate", "type": "bool"}, + } + + def __init__( + self, + *, + variable: Optional[str] = None, + pattern: Optional[str] = None, + ignore_case: Optional[bool] = None, + negate: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword variable: The condition parameter of the RewriteRuleCondition. + :paramtype variable: str + :keyword pattern: The pattern, either fixed string or regular expression, that evaluates the + truthfulness of the condition. + :paramtype pattern: str + :keyword ignore_case: Setting this parameter to truth value with force the pattern to do a case + in-sensitive comparison. + :paramtype ignore_case: bool + :keyword negate: Setting this value as truth will force to check the negation of the condition + given by the user. + :paramtype negate: bool + """ + super().__init__(**kwargs) + self.variable = variable + self.pattern = pattern + self.ignore_case = ignore_case + self.negate = negate + + +class ApplicationGatewayRewriteRuleSet(SubResource): + """Rewrite rule set of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the rewrite rule set that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar rewrite_rules: Rewrite rules in the rewrite rule set. + :vartype rewrite_rules: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRule] + :ivar provisioning_state: The provisioning state of the rewrite rule set resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "rewrite_rules": {"key": "properties.rewriteRules", "type": "[ApplicationGatewayRewriteRule]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + rewrite_rules: Optional[List["_models.ApplicationGatewayRewriteRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the rewrite rule set that is unique within an Application Gateway. + :paramtype name: str + :keyword rewrite_rules: Rewrite rules in the rewrite rule set. + :paramtype rewrite_rules: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRewriteRule] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.rewrite_rules = rewrite_rules + self.provisioning_state = None + + +class ApplicationGatewayRoutingRule(SubResource): + """Routing rule of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the routing rule that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar rule_type: Rule type. Known values are: "Basic" and "PathBasedRouting". + :vartype rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRequestRoutingRuleType + :ivar priority: Priority of the routing rule. + :vartype priority: int + :ivar backend_address_pool: Backend address pool resource of the application gateway. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_settings: Backend settings resource of the application gateway. + :vartype backend_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar listener: Listener resource of the application gateway. + :vartype listener: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the request routing rule resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "priority": {"maximum": 20000, "minimum": 1}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "rule_type": {"key": "properties.ruleType", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + "backend_settings": {"key": "properties.backendSettings", "type": "SubResource"}, + "listener": {"key": "properties.listener", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + rule_type: Optional[Union[str, "_models.ApplicationGatewayRequestRoutingRuleType"]] = None, + priority: Optional[int] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + backend_settings: Optional["_models.SubResource"] = None, + listener: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the routing rule that is unique within an Application Gateway. + :paramtype name: str + :keyword rule_type: Rule type. Known values are: "Basic" and "PathBasedRouting". + :paramtype rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayRequestRoutingRuleType + :keyword priority: Priority of the routing rule. + :paramtype priority: int + :keyword backend_address_pool: Backend address pool resource of the application gateway. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword backend_settings: Backend settings resource of the application gateway. + :paramtype backend_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword listener: Listener resource of the application gateway. + :paramtype listener: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.rule_type = rule_type + self.priority = priority + self.backend_address_pool = backend_address_pool + self.backend_settings = backend_settings + self.listener = listener + self.provisioning_state = None + + +class ApplicationGatewaySku(_serialization.Model): + """SKU of an application gateway. + + :ivar name: Name of an application gateway SKU. Known values are: "Standard_Small", + "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large", "Standard_v2", "WAF_v2", and + "Basic". + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySkuName + :ivar tier: Tier of an application gateway. Known values are: "Standard", "WAF", "Standard_v2", + "WAF_v2", and "Basic". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTier + :ivar capacity: Capacity (instance count) of an application gateway. + :vartype capacity: int + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.ApplicationGatewaySkuName"]] = None, + tier: Optional[Union[str, "_models.ApplicationGatewayTier"]] = None, + capacity: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of an application gateway SKU. Known values are: "Standard_Small", + "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large", "Standard_v2", "WAF_v2", and + "Basic". + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySkuName + :keyword tier: Tier of an application gateway. Known values are: "Standard", "WAF", + "Standard_v2", "WAF_v2", and "Basic". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayTier + :keyword capacity: Capacity (instance count) of an application gateway. + :paramtype capacity: int + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the SSL certificate that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar data: Base-64 encoded pfx certificate. Only applicable in PUT Request. + :vartype data: str + :ivar password: Password for the pfx file specified in data. Only applicable in PUT request. + :vartype password: str + :ivar public_cert_data: Base-64 encoded Public cert data corresponding to pfx specified in + data. Only applicable in GET request. + :vartype public_cert_data: str + :ivar key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :vartype key_vault_secret_id: str + :ivar provisioning_state: The provisioning state of the SSL certificate resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "public_cert_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "data": {"key": "properties.data", "type": "str"}, + "password": {"key": "properties.password", "type": "str"}, + "public_cert_data": {"key": "properties.publicCertData", "type": "str"}, + "key_vault_secret_id": {"key": "properties.keyVaultSecretId", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + data: Optional[str] = None, + password: Optional[str] = None, + key_vault_secret_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the SSL certificate that is unique within an Application Gateway. + :paramtype name: str + :keyword data: Base-64 encoded pfx certificate. Only applicable in PUT Request. + :paramtype data: str + :keyword password: Password for the pfx file specified in data. Only applicable in PUT request. + :paramtype password: str + :keyword key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :paramtype key_vault_secret_id: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.password = password + self.public_cert_data = None + self.key_vault_secret_id = key_vault_secret_id + self.provisioning_state = None + + +class ApplicationGatewaySslPolicy(_serialization.Model): + """Application Gateway Ssl policy. + + :ivar disabled_ssl_protocols: Ssl protocols to be disabled on application gateway. + :vartype disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol] + :ivar policy_type: Type of Ssl Policy. Known values are: "Predefined", "Custom", and + "CustomV2". + :vartype policy_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyType + :ivar policy_name: Name of Ssl predefined policy. Known values are: "AppGwSslPolicy20150501", + "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S", "AppGwSslPolicy20220101", and + "AppGwSslPolicy20220101S". + :vartype policy_name: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyName + :ivar cipher_suites: Ssl cipher suites to be enabled in the specified order to application + gateway. + :vartype cipher_suites: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCipherSuite] + :ivar min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Known values are: "TLSv1_0", "TLSv1_1", "TLSv1_2", and "TLSv1_3". + :vartype min_protocol_version: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + "disabled_ssl_protocols": {"key": "disabledSslProtocols", "type": "[str]"}, + "policy_type": {"key": "policyType", "type": "str"}, + "policy_name": {"key": "policyName", "type": "str"}, + "cipher_suites": {"key": "cipherSuites", "type": "[str]"}, + "min_protocol_version": {"key": "minProtocolVersion", "type": "str"}, + } + + def __init__( + self, + *, + disabled_ssl_protocols: Optional[List[Union[str, "_models.ApplicationGatewaySslProtocol"]]] = None, + policy_type: Optional[Union[str, "_models.ApplicationGatewaySslPolicyType"]] = None, + policy_name: Optional[Union[str, "_models.ApplicationGatewaySslPolicyName"]] = None, + cipher_suites: Optional[List[Union[str, "_models.ApplicationGatewaySslCipherSuite"]]] = None, + min_protocol_version: Optional[Union[str, "_models.ApplicationGatewaySslProtocol"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword disabled_ssl_protocols: Ssl protocols to be disabled on application gateway. + :paramtype disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol] + :keyword policy_type: Type of Ssl Policy. Known values are: "Predefined", "Custom", and + "CustomV2". + :paramtype policy_type: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyType + :keyword policy_name: Name of Ssl predefined policy. Known values are: + "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S", + "AppGwSslPolicy20220101", and "AppGwSslPolicy20220101S". + :paramtype policy_name: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicyName + :keyword cipher_suites: Ssl cipher suites to be enabled in the specified order to application + gateway. + :paramtype cipher_suites: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCipherSuite] + :keyword min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Known values are: "TLSv1_0", "TLSv1_1", "TLSv1_2", and "TLSv1_3". + :paramtype min_protocol_version: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol + """ + super().__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the Ssl predefined policy. + :vartype name: str + :ivar cipher_suites: Ssl cipher suites to be enabled in the specified order for application + gateway. + :vartype cipher_suites: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCipherSuite] + :ivar min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Known values are: "TLSv1_0", "TLSv1_1", "TLSv1_2", and "TLSv1_3". + :vartype min_protocol_version: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "cipher_suites": {"key": "properties.cipherSuites", "type": "[str]"}, + "min_protocol_version": {"key": "properties.minProtocolVersion", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + cipher_suites: Optional[List[Union[str, "_models.ApplicationGatewaySslCipherSuite"]]] = None, + min_protocol_version: Optional[Union[str, "_models.ApplicationGatewaySslProtocol"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the Ssl predefined policy. + :paramtype name: str + :keyword cipher_suites: Ssl cipher suites to be enabled in the specified order for application + gateway. + :paramtype cipher_suites: list[str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslCipherSuite] + :keyword min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Known values are: "TLSv1_0", "TLSv1_1", "TLSv1_2", and "TLSv1_3". + :paramtype min_protocol_version: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslProtocol + """ + super().__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version + + +class ApplicationGatewaySslProfile(SubResource): + """SSL profile of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the SSL profile that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar trusted_client_certificates: Array of references to application gateway trusted client + certificates. + :vartype trusted_client_certificates: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar ssl_policy: SSL policy of the application gateway resource. + :vartype ssl_policy: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicy + :ivar client_auth_configuration: Client authentication configuration of the application gateway + resource. + :vartype client_auth_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayClientAuthConfiguration + :ivar provisioning_state: The provisioning state of the HTTP listener resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "trusted_client_certificates": {"key": "properties.trustedClientCertificates", "type": "[SubResource]"}, + "ssl_policy": {"key": "properties.sslPolicy", "type": "ApplicationGatewaySslPolicy"}, + "client_auth_configuration": { + "key": "properties.clientAuthConfiguration", + "type": "ApplicationGatewayClientAuthConfiguration", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + trusted_client_certificates: Optional[List["_models.SubResource"]] = None, + ssl_policy: Optional["_models.ApplicationGatewaySslPolicy"] = None, + client_auth_configuration: Optional["_models.ApplicationGatewayClientAuthConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the SSL profile that is unique within an Application Gateway. + :paramtype name: str + :keyword trusted_client_certificates: Array of references to application gateway trusted client + certificates. + :paramtype trusted_client_certificates: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword ssl_policy: SSL policy of the application gateway resource. + :paramtype ssl_policy: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPolicy + :keyword client_auth_configuration: Client authentication configuration of the application + gateway resource. + :paramtype client_auth_configuration: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayClientAuthConfiguration + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.trusted_client_certificates = trusted_client_certificates + self.ssl_policy = ssl_policy + self.client_auth_configuration = client_auth_configuration + self.provisioning_state = None + + +class ApplicationGatewayTrustedClientCertificate(SubResource): # pylint: disable=name-too-long + """Trusted client certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the trusted client certificate that is unique within an Application + Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar data: Certificate public data. + :vartype data: str + :ivar validated_cert_data: Validated certificate data. + :vartype validated_cert_data: str + :ivar client_cert_issuer_dn: Distinguished name of client certificate issuer. + :vartype client_cert_issuer_dn: str + :ivar provisioning_state: The provisioning state of the trusted client certificate resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "validated_cert_data": {"readonly": True}, + "client_cert_issuer_dn": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "data": {"key": "properties.data", "type": "str"}, + "validated_cert_data": {"key": "properties.validatedCertData", "type": "str"}, + "client_cert_issuer_dn": {"key": "properties.clientCertIssuerDN", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + data: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the trusted client certificate that is unique within an Application + Gateway. + :paramtype name: str + :keyword data: Certificate public data. + :paramtype data: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.validated_cert_data = None + self.client_cert_issuer_dn = None + self.provisioning_state = None + + +class ApplicationGatewayTrustedRootCertificate(SubResource): + """Trusted Root certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the trusted root certificate that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar data: Certificate public data. + :vartype data: str + :ivar key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :vartype key_vault_secret_id: str + :ivar provisioning_state: The provisioning state of the trusted root certificate resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "data": {"key": "properties.data", "type": "str"}, + "key_vault_secret_id": {"key": "properties.keyVaultSecretId", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + data: Optional[str] = None, + key_vault_secret_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the trusted root certificate that is unique within an Application + Gateway. + :paramtype name: str + :keyword data: Certificate public data. + :paramtype data: str + :keyword key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :paramtype key_vault_secret_id: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.key_vault_secret_id = key_vault_secret_id + self.provisioning_state = None + + +class ApplicationGatewayUrlConfiguration(_serialization.Model): + """Url configuration of the Actions set in Application Gateway. + + :ivar modified_path: Url path which user has provided for url rewrite. Null means no path will + be updated. Default value is null. + :vartype modified_path: str + :ivar modified_query_string: Query string which user has provided for url rewrite. Null means + no query string will be updated. Default value is null. + :vartype modified_query_string: str + :ivar reroute: If set as true, it will re-evaluate the url path map provided in path based + request routing rules using modified path. Default value is false. + :vartype reroute: bool + """ + + _attribute_map = { + "modified_path": {"key": "modifiedPath", "type": "str"}, + "modified_query_string": {"key": "modifiedQueryString", "type": "str"}, + "reroute": {"key": "reroute", "type": "bool"}, + } + + def __init__( + self, + *, + modified_path: Optional[str] = None, + modified_query_string: Optional[str] = None, + reroute: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword modified_path: Url path which user has provided for url rewrite. Null means no path + will be updated. Default value is null. + :paramtype modified_path: str + :keyword modified_query_string: Query string which user has provided for url rewrite. Null + means no query string will be updated. Default value is null. + :paramtype modified_query_string: str + :keyword reroute: If set as true, it will re-evaluate the url path map provided in path based + request routing rules using modified path. Default value is false. + :paramtype reroute: bool + """ + super().__init__(**kwargs) + self.modified_path = modified_path + self.modified_query_string = modified_query_string + self.reroute = reroute + + +class ApplicationGatewayUrlPathMap(SubResource): # pylint: disable=too-many-instance-attributes + """UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the URL path map that is unique within an Application Gateway. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar default_backend_address_pool: Default backend address pool resource of URL path map. + :vartype default_backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar default_backend_http_settings: Default backend http settings resource of URL path map. + :vartype default_backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar default_rewrite_rule_set: Default Rewrite rule set resource of URL path map. + :vartype default_rewrite_rule_set: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar default_redirect_configuration: Default redirect configuration resource of URL path map. + :vartype default_redirect_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar default_load_distribution_policy: Default Load Distribution Policy resource of URL path + map. + :vartype default_load_distribution_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar path_rules: Path rule of URL path map resource. + :vartype path_rules: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPathRule] + :ivar provisioning_state: The provisioning state of the URL path map resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "default_backend_address_pool": {"key": "properties.defaultBackendAddressPool", "type": "SubResource"}, + "default_backend_http_settings": {"key": "properties.defaultBackendHttpSettings", "type": "SubResource"}, + "default_rewrite_rule_set": {"key": "properties.defaultRewriteRuleSet", "type": "SubResource"}, + "default_redirect_configuration": {"key": "properties.defaultRedirectConfiguration", "type": "SubResource"}, + "default_load_distribution_policy": {"key": "properties.defaultLoadDistributionPolicy", "type": "SubResource"}, + "path_rules": {"key": "properties.pathRules", "type": "[ApplicationGatewayPathRule]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + default_backend_address_pool: Optional["_models.SubResource"] = None, + default_backend_http_settings: Optional["_models.SubResource"] = None, + default_rewrite_rule_set: Optional["_models.SubResource"] = None, + default_redirect_configuration: Optional["_models.SubResource"] = None, + default_load_distribution_policy: Optional["_models.SubResource"] = None, + path_rules: Optional[List["_models.ApplicationGatewayPathRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the URL path map that is unique within an Application Gateway. + :paramtype name: str + :keyword default_backend_address_pool: Default backend address pool resource of URL path map. + :paramtype default_backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword default_backend_http_settings: Default backend http settings resource of URL path map. + :paramtype default_backend_http_settings: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword default_rewrite_rule_set: Default Rewrite rule set resource of URL path map. + :paramtype default_rewrite_rule_set: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword default_redirect_configuration: Default redirect configuration resource of URL path + map. + :paramtype default_redirect_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword default_load_distribution_policy: Default Load Distribution Policy resource of URL + path map. + :paramtype default_load_distribution_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword path_rules: Path rule of URL path map resource. + :paramtype path_rules: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPathRule] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_rewrite_rule_set = default_rewrite_rule_set + self.default_redirect_configuration = default_redirect_configuration + self.default_load_distribution_policy = default_load_distribution_policy + self.path_rules = path_rules + self.provisioning_state = None + + +class ApplicationGatewayWafDynamicManifestResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ApplicationGatewayWafDynamicManifest API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar available_rule_sets: The available rulesets. + :vartype available_rule_sets: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallManifestRuleSet] + :ivar rule_set_type: The type of the web application firewall rule set. + :vartype rule_set_type: str + :ivar rule_set_version: The version of the web application firewall rule set type. + :vartype rule_set_version: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "available_rule_sets": { + "key": "properties.availableRuleSets", + "type": "[ApplicationGatewayFirewallManifestRuleSet]", + }, + "rule_set_type": {"key": "properties.defaultRuleSet.ruleSetType", "type": "str"}, + "rule_set_version": {"key": "properties.defaultRuleSet.ruleSetVersion", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + available_rule_sets: Optional[List["_models.ApplicationGatewayFirewallManifestRuleSet"]] = None, + rule_set_type: Optional[str] = None, + rule_set_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword available_rule_sets: The available rulesets. + :paramtype available_rule_sets: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallManifestRuleSet] + :keyword rule_set_type: The type of the web application firewall rule set. + :paramtype rule_set_type: str + :keyword rule_set_version: The version of the web application firewall rule set type. + :paramtype rule_set_version: str + """ + super().__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.available_rule_sets = available_rule_sets + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + + +class ApplicationGatewayWafDynamicManifestResultList(_serialization.Model): # pylint: disable=name-too-long + """Response for ApplicationGatewayWafDynamicManifests API service call. + + :ivar value: The list of application gateway waf manifest. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafDynamicManifestResult] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationGatewayWafDynamicManifestResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationGatewayWafDynamicManifestResult"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of application gateway waf manifest. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafDynamicManifestResult] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayWebApplicationFirewallConfiguration(_serialization.Model): # pylint: disable=name-too-long + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether the web application firewall is enabled or not. Required. + :vartype enabled: bool + :ivar firewall_mode: Web application firewall mode. Required. Known values are: "Detection" and + "Prevention". + :vartype firewall_mode: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallMode + :ivar rule_set_type: The type of the web application firewall rule set. Possible values are: + 'OWASP'. Required. + :vartype rule_set_type: str + :ivar rule_set_version: The version of the rule set type. Required. + :vartype rule_set_version: str + :ivar disabled_rule_groups: The disabled rule groups. + :vartype disabled_rule_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + :ivar request_body_check: Whether allow WAF to check request Body. + :vartype request_body_check: bool + :ivar max_request_body_size: Maximum request body size for WAF. + :vartype max_request_body_size: int + :ivar max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :vartype max_request_body_size_in_kb: int + :ivar file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :vartype file_upload_limit_in_mb: int + :ivar exclusions: The exclusion list. + :vartype exclusions: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallExclusion] + """ + + _validation = { + "enabled": {"required": True}, + "firewall_mode": {"required": True}, + "rule_set_type": {"required": True}, + "rule_set_version": {"required": True}, + "max_request_body_size": {"maximum": 128, "minimum": 8}, + "max_request_body_size_in_kb": {"maximum": 128, "minimum": 8}, + "file_upload_limit_in_mb": {"minimum": 0}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "firewall_mode": {"key": "firewallMode", "type": "str"}, + "rule_set_type": {"key": "ruleSetType", "type": "str"}, + "rule_set_version": {"key": "ruleSetVersion", "type": "str"}, + "disabled_rule_groups": {"key": "disabledRuleGroups", "type": "[ApplicationGatewayFirewallDisabledRuleGroup]"}, + "request_body_check": {"key": "requestBodyCheck", "type": "bool"}, + "max_request_body_size": {"key": "maxRequestBodySize", "type": "int"}, + "max_request_body_size_in_kb": {"key": "maxRequestBodySizeInKb", "type": "int"}, + "file_upload_limit_in_mb": {"key": "fileUploadLimitInMb", "type": "int"}, + "exclusions": {"key": "exclusions", "type": "[ApplicationGatewayFirewallExclusion]"}, + } + + def __init__( + self, + *, + enabled: bool, + firewall_mode: Union[str, "_models.ApplicationGatewayFirewallMode"], + rule_set_type: str, + rule_set_version: str, + disabled_rule_groups: Optional[List["_models.ApplicationGatewayFirewallDisabledRuleGroup"]] = None, + request_body_check: Optional[bool] = None, + max_request_body_size: Optional[int] = None, + max_request_body_size_in_kb: Optional[int] = None, + file_upload_limit_in_mb: Optional[int] = None, + exclusions: Optional[List["_models.ApplicationGatewayFirewallExclusion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether the web application firewall is enabled or not. Required. + :paramtype enabled: bool + :keyword firewall_mode: Web application firewall mode. Required. Known values are: "Detection" + and "Prevention". + :paramtype firewall_mode: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallMode + :keyword rule_set_type: The type of the web application firewall rule set. Possible values are: + 'OWASP'. Required. + :paramtype rule_set_type: str + :keyword rule_set_version: The version of the rule set type. Required. + :paramtype rule_set_version: str + :keyword disabled_rule_groups: The disabled rule groups. + :paramtype disabled_rule_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + :keyword request_body_check: Whether allow WAF to check request Body. + :paramtype request_body_check: bool + :keyword max_request_body_size: Maximum request body size for WAF. + :paramtype max_request_body_size: int + :keyword max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :paramtype max_request_body_size_in_kb: int + :keyword file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :paramtype file_upload_limit_in_mb: int + :keyword exclusions: The exclusion list. + :paramtype exclusions: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallExclusion] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups + self.request_body_check = request_body_check + self.max_request_body_size = max_request_body_size + self.max_request_body_size_in_kb = max_request_body_size_in_kb + self.file_upload_limit_in_mb = file_upload_limit_in_mb + self.exclusions = exclusions + + +class FirewallPolicyRule(_serialization.Model): + """Properties of a rule. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ApplicationRule, NatRule, NetworkRule + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar rule_type: Rule Type. Required. Known values are: "ApplicationRule", "NetworkRule", and + "NatRule". + :vartype rule_type: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleType + """ + + _validation = { + "rule_type": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "rule_type": {"key": "ruleType", "type": "str"}, + } + + _subtype_map = { + "rule_type": {"ApplicationRule": "ApplicationRule", "NatRule": "NatRule", "NetworkRule": "NetworkRule"} + } + + def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + """ + super().__init__(**kwargs) + self.name = name + self.description = description + self.rule_type: Optional[str] = None + + +class ApplicationRule(FirewallPolicyRule): # pylint: disable=too-many-instance-attributes + """Rule of type application. + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar rule_type: Rule Type. Required. Known values are: "ApplicationRule", "NetworkRule", and + "NatRule". + :vartype rule_type: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleType + :ivar source_addresses: List of source IP addresses for this rule. + :vartype source_addresses: list[str] + :ivar destination_addresses: List of destination IP addresses or Service Tags. + :vartype destination_addresses: list[str] + :ivar protocols: Array of Application Protocols. + :vartype protocols: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleApplicationProtocol] + :ivar target_fqdns: List of FQDNs for this rule. + :vartype target_fqdns: list[str] + :ivar target_urls: List of Urls for this rule condition. + :vartype target_urls: list[str] + :ivar fqdn_tags: List of FQDN Tags for this rule. + :vartype fqdn_tags: list[str] + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + :ivar terminate_tls: Terminate TLS connections for this rule. + :vartype terminate_tls: bool + :ivar web_categories: List of destination azure web categories. + :vartype web_categories: list[str] + :ivar http_headers_to_insert: List of HTTP/S headers to insert. + :vartype http_headers_to_insert: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyHttpHeaderToInsert] + """ + + _validation = { + "rule_type": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "rule_type": {"key": "ruleType", "type": "str"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "destination_addresses": {"key": "destinationAddresses", "type": "[str]"}, + "protocols": {"key": "protocols", "type": "[FirewallPolicyRuleApplicationProtocol]"}, + "target_fqdns": {"key": "targetFqdns", "type": "[str]"}, + "target_urls": {"key": "targetUrls", "type": "[str]"}, + "fqdn_tags": {"key": "fqdnTags", "type": "[str]"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + "terminate_tls": {"key": "terminateTLS", "type": "bool"}, + "web_categories": {"key": "webCategories", "type": "[str]"}, + "http_headers_to_insert": {"key": "httpHeadersToInsert", "type": "[FirewallPolicyHttpHeaderToInsert]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + protocols: Optional[List["_models.FirewallPolicyRuleApplicationProtocol"]] = None, + target_fqdns: Optional[List[str]] = None, + target_urls: Optional[List[str]] = None, + fqdn_tags: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + terminate_tls: Optional[bool] = None, + web_categories: Optional[List[str]] = None, + http_headers_to_insert: Optional[List["_models.FirewallPolicyHttpHeaderToInsert"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + :keyword source_addresses: List of source IP addresses for this rule. + :paramtype source_addresses: list[str] + :keyword destination_addresses: List of destination IP addresses or Service Tags. + :paramtype destination_addresses: list[str] + :keyword protocols: Array of Application Protocols. + :paramtype protocols: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleApplicationProtocol] + :keyword target_fqdns: List of FQDNs for this rule. + :paramtype target_fqdns: list[str] + :keyword target_urls: List of Urls for this rule condition. + :paramtype target_urls: list[str] + :keyword fqdn_tags: List of FQDN Tags for this rule. + :paramtype fqdn_tags: list[str] + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + :keyword terminate_tls: Terminate TLS connections for this rule. + :paramtype terminate_tls: bool + :keyword web_categories: List of destination azure web categories. + :paramtype web_categories: list[str] + :keyword http_headers_to_insert: List of HTTP/S headers to insert. + :paramtype http_headers_to_insert: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyHttpHeaderToInsert] + """ + super().__init__(name=name, description=description, **kwargs) + self.rule_type: str = "ApplicationRule" + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.protocols = protocols + self.target_fqdns = target_fqdns + self.target_urls = target_urls + self.fqdn_tags = fqdn_tags + self.source_ip_groups = source_ip_groups + self.terminate_tls = terminate_tls + self.web_categories = web_categories + self.http_headers_to_insert = http_headers_to_insert + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the application security group resource. It + uniquely identifies a resource, even if the user changes its name or migrate the resource + across subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application security group resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + + +class ApplicationSecurityGroupListResult(_serialization.Model): + """A list of application security groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of application security groups. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationSecurityGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ApplicationSecurityGroup"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of application security groups. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class AuthorizationListResult(_serialization.Model): + """Response for ListAuthorizations API service call retrieves all authorizations that belongs to + an ExpressRouteCircuit. + + :ivar value: The authorizations in an ExpressRoute Circuit. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuitAuthorization]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuitAuthorization"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The authorizations in an ExpressRoute Circuit. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AutoApprovedPrivateLinkService(_serialization.Model): + """The information of an AutoApprovedPrivateLinkService. + + :ivar private_link_service: The id of the private link service resource. + :vartype private_link_service: str + """ + + _attribute_map = { + "private_link_service": {"key": "privateLinkService", "type": "str"}, + } + + def __init__(self, *, private_link_service: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword private_link_service: The id of the private link service resource. + :paramtype private_link_service: str + """ + super().__init__(**kwargs) + self.private_link_service = private_link_service + + +class AutoApprovedPrivateLinkServicesResult(_serialization.Model): + """An array of private link service id that can be linked to a private end point with auto + approved. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of auto approved private link service. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AutoApprovedPrivateLinkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AutoApprovedPrivateLinkService]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.AutoApprovedPrivateLinkService"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: An array of auto approved private link service. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AutoApprovedPrivateLinkService] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class Availability(_serialization.Model): + """Availability of the metric. + + :ivar time_grain: The time grain of the availability. + :vartype time_grain: str + :ivar retention: The retention of the availability. + :vartype retention: str + :ivar blob_duration: Duration of the availability blob. + :vartype blob_duration: str + """ + + _attribute_map = { + "time_grain": {"key": "timeGrain", "type": "str"}, + "retention": {"key": "retention", "type": "str"}, + "blob_duration": {"key": "blobDuration", "type": "str"}, + } + + def __init__( + self, + *, + time_grain: Optional[str] = None, + retention: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword time_grain: The time grain of the availability. + :paramtype time_grain: str + :keyword retention: The retention of the availability. + :paramtype retention: str + :keyword blob_duration: Duration of the availability blob. + :paramtype blob_duration: str + """ + super().__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention + self.blob_duration = blob_duration + + +class AvailableDelegation(_serialization.Model): + """The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. + + :ivar name: The name of the AvailableDelegation resource. + :vartype name: str + :ivar id: A unique identifier of the AvailableDelegation resource. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :ivar service_name: The name of the service and resource. + :vartype service_name: str + :ivar actions: The actions permitted to the service upon delegation. + :vartype actions: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "service_name": {"key": "serviceName", "type": "str"}, + "actions": {"key": "actions", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + service_name: Optional[str] = None, + actions: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the AvailableDelegation resource. + :paramtype name: str + :keyword id: A unique identifier of the AvailableDelegation resource. + :paramtype id: str + :keyword type: Resource type. + :paramtype type: str + :keyword service_name: The name of the service and resource. + :paramtype service_name: str + :keyword actions: The actions permitted to the service upon delegation. + :paramtype actions: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.service_name = service_name + self.actions = actions + + +class AvailableDelegationsResult(_serialization.Model): + """An array of available delegations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of available delegations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AvailableDelegation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AvailableDelegation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.AvailableDelegation"]] = None, **kwargs: Any) -> None: + """ + :keyword value: An array of available delegations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AvailableDelegation] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class AvailablePrivateEndpointType(_serialization.Model): + """The information of an AvailablePrivateEndpointType. + + :ivar name: The name of the service and resource. + :vartype name: str + :ivar id: A unique identifier of the AvailablePrivateEndpoint Type resource. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :ivar resource_name: The name of the service and resource. + :vartype resource_name: str + :ivar display_name: Display name of the resource. + :vartype display_name: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + resource_name: Optional[str] = None, + display_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the service and resource. + :paramtype name: str + :keyword id: A unique identifier of the AvailablePrivateEndpoint Type resource. + :paramtype id: str + :keyword type: Resource type. + :paramtype type: str + :keyword resource_name: The name of the service and resource. + :paramtype resource_name: str + :keyword display_name: Display name of the resource. + :paramtype display_name: str + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.resource_name = resource_name + self.display_name = display_name + + +class AvailablePrivateEndpointTypesResult(_serialization.Model): + """An array of available PrivateEndpoint types. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of available privateEndpoint type. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AvailablePrivateEndpointType] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AvailablePrivateEndpointType]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.AvailablePrivateEndpointType"]] = None, **kwargs: Any) -> None: + """ + :keyword value: An array of available privateEndpoint type. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AvailablePrivateEndpointType] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class AvailableProvidersList(_serialization.Model): + """List of available countries with details. + + All required parameters must be populated in order to send to server. + + :ivar countries: List of available countries. Required. + :vartype countries: list[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListCountry] + """ + + _validation = { + "countries": {"required": True}, + } + + _attribute_map = { + "countries": {"key": "countries", "type": "[AvailableProvidersListCountry]"}, + } + + def __init__(self, *, countries: List["_models.AvailableProvidersListCountry"], **kwargs: Any) -> None: + """ + :keyword countries: List of available countries. Required. + :paramtype countries: + list[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListCountry] + """ + super().__init__(**kwargs) + self.countries = countries + + +class AvailableProvidersListCity(_serialization.Model): + """City or town details. + + :ivar city_name: The city or town name. + :vartype city_name: str + :ivar providers: A list of Internet service providers. + :vartype providers: list[str] + """ + + _attribute_map = { + "city_name": {"key": "cityName", "type": "str"}, + "providers": {"key": "providers", "type": "[str]"}, + } + + def __init__( + self, *, city_name: Optional[str] = None, providers: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword city_name: The city or town name. + :paramtype city_name: str + :keyword providers: A list of Internet service providers. + :paramtype providers: list[str] + """ + super().__init__(**kwargs) + self.city_name = city_name + self.providers = providers + + +class AvailableProvidersListCountry(_serialization.Model): + """Country details. + + :ivar country_name: The country name. + :vartype country_name: str + :ivar providers: A list of Internet service providers. + :vartype providers: list[str] + :ivar states: List of available states in the country. + :vartype states: list[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + "country_name": {"key": "countryName", "type": "str"}, + "providers": {"key": "providers", "type": "[str]"}, + "states": {"key": "states", "type": "[AvailableProvidersListState]"}, + } + + def __init__( + self, + *, + country_name: Optional[str] = None, + providers: Optional[List[str]] = None, + states: Optional[List["_models.AvailableProvidersListState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword country_name: The country name. + :paramtype country_name: str + :keyword providers: A list of Internet service providers. + :paramtype providers: list[str] + :keyword states: List of available states in the country. + :paramtype states: list[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListState] + """ + super().__init__(**kwargs) + self.country_name = country_name + self.providers = providers + self.states = states + + +class AvailableProvidersListParameters(_serialization.Model): + """Constraints that determine the list of available Internet service providers. + + :ivar azure_locations: A list of Azure regions. + :vartype azure_locations: list[str] + :ivar country: The country for available providers list. + :vartype country: str + :ivar state: The state for available providers list. + :vartype state: str + :ivar city: The city or town for available providers list. + :vartype city: str + """ + + _attribute_map = { + "azure_locations": {"key": "azureLocations", "type": "[str]"}, + "country": {"key": "country", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "city": {"key": "city", "type": "str"}, + } + + def __init__( + self, + *, + azure_locations: Optional[List[str]] = None, + country: Optional[str] = None, + state: Optional[str] = None, + city: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword azure_locations: A list of Azure regions. + :paramtype azure_locations: list[str] + :keyword country: The country for available providers list. + :paramtype country: str + :keyword state: The state for available providers list. + :paramtype state: str + :keyword city: The city or town for available providers list. + :paramtype city: str + """ + super().__init__(**kwargs) + self.azure_locations = azure_locations + self.country = country + self.state = state + self.city = city + + +class AvailableProvidersListState(_serialization.Model): + """State details. + + :ivar state_name: The state name. + :vartype state_name: str + :ivar providers: A list of Internet service providers. + :vartype providers: list[str] + :ivar cities: List of available cities or towns in the state. + :vartype cities: list[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + "state_name": {"key": "stateName", "type": "str"}, + "providers": {"key": "providers", "type": "[str]"}, + "cities": {"key": "cities", "type": "[AvailableProvidersListCity]"}, + } + + def __init__( + self, + *, + state_name: Optional[str] = None, + providers: Optional[List[str]] = None, + cities: Optional[List["_models.AvailableProvidersListCity"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword state_name: The state name. + :paramtype state_name: str + :keyword providers: A list of Internet service providers. + :paramtype providers: list[str] + :keyword cities: List of available cities or towns in the state. + :paramtype cities: list[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListCity] + """ + super().__init__(**kwargs) + self.state_name = state_name + self.providers = providers + self.cities = cities + + +class AvailableServiceAlias(_serialization.Model): + """The available service alias. + + :ivar name: The name of the service alias. + :vartype name: str + :ivar id: The ID of the service alias. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :ivar resource_name: The resource name of the service alias. + :vartype resource_name: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + resource_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the service alias. + :paramtype name: str + :keyword id: The ID of the service alias. + :paramtype id: str + :keyword type: The type of the resource. + :paramtype type: str + :keyword resource_name: The resource name of the service alias. + :paramtype resource_name: str + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.resource_name = resource_name + + +class AvailableServiceAliasesResult(_serialization.Model): + """An array of available service aliases. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of available service aliases. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AvailableServiceAlias] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AvailableServiceAlias]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.AvailableServiceAlias"]] = None, **kwargs: Any) -> None: + """ + :keyword value: An array of available service aliases. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AvailableServiceAlias] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class AzureAsyncOperationResult(_serialization.Model): + """The response body contains the status of the specified asynchronous operation, indicating + whether it has succeeded, is in progress, or has failed. Note that this status is distinct from + the HTTP status code returned for the Get Operation Status operation itself. If the + asynchronous operation succeeded, the response body includes the HTTP status code for the + successful request. If the asynchronous operation failed, the response body includes the HTTP + status code for the failed request and error information regarding the failure. + + :ivar status: Status of the Azure async operation. Known values are: "InProgress", "Succeeded", + and "Failed". + :vartype status: str or ~azure.mgmt.network.v2023_09_01.models.NetworkOperationStatus + :ivar error: Details of the error occurred during specified asynchronous operation. + :vartype error: ~azure.mgmt.network.v2023_09_01.models.Error + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.NetworkOperationStatus"]] = None, + error: Optional["_models.Error"] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: Status of the Azure async operation. Known values are: "InProgress", + "Succeeded", and "Failed". + :paramtype status: str or ~azure.mgmt.network.v2023_09_01.models.NetworkOperationStatus + :keyword error: Details of the error occurred during specified asynchronous operation. + :paramtype error: ~azure.mgmt.network.v2023_09_01.models.Error + """ + super().__init__(**kwargs) + self.status = status + self.error = error + + +class AzureFirewall(Resource): # pylint: disable=too-many-instance-attributes + """Azure Firewall resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar zones: A list of availability zones denoting where the resource needs to come from. + :vartype zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar application_rule_collections: Collection of application rule collections used by Azure + Firewall. + :vartype application_rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRuleCollection] + :ivar nat_rule_collections: Collection of NAT rule collections used by Azure Firewall. + :vartype nat_rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRuleCollection] + :ivar network_rule_collections: Collection of network rule collections used by Azure Firewall. + :vartype network_rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleCollection] + :ivar ip_configurations: IP configuration of the Azure Firewall resource. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallIPConfiguration] + :ivar management_ip_configuration: IP configuration of the Azure Firewall used for management + traffic. + :vartype management_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallIPConfiguration + :ivar provisioning_state: The provisioning state of the Azure firewall resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar threat_intel_mode: The operation mode for Threat Intelligence. Known values are: "Alert", + "Deny", and "Off". + :vartype threat_intel_mode: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallThreatIntelMode + :ivar virtual_hub: The virtualHub to which the firewall belongs. + :vartype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar firewall_policy: The firewallPolicy associated with this azure firewall. + :vartype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar hub_ip_addresses: IP addresses associated with AzureFirewall. + :vartype hub_ip_addresses: ~azure.mgmt.network.v2023_09_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallIpGroups] + :ivar sku: The Azure Firewall Resource SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallSku + :ivar additional_properties: The additional properties used to further config this azure + firewall. + :vartype additional_properties: dict[str, str] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "ip_groups": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "zones": {"key": "zones", "type": "[str]"}, + "etag": {"key": "etag", "type": "str"}, + "application_rule_collections": { + "key": "properties.applicationRuleCollections", + "type": "[AzureFirewallApplicationRuleCollection]", + }, + "nat_rule_collections": {"key": "properties.natRuleCollections", "type": "[AzureFirewallNatRuleCollection]"}, + "network_rule_collections": { + "key": "properties.networkRuleCollections", + "type": "[AzureFirewallNetworkRuleCollection]", + }, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[AzureFirewallIPConfiguration]"}, + "management_ip_configuration": { + "key": "properties.managementIpConfiguration", + "type": "AzureFirewallIPConfiguration", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "threat_intel_mode": {"key": "properties.threatIntelMode", "type": "str"}, + "virtual_hub": {"key": "properties.virtualHub", "type": "SubResource"}, + "firewall_policy": {"key": "properties.firewallPolicy", "type": "SubResource"}, + "hub_ip_addresses": {"key": "properties.hubIPAddresses", "type": "HubIPAddresses"}, + "ip_groups": {"key": "properties.ipGroups", "type": "[AzureFirewallIpGroups]"}, + "sku": {"key": "properties.sku", "type": "AzureFirewallSku"}, + "additional_properties": {"key": "properties.additionalProperties", "type": "{str}"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + application_rule_collections: Optional[List["_models.AzureFirewallApplicationRuleCollection"]] = None, + nat_rule_collections: Optional[List["_models.AzureFirewallNatRuleCollection"]] = None, + network_rule_collections: Optional[List["_models.AzureFirewallNetworkRuleCollection"]] = None, + ip_configurations: Optional[List["_models.AzureFirewallIPConfiguration"]] = None, + management_ip_configuration: Optional["_models.AzureFirewallIPConfiguration"] = None, + threat_intel_mode: Optional[Union[str, "_models.AzureFirewallThreatIntelMode"]] = None, + virtual_hub: Optional["_models.SubResource"] = None, + firewall_policy: Optional["_models.SubResource"] = None, + hub_ip_addresses: Optional["_models.HubIPAddresses"] = None, + sku: Optional["_models.AzureFirewallSku"] = None, + additional_properties: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword zones: A list of availability zones denoting where the resource needs to come from. + :paramtype zones: list[str] + :keyword application_rule_collections: Collection of application rule collections used by Azure + Firewall. + :paramtype application_rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRuleCollection] + :keyword nat_rule_collections: Collection of NAT rule collections used by Azure Firewall. + :paramtype nat_rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRuleCollection] + :keyword network_rule_collections: Collection of network rule collections used by Azure + Firewall. + :paramtype network_rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleCollection] + :keyword ip_configurations: IP configuration of the Azure Firewall resource. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallIPConfiguration] + :keyword management_ip_configuration: IP configuration of the Azure Firewall used for + management traffic. + :paramtype management_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallIPConfiguration + :keyword threat_intel_mode: The operation mode for Threat Intelligence. Known values are: + "Alert", "Deny", and "Off". + :paramtype threat_intel_mode: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallThreatIntelMode + :keyword virtual_hub: The virtualHub to which the firewall belongs. + :paramtype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword firewall_policy: The firewallPolicy associated with this azure firewall. + :paramtype firewall_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword hub_ip_addresses: IP addresses associated with AzureFirewall. + :paramtype hub_ip_addresses: ~azure.mgmt.network.v2023_09_01.models.HubIPAddresses + :keyword sku: The Azure Firewall Resource SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallSku + :keyword additional_properties: The additional properties used to further config this azure + firewall. + :paramtype additional_properties: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.zones = zones + self.etag = None + self.application_rule_collections = application_rule_collections + self.nat_rule_collections = nat_rule_collections + self.network_rule_collections = network_rule_collections + self.ip_configurations = ip_configurations + self.management_ip_configuration = management_ip_configuration + self.provisioning_state = None + self.threat_intel_mode = threat_intel_mode + self.virtual_hub = virtual_hub + self.firewall_policy = firewall_policy + self.hub_ip_addresses = hub_ip_addresses + self.ip_groups = None + self.sku = sku + self.additional_properties = additional_properties + + +class AzureFirewallApplicationRule(_serialization.Model): + """Properties of an application rule. + + :ivar name: Name of the application rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar source_addresses: List of source IP addresses for this rule. + :vartype source_addresses: list[str] + :ivar protocols: Array of ApplicationRuleProtocols. + :vartype protocols: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRuleProtocol] + :ivar target_fqdns: List of FQDNs for this rule. + :vartype target_fqdns: list[str] + :ivar fqdn_tags: List of FQDN Tags for this rule. + :vartype fqdn_tags: list[str] + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "protocols": {"key": "protocols", "type": "[AzureFirewallApplicationRuleProtocol]"}, + "target_fqdns": {"key": "targetFqdns", "type": "[str]"}, + "fqdn_tags": {"key": "fqdnTags", "type": "[str]"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + source_addresses: Optional[List[str]] = None, + protocols: Optional[List["_models.AzureFirewallApplicationRuleProtocol"]] = None, + target_fqdns: Optional[List[str]] = None, + fqdn_tags: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the application rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + :keyword source_addresses: List of source IP addresses for this rule. + :paramtype source_addresses: list[str] + :keyword protocols: Array of ApplicationRuleProtocols. + :paramtype protocols: + list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRuleProtocol] + :keyword target_fqdns: List of FQDNs for this rule. + :paramtype target_fqdns: list[str] + :keyword fqdn_tags: List of FQDN Tags for this rule. + :paramtype fqdn_tags: list[str] + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.description = description + self.source_addresses = source_addresses + self.protocols = protocols + self.target_fqdns = target_fqdns + self.fqdn_tags = fqdn_tags + self.source_ip_groups = source_ip_groups + + +class AzureFirewallApplicationRuleCollection(SubResource): + """Application rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the Azure firewall. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar priority: Priority of the application rule collection resource. + :vartype priority: int + :ivar action: The action type of a rule collection. + :vartype action: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallRCAction + :ivar rules: Collection of rules used by a application rule collection. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRule] + :ivar provisioning_state: The provisioning state of the application rule collection resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "priority": {"maximum": 65000, "minimum": 100}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "action": {"key": "properties.action", "type": "AzureFirewallRCAction"}, + "rules": {"key": "properties.rules", "type": "[AzureFirewallApplicationRule]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["_models.AzureFirewallRCAction"] = None, + rules: Optional[List["_models.AzureFirewallApplicationRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :paramtype name: str + :keyword priority: Priority of the application rule collection resource. + :paramtype priority: int + :keyword action: The action type of a rule collection. + :paramtype action: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallRCAction + :keyword rules: Collection of rules used by a application rule collection. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRule] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = None + + +class AzureFirewallApplicationRuleProtocol(_serialization.Model): + """Properties of the application rule protocol. + + :ivar protocol_type: Protocol type. Known values are: "Http", "Https", and "Mssql". + :vartype protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRuleProtocolType + :ivar port: Port number for the protocol, cannot be greater than 64000. This field is optional. + :vartype port: int + """ + + _validation = { + "port": {"maximum": 64000, "minimum": 0}, + } + + _attribute_map = { + "protocol_type": {"key": "protocolType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__( + self, + *, + protocol_type: Optional[Union[str, "_models.AzureFirewallApplicationRuleProtocolType"]] = None, + port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword protocol_type: Protocol type. Known values are: "Http", "Https", and "Mssql". + :paramtype protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallApplicationRuleProtocolType + :keyword port: Port number for the protocol, cannot be greater than 64000. This field is + optional. + :paramtype port: int + """ + super().__init__(**kwargs) + self.protocol_type = protocol_type + self.port = port + + +class AzureFirewallFqdnTag(Resource): + """Azure Firewall FQDN Tag Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the Azure firewall FQDN tag resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar fqdn_tag_name: The name of this FQDN Tag. + :vartype fqdn_tag_name: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "fqdn_tag_name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "fqdn_tag_name": {"key": "properties.fqdnTagName", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + self.fqdn_tag_name = None + + +class AzureFirewallFqdnTagListResult(_serialization.Model): + """Response for ListAzureFirewallFqdnTags API service call. + + :ivar value: List of Azure Firewall FQDN Tags in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallFqdnTag] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[AzureFirewallFqdnTag]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.AzureFirewallFqdnTag"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Azure Firewall FQDN Tags in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallFqdnTag] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AzureFirewallIPConfiguration(SubResource): + """IP configuration of an Azure Firewall. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_ip_address: The Firewall Internal Load Balancer IP to be used as the next hop in + User Defined Routes. + :vartype private_ip_address: str + :ivar subnet: Reference to the subnet resource. This resource must be named + 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar public_ip_address: Reference to the PublicIP resource. This field is a mandatory input if + subnet is not null. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the Azure firewall IP configuration + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + subnet: Optional["_models.SubResource"] = None, + public_ip_address: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the resource that is unique within a resource group. This name can be + used to access the resource. + :paramtype name: str + :keyword subnet: Reference to the subnet resource. This resource must be named + 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword public_ip_address: Reference to the PublicIP resource. This field is a mandatory input + if subnet is not null. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = None + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + + +class AzureFirewallIpGroups(_serialization.Model): + """IpGroups associated with azure firewall. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar change_number: The iteration number. + :vartype change_number: str + """ + + _validation = { + "id": {"readonly": True}, + "change_number": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "change_number": {"key": "changeNumber", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.change_number = None + + +class AzureFirewallListResult(_serialization.Model): + """Response for ListAzureFirewalls API service call. + + :ivar value: List of Azure Firewalls in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[AzureFirewall]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.AzureFirewall"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of Azure Firewalls in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AzureFirewallNatRCAction(_serialization.Model): + """AzureFirewall NAT Rule Collection Action. + + :ivar type: The type of action. Known values are: "Snat" and "Dnat". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRCActionType + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, *, type: Optional[Union[str, "_models.AzureFirewallNatRCActionType"]] = None, **kwargs: Any + ) -> None: + """ + :keyword type: The type of action. Known values are: "Snat" and "Dnat". + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRCActionType + """ + super().__init__(**kwargs) + self.type = type + + +class AzureFirewallNatRule(_serialization.Model): + """Properties of a NAT rule. + + :ivar name: Name of the NAT rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar source_addresses: List of source IP addresses for this rule. + :vartype source_addresses: list[str] + :ivar destination_addresses: List of destination IP addresses for this rule. Supports IP + ranges, prefixes, and service tags. + :vartype destination_addresses: list[str] + :ivar destination_ports: List of destination ports. + :vartype destination_ports: list[str] + :ivar protocols: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + :vartype protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleProtocol] + :ivar translated_address: The translated address for this NAT rule. + :vartype translated_address: str + :ivar translated_port: The translated port for this NAT rule. + :vartype translated_port: str + :ivar translated_fqdn: The translated FQDN for this NAT rule. + :vartype translated_fqdn: str + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "destination_addresses": {"key": "destinationAddresses", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + "protocols": {"key": "protocols", "type": "[str]"}, + "translated_address": {"key": "translatedAddress", "type": "str"}, + "translated_port": {"key": "translatedPort", "type": "str"}, + "translated_fqdn": {"key": "translatedFqdn", "type": "str"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + protocols: Optional[List[Union[str, "_models.AzureFirewallNetworkRuleProtocol"]]] = None, + translated_address: Optional[str] = None, + translated_port: Optional[str] = None, + translated_fqdn: Optional[str] = None, + source_ip_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the NAT rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + :keyword source_addresses: List of source IP addresses for this rule. + :paramtype source_addresses: list[str] + :keyword destination_addresses: List of destination IP addresses for this rule. Supports IP + ranges, prefixes, and service tags. + :paramtype destination_addresses: list[str] + :keyword destination_ports: List of destination ports. + :paramtype destination_ports: list[str] + :keyword protocols: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + :paramtype protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleProtocol] + :keyword translated_address: The translated address for this NAT rule. + :paramtype translated_address: str + :keyword translated_port: The translated port for this NAT rule. + :paramtype translated_port: str + :keyword translated_fqdn: The translated FQDN for this NAT rule. + :paramtype translated_fqdn: str + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.description = description + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.protocols = protocols + self.translated_address = translated_address + self.translated_port = translated_port + self.translated_fqdn = translated_fqdn + self.source_ip_groups = source_ip_groups + + +class AzureFirewallNatRuleCollection(SubResource): + """NAT rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the Azure firewall. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar priority: Priority of the NAT rule collection resource. + :vartype priority: int + :ivar action: The action type of a NAT rule collection. + :vartype action: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRCAction + :ivar rules: Collection of rules used by a NAT rule collection. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRule] + :ivar provisioning_state: The provisioning state of the NAT rule collection resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "priority": {"maximum": 65000, "minimum": 100}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "action": {"key": "properties.action", "type": "AzureFirewallNatRCAction"}, + "rules": {"key": "properties.rules", "type": "[AzureFirewallNatRule]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["_models.AzureFirewallNatRCAction"] = None, + rules: Optional[List["_models.AzureFirewallNatRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :paramtype name: str + :keyword priority: Priority of the NAT rule collection resource. + :paramtype priority: int + :keyword action: The action type of a NAT rule collection. + :paramtype action: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRCAction + :keyword rules: Collection of rules used by a NAT rule collection. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNatRule] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = None + + +class AzureFirewallNetworkRule(_serialization.Model): + """Properties of the network rule. + + :ivar name: Name of the network rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar protocols: Array of AzureFirewallNetworkRuleProtocols. + :vartype protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleProtocol] + :ivar source_addresses: List of source IP addresses for this rule. + :vartype source_addresses: list[str] + :ivar destination_addresses: List of destination IP addresses. + :vartype destination_addresses: list[str] + :ivar destination_ports: List of destination ports. + :vartype destination_ports: list[str] + :ivar destination_fqdns: List of destination FQDNs. + :vartype destination_fqdns: list[str] + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + :ivar destination_ip_groups: List of destination IpGroups for this rule. + :vartype destination_ip_groups: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "protocols": {"key": "protocols", "type": "[str]"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "destination_addresses": {"key": "destinationAddresses", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + "destination_fqdns": {"key": "destinationFqdns", "type": "[str]"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + "destination_ip_groups": {"key": "destinationIpGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + protocols: Optional[List[Union[str, "_models.AzureFirewallNetworkRuleProtocol"]]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + destination_fqdns: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + destination_ip_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the network rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + :keyword protocols: Array of AzureFirewallNetworkRuleProtocols. + :paramtype protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleProtocol] + :keyword source_addresses: List of source IP addresses for this rule. + :paramtype source_addresses: list[str] + :keyword destination_addresses: List of destination IP addresses. + :paramtype destination_addresses: list[str] + :keyword destination_ports: List of destination ports. + :paramtype destination_ports: list[str] + :keyword destination_fqdns: List of destination FQDNs. + :paramtype destination_fqdns: list[str] + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + :keyword destination_ip_groups: List of destination IpGroups for this rule. + :paramtype destination_ip_groups: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.description = description + self.protocols = protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.destination_fqdns = destination_fqdns + self.source_ip_groups = source_ip_groups + self.destination_ip_groups = destination_ip_groups + + +class AzureFirewallNetworkRuleCollection(SubResource): + """Network rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the Azure firewall. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar priority: Priority of the network rule collection resource. + :vartype priority: int + :ivar action: The action type of a rule collection. + :vartype action: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallRCAction + :ivar rules: Collection of rules used by a network rule collection. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRule] + :ivar provisioning_state: The provisioning state of the network rule collection resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "priority": {"maximum": 65000, "minimum": 100}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "action": {"key": "properties.action", "type": "AzureFirewallRCAction"}, + "rules": {"key": "properties.rules", "type": "[AzureFirewallNetworkRule]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["_models.AzureFirewallRCAction"] = None, + rules: Optional[List["_models.AzureFirewallNetworkRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :paramtype name: str + :keyword priority: Priority of the network rule collection resource. + :paramtype priority: int + :keyword action: The action type of a rule collection. + :paramtype action: ~azure.mgmt.network.v2023_09_01.models.AzureFirewallRCAction + :keyword rules: Collection of rules used by a network rule collection. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRule] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = None + + +class AzureFirewallPacketCaptureFlags(_serialization.Model): + """Properties of the AzureFirewallRCAction. + + :ivar type: Flags to capture. Known values are: "fin", "syn", "rst", "push", "ack", and "urg". + :vartype type: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallPacketCaptureFlagsType + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, *, type: Optional[Union[str, "_models.AzureFirewallPacketCaptureFlagsType"]] = None, **kwargs: Any + ) -> None: + """ + :keyword type: Flags to capture. Known values are: "fin", "syn", "rst", "push", "ack", and + "urg". + :paramtype type: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallPacketCaptureFlagsType + """ + super().__init__(**kwargs) + self.type = type + + +class AzureFirewallPacketCaptureRule(_serialization.Model): + """Group of src/dest ips and ports to be captured. + + :ivar sources: List of source IP addresses/subnets to be captured. + :vartype sources: list[str] + :ivar destinations: List of destination IP addresses/subnets to be captured. + :vartype destinations: list[str] + :ivar destination_ports: List of ports to be captured. + :vartype destination_ports: list[str] + """ + + _attribute_map = { + "sources": {"key": "sources", "type": "[str]"}, + "destinations": {"key": "destinations", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + } + + def __init__( + self, + *, + sources: Optional[List[str]] = None, + destinations: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword sources: List of source IP addresses/subnets to be captured. + :paramtype sources: list[str] + :keyword destinations: List of destination IP addresses/subnets to be captured. + :paramtype destinations: list[str] + :keyword destination_ports: List of ports to be captured. + :paramtype destination_ports: list[str] + """ + super().__init__(**kwargs) + self.sources = sources + self.destinations = destinations + self.destination_ports = destination_ports + + +class AzureFirewallPublicIPAddress(_serialization.Model): + """Public IP Address associated with azure firewall. + + :ivar address: Public IP Address value. + :vartype address: str + """ + + _attribute_map = { + "address": {"key": "address", "type": "str"}, + } + + def __init__(self, *, address: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword address: Public IP Address value. + :paramtype address: str + """ + super().__init__(**kwargs) + self.address = address + + +class AzureFirewallRCAction(_serialization.Model): + """Properties of the AzureFirewallRCAction. + + :ivar type: The type of action. Known values are: "Allow" and "Deny". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallRCActionType + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, *, type: Optional[Union[str, "_models.AzureFirewallRCActionType"]] = None, **kwargs: Any + ) -> None: + """ + :keyword type: The type of action. Known values are: "Allow" and "Deny". + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallRCActionType + """ + super().__init__(**kwargs) + self.type = type + + +class AzureFirewallSku(_serialization.Model): + """SKU of an Azure Firewall. + + :ivar name: Name of an Azure Firewall SKU. Known values are: "AZFW_VNet" and "AZFW_Hub". + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallSkuName + :ivar tier: Tier of an Azure Firewall. Known values are: "Standard", "Premium", and "Basic". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallSkuTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.AzureFirewallSkuName"]] = None, + tier: Optional[Union[str, "_models.AzureFirewallSkuTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of an Azure Firewall SKU. Known values are: "AZFW_VNet" and "AZFW_Hub". + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallSkuName + :keyword tier: Tier of an Azure Firewall. Known values are: "Standard", "Premium", and "Basic". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.AzureFirewallSkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class AzureReachabilityReport(_serialization.Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to server. + + :ivar aggregation_level: The aggregation level of Azure reachability report. Can be Country, + State or City. Required. + :vartype aggregation_level: str + :ivar provider_location: Parameters that define a geographic location. Required. + :vartype provider_location: + ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportLocation + :ivar reachability_report: List of Azure reachability report items. Required. + :vartype reachability_report: + list[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportItem] + """ + + _validation = { + "aggregation_level": {"required": True}, + "provider_location": {"required": True}, + "reachability_report": {"required": True}, + } + + _attribute_map = { + "aggregation_level": {"key": "aggregationLevel", "type": "str"}, + "provider_location": {"key": "providerLocation", "type": "AzureReachabilityReportLocation"}, + "reachability_report": {"key": "reachabilityReport", "type": "[AzureReachabilityReportItem]"}, + } + + def __init__( + self, + *, + aggregation_level: str, + provider_location: "_models.AzureReachabilityReportLocation", + reachability_report: List["_models.AzureReachabilityReportItem"], + **kwargs: Any + ) -> None: + """ + :keyword aggregation_level: The aggregation level of Azure reachability report. Can be Country, + State or City. Required. + :paramtype aggregation_level: str + :keyword provider_location: Parameters that define a geographic location. Required. + :paramtype provider_location: + ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportLocation + :keyword reachability_report: List of Azure reachability report items. Required. + :paramtype reachability_report: + list[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportItem] + """ + super().__init__(**kwargs) + self.aggregation_level = aggregation_level + self.provider_location = provider_location + self.reachability_report = reachability_report + + +class AzureReachabilityReportItem(_serialization.Model): + """Azure reachability report details for a given provider location. + + :ivar provider: The Internet service provider. + :vartype provider: str + :ivar azure_location: The Azure region. + :vartype azure_location: str + :ivar latencies: List of latency details for each of the time series. + :vartype latencies: + list[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + "provider": {"key": "provider", "type": "str"}, + "azure_location": {"key": "azureLocation", "type": "str"}, + "latencies": {"key": "latencies", "type": "[AzureReachabilityReportLatencyInfo]"}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + azure_location: Optional[str] = None, + latencies: Optional[List["_models.AzureReachabilityReportLatencyInfo"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword provider: The Internet service provider. + :paramtype provider: str + :keyword azure_location: The Azure region. + :paramtype azure_location: str + :keyword latencies: List of latency details for each of the time series. + :paramtype latencies: + list[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportLatencyInfo] + """ + super().__init__(**kwargs) + self.provider = provider + self.azure_location = azure_location + self.latencies = latencies + + +class AzureReachabilityReportLatencyInfo(_serialization.Model): + """Details on latency for a time series. + + :ivar time_stamp: The time stamp. + :vartype time_stamp: ~datetime.datetime + :ivar score: The relative latency score between 1 and 100, higher values indicating a faster + connection. + :vartype score: int + """ + + _validation = { + "score": {"maximum": 100, "minimum": 1}, + } + + _attribute_map = { + "time_stamp": {"key": "timeStamp", "type": "iso-8601"}, + "score": {"key": "score", "type": "int"}, + } + + def __init__( + self, *, time_stamp: Optional[datetime.datetime] = None, score: Optional[int] = None, **kwargs: Any + ) -> None: + """ + :keyword time_stamp: The time stamp. + :paramtype time_stamp: ~datetime.datetime + :keyword score: The relative latency score between 1 and 100, higher values indicating a faster + connection. + :paramtype score: int + """ + super().__init__(**kwargs) + self.time_stamp = time_stamp + self.score = score + + +class AzureReachabilityReportLocation(_serialization.Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to server. + + :ivar country: The name of the country. Required. + :vartype country: str + :ivar state: The name of the state. + :vartype state: str + :ivar city: The name of the city or town. + :vartype city: str + """ + + _validation = { + "country": {"required": True}, + } + + _attribute_map = { + "country": {"key": "country", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "city": {"key": "city", "type": "str"}, + } + + def __init__(self, *, country: str, state: Optional[str] = None, city: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword country: The name of the country. Required. + :paramtype country: str + :keyword state: The name of the state. + :paramtype state: str + :keyword city: The name of the city or town. + :paramtype city: str + """ + super().__init__(**kwargs) + self.country = country + self.state = state + self.city = city + + +class AzureReachabilityReportParameters(_serialization.Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to server. + + :ivar provider_location: Parameters that define a geographic location. Required. + :vartype provider_location: + ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportLocation + :ivar providers: List of Internet service providers. + :vartype providers: list[str] + :ivar azure_locations: Optional Azure regions to scope the query to. + :vartype azure_locations: list[str] + :ivar start_time: The start time for the Azure reachability report. Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time for the Azure reachability report. Required. + :vartype end_time: ~datetime.datetime + """ + + _validation = { + "provider_location": {"required": True}, + "start_time": {"required": True}, + "end_time": {"required": True}, + } + + _attribute_map = { + "provider_location": {"key": "providerLocation", "type": "AzureReachabilityReportLocation"}, + "providers": {"key": "providers", "type": "[str]"}, + "azure_locations": {"key": "azureLocations", "type": "[str]"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + } + + def __init__( + self, + *, + provider_location: "_models.AzureReachabilityReportLocation", + start_time: datetime.datetime, + end_time: datetime.datetime, + providers: Optional[List[str]] = None, + azure_locations: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword provider_location: Parameters that define a geographic location. Required. + :paramtype provider_location: + ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportLocation + :keyword providers: List of Internet service providers. + :paramtype providers: list[str] + :keyword azure_locations: Optional Azure regions to scope the query to. + :paramtype azure_locations: list[str] + :keyword start_time: The start time for the Azure reachability report. Required. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time for the Azure reachability report. Required. + :paramtype end_time: ~datetime.datetime + """ + super().__init__(**kwargs) + self.provider_location = provider_location + self.providers = providers + self.azure_locations = azure_locations + self.start_time = start_time + self.end_time = end_time + + +class AzureWebCategory(_serialization.Model): + """Azure Web Category Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar group: The name of the group that the category belongs to. + :vartype group: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "group": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "group": {"key": "properties.group", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource ID. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.etag = None + self.group = None + + +class AzureWebCategoryListResult(_serialization.Model): + """Response for ListAzureWebCategories API service call. + + :ivar value: List of Azure Web Categories for a given Subscription. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.AzureWebCategory] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[AzureWebCategory]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.AzureWebCategory"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Azure Web Categories for a given Subscription. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.AzureWebCategory] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BackendAddressInboundNatRulePortMappings(_serialization.Model): + """The response for a QueryInboundNatRulePortMapping API. + + :ivar inbound_nat_rule_port_mappings: Collection of inbound NAT rule port mappings. + :vartype inbound_nat_rule_port_mappings: + list[~azure.mgmt.network.v2023_09_01.models.InboundNatRulePortMapping] + """ + + _attribute_map = { + "inbound_nat_rule_port_mappings": {"key": "inboundNatRulePortMappings", "type": "[InboundNatRulePortMapping]"}, + } + + def __init__( + self, + *, + inbound_nat_rule_port_mappings: Optional[List["_models.InboundNatRulePortMapping"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword inbound_nat_rule_port_mappings: Collection of inbound NAT rule port mappings. + :paramtype inbound_nat_rule_port_mappings: + list[~azure.mgmt.network.v2023_09_01.models.InboundNatRulePortMapping] + """ + super().__init__(**kwargs) + self.inbound_nat_rule_port_mappings = inbound_nat_rule_port_mappings + + +class BackendAddressPool(SubResource): # pylint: disable=too-many-instance-attributes + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of backend address pools + used by the load balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar location: The location of the backend address pool. + :vartype location: str + :ivar tunnel_interfaces: An array of gateway load balancer tunnel interfaces. + :vartype tunnel_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.GatewayLoadBalancerTunnelInterface] + :ivar load_balancer_backend_addresses: An array of backend addresses. + :vartype load_balancer_backend_addresses: + list[~azure.mgmt.network.v2023_09_01.models.LoadBalancerBackendAddress] + :ivar backend_ip_configurations: An array of references to IP addresses defined in network + interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: An array of references to load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar outbound_rule: A reference to an outbound rule that uses this backend address pool. + :vartype outbound_rule: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar outbound_rules: An array of references to outbound rules that use this backend address + pool. + :vartype outbound_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar inbound_nat_rules: An array of references to inbound NAT rules that use this backend + address pool. + :vartype inbound_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the backend address pool resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar drain_period_in_seconds: Amount of seconds Load Balancer waits for before sending RESET + to client and backend address. + :vartype drain_period_in_seconds: int + :ivar virtual_network: A reference to a virtual network. + :vartype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar sync_mode: Backend address synchronous mode for the backend pool. Known values are: + "Automatic" and "Manual". + :vartype sync_mode: str or ~azure.mgmt.network.v2023_09_01.models.SyncMode + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "backend_ip_configurations": {"readonly": True}, + "load_balancing_rules": {"readonly": True}, + "outbound_rule": {"readonly": True}, + "outbound_rules": {"readonly": True}, + "inbound_nat_rules": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "properties.location", "type": "str"}, + "tunnel_interfaces": {"key": "properties.tunnelInterfaces", "type": "[GatewayLoadBalancerTunnelInterface]"}, + "load_balancer_backend_addresses": { + "key": "properties.loadBalancerBackendAddresses", + "type": "[LoadBalancerBackendAddress]", + }, + "backend_ip_configurations": { + "key": "properties.backendIPConfigurations", + "type": "[NetworkInterfaceIPConfiguration]", + }, + "load_balancing_rules": {"key": "properties.loadBalancingRules", "type": "[SubResource]"}, + "outbound_rule": {"key": "properties.outboundRule", "type": "SubResource"}, + "outbound_rules": {"key": "properties.outboundRules", "type": "[SubResource]"}, + "inbound_nat_rules": {"key": "properties.inboundNatRules", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "drain_period_in_seconds": {"key": "properties.drainPeriodInSeconds", "type": "int"}, + "virtual_network": {"key": "properties.virtualNetwork", "type": "SubResource"}, + "sync_mode": {"key": "properties.syncMode", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + location: Optional[str] = None, + tunnel_interfaces: Optional[List["_models.GatewayLoadBalancerTunnelInterface"]] = None, + load_balancer_backend_addresses: Optional[List["_models.LoadBalancerBackendAddress"]] = None, + drain_period_in_seconds: Optional[int] = None, + virtual_network: Optional["_models.SubResource"] = None, + sync_mode: Optional[Union[str, "_models.SyncMode"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of backend address pools + used by the load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword location: The location of the backend address pool. + :paramtype location: str + :keyword tunnel_interfaces: An array of gateway load balancer tunnel interfaces. + :paramtype tunnel_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.GatewayLoadBalancerTunnelInterface] + :keyword load_balancer_backend_addresses: An array of backend addresses. + :paramtype load_balancer_backend_addresses: + list[~azure.mgmt.network.v2023_09_01.models.LoadBalancerBackendAddress] + :keyword drain_period_in_seconds: Amount of seconds Load Balancer waits for before sending + RESET to client and backend address. + :paramtype drain_period_in_seconds: int + :keyword virtual_network: A reference to a virtual network. + :paramtype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword sync_mode: Backend address synchronous mode for the backend pool. Known values are: + "Automatic" and "Manual". + :paramtype sync_mode: str or ~azure.mgmt.network.v2023_09_01.models.SyncMode + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.location = location + self.tunnel_interfaces = tunnel_interfaces + self.load_balancer_backend_addresses = load_balancer_backend_addresses + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_rule = None + self.outbound_rules = None + self.inbound_nat_rules = None + self.provisioning_state = None + self.drain_period_in_seconds = drain_period_in_seconds + self.virtual_network = virtual_network + self.sync_mode = sync_mode + + +class BastionActiveSession(_serialization.Model): # pylint: disable=too-many-instance-attributes + """The session detail for a target. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar session_id: A unique id for the session. + :vartype session_id: str + :ivar start_time: The time when the session started. + :vartype start_time: JSON + :ivar target_subscription_id: The subscription id for the target virtual machine. + :vartype target_subscription_id: str + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar target_host_name: The host name of the target. + :vartype target_host_name: str + :ivar target_resource_group: The resource group of the target. + :vartype target_resource_group: str + :ivar user_name: The user name who is active on this session. + :vartype user_name: str + :ivar target_ip_address: The IP Address of the target. + :vartype target_ip_address: str + :ivar protocol: The protocol used to connect to the target. Known values are: "SSH" and "RDP". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.BastionConnectProtocol + :ivar target_resource_id: The resource id of the target. + :vartype target_resource_id: str + :ivar session_duration_in_mins: Duration in mins the session has been active. + :vartype session_duration_in_mins: float + """ + + _validation = { + "session_id": {"readonly": True}, + "start_time": {"readonly": True}, + "target_subscription_id": {"readonly": True}, + "resource_type": {"readonly": True}, + "target_host_name": {"readonly": True}, + "target_resource_group": {"readonly": True}, + "user_name": {"readonly": True}, + "target_ip_address": {"readonly": True}, + "protocol": {"readonly": True}, + "target_resource_id": {"readonly": True}, + "session_duration_in_mins": {"readonly": True}, + } + + _attribute_map = { + "session_id": {"key": "sessionId", "type": "str"}, + "start_time": {"key": "startTime", "type": "object"}, + "target_subscription_id": {"key": "targetSubscriptionId", "type": "str"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "target_host_name": {"key": "targetHostName", "type": "str"}, + "target_resource_group": {"key": "targetResourceGroup", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "target_ip_address": {"key": "targetIpAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + "session_duration_in_mins": {"key": "sessionDurationInMins", "type": "float"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.session_id = None + self.start_time = None + self.target_subscription_id = None + self.resource_type = None + self.target_host_name = None + self.target_resource_group = None + self.user_name = None + self.target_ip_address = None + self.protocol = None + self.target_resource_id = None + self.session_duration_in_mins = None + + +class BastionActiveSessionListResult(_serialization.Model): + """Response for GetActiveSessions. + + :ivar value: List of active sessions on the bastion. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BastionActiveSession] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BastionActiveSession]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.BastionActiveSession"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of active sessions on the bastion. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BastionActiveSession] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionHost(Resource): # pylint: disable=too-many-instance-attributes + """Bastion Host resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar zones: A list of availability zones denoting where the resource needs to come from. + :vartype zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar sku: The sku of this Bastion Host. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.Sku + :ivar ip_configurations: IP configuration of the Bastion Host resource. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.BastionHostIPConfiguration] + :ivar dns_name: FQDN for the endpoint on which bastion host is accessible. + :vartype dns_name: str + :ivar virtual_network: Reference to an existing virtual network required for Developer Bastion + Host only. + :vartype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar network_acls: + :vartype network_acls: + ~azure.mgmt.network.v2023_09_01.models.BastionHostPropertiesFormatNetworkAcls + :ivar provisioning_state: The provisioning state of the bastion host resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar scale_units: The scale units for the Bastion Host resource. + :vartype scale_units: int + :ivar disable_copy_paste: Enable/Disable Copy/Paste feature of the Bastion Host resource. + :vartype disable_copy_paste: bool + :ivar enable_file_copy: Enable/Disable File Copy feature of the Bastion Host resource. + :vartype enable_file_copy: bool + :ivar enable_ip_connect: Enable/Disable IP Connect feature of the Bastion Host resource. + :vartype enable_ip_connect: bool + :ivar enable_shareable_link: Enable/Disable Shareable Link of the Bastion Host resource. + :vartype enable_shareable_link: bool + :ivar enable_tunneling: Enable/Disable Tunneling feature of the Bastion Host resource. + :vartype enable_tunneling: bool + :ivar enable_kerberos: Enable/Disable Kerberos feature of the Bastion Host resource. + :vartype enable_kerberos: bool + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "scale_units": {"maximum": 50, "minimum": 2}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "zones": {"key": "zones", "type": "[str]"}, + "etag": {"key": "etag", "type": "str"}, + "sku": {"key": "sku", "type": "Sku"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[BastionHostIPConfiguration]"}, + "dns_name": {"key": "properties.dnsName", "type": "str"}, + "virtual_network": {"key": "properties.virtualNetwork", "type": "SubResource"}, + "network_acls": {"key": "properties.networkAcls", "type": "BastionHostPropertiesFormatNetworkAcls"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "scale_units": {"key": "properties.scaleUnits", "type": "int"}, + "disable_copy_paste": {"key": "properties.disableCopyPaste", "type": "bool"}, + "enable_file_copy": {"key": "properties.enableFileCopy", "type": "bool"}, + "enable_ip_connect": {"key": "properties.enableIpConnect", "type": "bool"}, + "enable_shareable_link": {"key": "properties.enableShareableLink", "type": "bool"}, + "enable_tunneling": {"key": "properties.enableTunneling", "type": "bool"}, + "enable_kerberos": {"key": "properties.enableKerberos", "type": "bool"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + sku: Optional["_models.Sku"] = None, + ip_configurations: Optional[List["_models.BastionHostIPConfiguration"]] = None, + dns_name: Optional[str] = None, + virtual_network: Optional["_models.SubResource"] = None, + network_acls: Optional["_models.BastionHostPropertiesFormatNetworkAcls"] = None, + scale_units: Optional[int] = None, + disable_copy_paste: bool = False, + enable_file_copy: bool = False, + enable_ip_connect: bool = False, + enable_shareable_link: bool = False, + enable_tunneling: bool = False, + enable_kerberos: bool = False, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword zones: A list of availability zones denoting where the resource needs to come from. + :paramtype zones: list[str] + :keyword sku: The sku of this Bastion Host. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.Sku + :keyword ip_configurations: IP configuration of the Bastion Host resource. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.BastionHostIPConfiguration] + :keyword dns_name: FQDN for the endpoint on which bastion host is accessible. + :paramtype dns_name: str + :keyword virtual_network: Reference to an existing virtual network required for Developer + Bastion Host only. + :paramtype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword network_acls: + :paramtype network_acls: + ~azure.mgmt.network.v2023_09_01.models.BastionHostPropertiesFormatNetworkAcls + :keyword scale_units: The scale units for the Bastion Host resource. + :paramtype scale_units: int + :keyword disable_copy_paste: Enable/Disable Copy/Paste feature of the Bastion Host resource. + :paramtype disable_copy_paste: bool + :keyword enable_file_copy: Enable/Disable File Copy feature of the Bastion Host resource. + :paramtype enable_file_copy: bool + :keyword enable_ip_connect: Enable/Disable IP Connect feature of the Bastion Host resource. + :paramtype enable_ip_connect: bool + :keyword enable_shareable_link: Enable/Disable Shareable Link of the Bastion Host resource. + :paramtype enable_shareable_link: bool + :keyword enable_tunneling: Enable/Disable Tunneling feature of the Bastion Host resource. + :paramtype enable_tunneling: bool + :keyword enable_kerberos: Enable/Disable Kerberos feature of the Bastion Host resource. + :paramtype enable_kerberos: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.zones = zones + self.etag = None + self.sku = sku + self.ip_configurations = ip_configurations + self.dns_name = dns_name + self.virtual_network = virtual_network + self.network_acls = network_acls + self.provisioning_state = None + self.scale_units = scale_units + self.disable_copy_paste = disable_copy_paste + self.enable_file_copy = enable_file_copy + self.enable_ip_connect = enable_ip_connect + self.enable_shareable_link = enable_shareable_link + self.enable_tunneling = enable_tunneling + self.enable_kerberos = enable_kerberos + + +class BastionHostIPConfiguration(SubResource): + """IP configuration of an Bastion Host. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Ip configuration type. + :vartype type: str + :ivar subnet: Reference of the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar public_ip_address: Reference of the PublicIP resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the bastion host IP configuration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_ip_allocation_method: Private IP allocation method. Known values are: "Static" + and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + subnet: Optional["_models.SubResource"] = None, + public_ip_address: Optional["_models.SubResource"] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the resource that is unique within a resource group. This name can be + used to access the resource. + :paramtype name: str + :keyword subnet: Reference of the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword public_ip_address: Reference of the PublicIP resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword private_ip_allocation_method: Private IP allocation method. Known values are: "Static" + and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.private_ip_allocation_method = private_ip_allocation_method + + +class BastionHostListResult(_serialization.Model): + """Response for ListBastionHosts API service call. + + :ivar value: List of Bastion Hosts in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BastionHost]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BastionHost"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of Bastion Hosts in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionHostPropertiesFormatNetworkAcls(_serialization.Model): + """BastionHostPropertiesFormatNetworkAcls. + + :ivar ip_rules: Sets the IP ACL rules for Developer Bastion Host. + :vartype ip_rules: list[~azure.mgmt.network.v2023_09_01.models.IPRule] + """ + + _attribute_map = { + "ip_rules": {"key": "ipRules", "type": "[IPRule]"}, + } + + def __init__(self, *, ip_rules: Optional[List["_models.IPRule"]] = None, **kwargs: Any) -> None: + """ + :keyword ip_rules: Sets the IP ACL rules for Developer Bastion Host. + :paramtype ip_rules: list[~azure.mgmt.network.v2023_09_01.models.IPRule] + """ + super().__init__(**kwargs) + self.ip_rules = ip_rules + + +class BastionSessionDeleteResult(_serialization.Model): + """Response for DisconnectActiveSessions. + + :ivar value: List of sessions with their corresponding state. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BastionSessionState]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.BastionSessionState"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of sessions with their corresponding state. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionSessionState(_serialization.Model): + """The session state detail for a target. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar session_id: A unique id for the session. + :vartype session_id: str + :ivar message: Used for extra information. + :vartype message: str + :ivar state: The state of the session. Disconnected/Failed/NotFound. + :vartype state: str + """ + + _validation = { + "session_id": {"readonly": True}, + "message": {"readonly": True}, + "state": {"readonly": True}, + } + + _attribute_map = { + "session_id": {"key": "sessionId", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.session_id = None + self.message = None + self.state = None + + +class BastionShareableLink(_serialization.Model): + """Bastion Shareable Link. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar vm: Reference of the virtual machine resource. Required. + :vartype vm: ~azure.mgmt.network.v2023_09_01.models.VM + :ivar bsl: The unique Bastion Shareable Link to the virtual machine. + :vartype bsl: str + :ivar created_at: The time when the link was created. + :vartype created_at: str + :ivar message: Optional field indicating the warning or error message related to the vm in case + of partial failure. + :vartype message: str + """ + + _validation = { + "vm": {"required": True}, + "bsl": {"readonly": True}, + "created_at": {"readonly": True}, + "message": {"readonly": True}, + } + + _attribute_map = { + "vm": {"key": "vm", "type": "VM"}, + "bsl": {"key": "bsl", "type": "str"}, + "created_at": {"key": "createdAt", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, vm: "_models.VM", **kwargs: Any) -> None: + """ + :keyword vm: Reference of the virtual machine resource. Required. + :paramtype vm: ~azure.mgmt.network.v2023_09_01.models.VM + """ + super().__init__(**kwargs) + self.vm = vm + self.bsl = None + self.created_at = None + self.message = None + + +class BastionShareableLinkListRequest(_serialization.Model): + """Post request for Create/Delete/Get Bastion Shareable Link endpoints. + + :ivar vms: List of VM references. + :vartype vms: list[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + """ + + _attribute_map = { + "vms": {"key": "vms", "type": "[BastionShareableLink]"}, + } + + def __init__(self, *, vms: Optional[List["_models.BastionShareableLink"]] = None, **kwargs: Any) -> None: + """ + :keyword vms: List of VM references. + :paramtype vms: list[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + """ + super().__init__(**kwargs) + self.vms = vms + + +class BastionShareableLinkListResult(_serialization.Model): + """Response for all the Bastion Shareable Link endpoints. + + :ivar value: List of Bastion Shareable Links for the request. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BastionShareableLink]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.BastionShareableLink"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Bastion Shareable Links for the request. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionShareableLinkTokenListRequest(_serialization.Model): + """Post request for Delete Bastion Shareable Link By Token endpoint. + + :ivar tokens: List of Bastion Shareable Link Token. + :vartype tokens: list[str] + """ + + _attribute_map = { + "tokens": {"key": "tokens", "type": "[str]"}, + } + + def __init__(self, *, tokens: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword tokens: List of Bastion Shareable Link Token. + :paramtype tokens: list[str] + """ + super().__init__(**kwargs) + self.tokens = tokens + + +class BGPCommunity(_serialization.Model): + """Contains bgp community information offered in Service Community resources. + + :ivar service_supported_region: The region which the service support. e.g. For O365, region is + Global. + :vartype service_supported_region: str + :ivar community_name: The name of the bgp community. e.g. Skype. + :vartype community_name: str + :ivar community_value: The value of the bgp community. For more information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :vartype community_value: str + :ivar community_prefixes: The prefixes that the bgp community contains. + :vartype community_prefixes: list[str] + :ivar is_authorized_to_use: Customer is authorized to use bgp community or not. + :vartype is_authorized_to_use: bool + :ivar service_group: The service group of the bgp community contains. + :vartype service_group: str + """ + + _attribute_map = { + "service_supported_region": {"key": "serviceSupportedRegion", "type": "str"}, + "community_name": {"key": "communityName", "type": "str"}, + "community_value": {"key": "communityValue", "type": "str"}, + "community_prefixes": {"key": "communityPrefixes", "type": "[str]"}, + "is_authorized_to_use": {"key": "isAuthorizedToUse", "type": "bool"}, + "service_group": {"key": "serviceGroup", "type": "str"}, + } + + def __init__( + self, + *, + service_supported_region: Optional[str] = None, + community_name: Optional[str] = None, + community_value: Optional[str] = None, + community_prefixes: Optional[List[str]] = None, + is_authorized_to_use: Optional[bool] = None, + service_group: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword service_supported_region: The region which the service support. e.g. For O365, region + is Global. + :paramtype service_supported_region: str + :keyword community_name: The name of the bgp community. e.g. Skype. + :paramtype community_name: str + :keyword community_value: The value of the bgp community. For more information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :paramtype community_value: str + :keyword community_prefixes: The prefixes that the bgp community contains. + :paramtype community_prefixes: list[str] + :keyword is_authorized_to_use: Customer is authorized to use bgp community or not. + :paramtype is_authorized_to_use: bool + :keyword service_group: The service group of the bgp community contains. + :paramtype service_group: str + """ + super().__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group + + +class BgpConnection(SubResource): + """Virtual Appliance Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the connection. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Connection type. + :vartype type: str + :ivar peer_asn: Peer ASN. + :vartype peer_asn: int + :ivar peer_ip: Peer IP. + :vartype peer_ip: str + :ivar hub_virtual_network_connection: The reference to the HubVirtualNetworkConnection + resource. + :vartype hub_virtual_network_connection: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar connection_state: The current state of the VirtualHub to Peer. Known values are: + "Unknown", "Connecting", "Connected", and "NotConnected". + :vartype connection_state: str or ~azure.mgmt.network.v2023_09_01.models.HubBgpConnectionStatus + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "peer_asn": {"maximum": 4294967295, "minimum": 0}, + "provisioning_state": {"readonly": True}, + "connection_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "peer_asn": {"key": "properties.peerAsn", "type": "int"}, + "peer_ip": {"key": "properties.peerIp", "type": "str"}, + "hub_virtual_network_connection": {"key": "properties.hubVirtualNetworkConnection", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "connection_state": {"key": "properties.connectionState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + peer_asn: Optional[int] = None, + peer_ip: Optional[str] = None, + hub_virtual_network_connection: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the connection. + :paramtype name: str + :keyword peer_asn: Peer ASN. + :paramtype peer_asn: int + :keyword peer_ip: Peer IP. + :paramtype peer_ip: str + :keyword hub_virtual_network_connection: The reference to the HubVirtualNetworkConnection + resource. + :paramtype hub_virtual_network_connection: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.peer_asn = peer_asn + self.peer_ip = peer_ip + self.hub_virtual_network_connection = hub_virtual_network_connection + self.provisioning_state = None + self.connection_state = None + + +class BgpPeerStatus(_serialization.Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The virtual network gateway's local address. + :vartype local_address: str + :ivar neighbor: The remote BGP peer. + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer. + :vartype asn: int + :ivar state: The BGP peer state. Known values are: "Unknown", "Stopped", "Idle", "Connecting", + and "Connected". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up. + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer. + :vartype routes_received: int + :ivar messages_sent: The number of BGP messages sent. + :vartype messages_sent: int + :ivar messages_received: The number of BGP messages received. + :vartype messages_received: int + """ + + _validation = { + "local_address": {"readonly": True}, + "neighbor": {"readonly": True}, + "asn": {"readonly": True, "maximum": 4294967295, "minimum": 0}, + "state": {"readonly": True}, + "connected_duration": {"readonly": True}, + "routes_received": {"readonly": True}, + "messages_sent": {"readonly": True}, + "messages_received": {"readonly": True}, + } + + _attribute_map = { + "local_address": {"key": "localAddress", "type": "str"}, + "neighbor": {"key": "neighbor", "type": "str"}, + "asn": {"key": "asn", "type": "int"}, + "state": {"key": "state", "type": "str"}, + "connected_duration": {"key": "connectedDuration", "type": "str"}, + "routes_received": {"key": "routesReceived", "type": "int"}, + "messages_sent": {"key": "messagesSent", "type": "int"}, + "messages_received": {"key": "messagesReceived", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None + + +class BgpPeerStatusListResult(_serialization.Model): + """Response for list BGP peer status API service call. + + :ivar value: List of BGP peers. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BgpPeerStatus] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BgpPeerStatus]"}, + } + + def __init__(self, *, value: Optional[List["_models.BgpPeerStatus"]] = None, **kwargs: Any) -> None: + """ + :keyword value: List of BGP peers. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BgpPeerStatus] + """ + super().__init__(**kwargs) + self.value = value + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar service_name: The name of the bgp community. e.g. Skype. + :vartype service_name: str + :ivar bgp_communities: A list of bgp communities. + :vartype bgp_communities: list[~azure.mgmt.network.v2023_09_01.models.BGPCommunity] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "service_name": {"key": "properties.serviceName", "type": "str"}, + "bgp_communities": {"key": "properties.bgpCommunities", "type": "[BGPCommunity]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + service_name: Optional[str] = None, + bgp_communities: Optional[List["_models.BGPCommunity"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword service_name: The name of the bgp community. e.g. Skype. + :paramtype service_name: str + :keyword bgp_communities: A list of bgp communities. + :paramtype bgp_communities: list[~azure.mgmt.network.v2023_09_01.models.BGPCommunity] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities + + +class BgpServiceCommunityListResult(_serialization.Model): + """Response for the ListServiceCommunity API service call. + + :ivar value: A list of service community resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BgpServiceCommunity] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BgpServiceCommunity]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.BgpServiceCommunity"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of service community resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BgpServiceCommunity] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BgpSettings(_serialization.Model): + """BGP settings details. + + :ivar asn: The BGP speaker's ASN. + :vartype asn: int + :ivar bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :vartype bgp_peering_address: str + :ivar peer_weight: The weight added to routes learned from this BGP speaker. + :vartype peer_weight: int + :ivar bgp_peering_addresses: BGP peering address with IP configuration ID for virtual network + gateway. + :vartype bgp_peering_addresses: + list[~azure.mgmt.network.v2023_09_01.models.IPConfigurationBgpPeeringAddress] + """ + + _validation = { + "asn": {"maximum": 4294967295, "minimum": 0}, + } + + _attribute_map = { + "asn": {"key": "asn", "type": "int"}, + "bgp_peering_address": {"key": "bgpPeeringAddress", "type": "str"}, + "peer_weight": {"key": "peerWeight", "type": "int"}, + "bgp_peering_addresses": {"key": "bgpPeeringAddresses", "type": "[IPConfigurationBgpPeeringAddress]"}, + } + + def __init__( + self, + *, + asn: Optional[int] = None, + bgp_peering_address: Optional[str] = None, + peer_weight: Optional[int] = None, + bgp_peering_addresses: Optional[List["_models.IPConfigurationBgpPeeringAddress"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword asn: The BGP speaker's ASN. + :paramtype asn: int + :keyword bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :paramtype bgp_peering_address: str + :keyword peer_weight: The weight added to routes learned from this BGP speaker. + :paramtype peer_weight: int + :keyword bgp_peering_addresses: BGP peering address with IP configuration ID for virtual + network gateway. + :paramtype bgp_peering_addresses: + list[~azure.mgmt.network.v2023_09_01.models.IPConfigurationBgpPeeringAddress] + """ + super().__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight + self.bgp_peering_addresses = bgp_peering_addresses + + +class BreakOutCategoryPolicies(_serialization.Model): + """Network Virtual Appliance Sku Properties. + + :ivar allow: Flag to control breakout of o365 allow category. + :vartype allow: bool + :ivar optimize: Flag to control breakout of o365 optimize category. + :vartype optimize: bool + :ivar default: Flag to control breakout of o365 default category. + :vartype default: bool + """ + + _attribute_map = { + "allow": {"key": "allow", "type": "bool"}, + "optimize": {"key": "optimize", "type": "bool"}, + "default": {"key": "default", "type": "bool"}, + } + + def __init__( + self, + *, + allow: Optional[bool] = None, + optimize: Optional[bool] = None, + default: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword allow: Flag to control breakout of o365 allow category. + :paramtype allow: bool + :keyword optimize: Flag to control breakout of o365 optimize category. + :paramtype optimize: bool + :keyword default: Flag to control breakout of o365 default category. + :paramtype default: bool + """ + super().__init__(**kwargs) + self.allow = allow + self.optimize = optimize + self.default = default + + +class CheckPrivateLinkServiceVisibilityRequest(_serialization.Model): + """Request body of the CheckPrivateLinkServiceVisibility API service call. + + :ivar private_link_service_alias: The alias of the private link service. + :vartype private_link_service_alias: str + """ + + _attribute_map = { + "private_link_service_alias": {"key": "privateLinkServiceAlias", "type": "str"}, + } + + def __init__(self, *, private_link_service_alias: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword private_link_service_alias: The alias of the private link service. + :paramtype private_link_service_alias: str + """ + super().__init__(**kwargs) + self.private_link_service_alias = private_link_service_alias + + +class CloudErrorBody(_serialization.Model): + """An error response from the service. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.network.v2023_09_01.models.CloudErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[CloudErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.CloudErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.network.v2023_09_01.models.CloudErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties( + _serialization.Model +): # pylint: disable=name-too-long + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConfigurationGroup(_serialization.Model): + """The network configuration group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Network group ID. + :vartype id: str + :ivar description: A description of the network group. + :vartype description: str + :ivar provisioning_state: The provisioning state of the scope assignment resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Network group ID. + :paramtype id: str + :keyword description: A description of the network group. + :paramtype description: str + """ + super().__init__(**kwargs) + self.id = id + self.description = description + self.provisioning_state = None + self.resource_guid = None + + +class ConnectionMonitor(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Parameters that define the operation to create a connection monitor. + + :ivar location: Connection monitor location. + :vartype location: str + :ivar tags: Connection monitor tags. + :vartype tags: dict[str, str] + :ivar source: Describes the source of connection monitor. + :vartype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :ivar destination: Describes the destination of connection monitor. + :vartype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :ivar auto_start: Determines if the connection monitor will start automatically once created. + :vartype auto_start: bool + :ivar monitoring_interval_in_seconds: Monitoring interval in seconds. + :vartype monitoring_interval_in_seconds: int + :ivar endpoints: List of connection monitor endpoints. + :vartype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :ivar test_configurations: List of connection monitor test configurations. + :vartype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :ivar test_groups: List of connection monitor test groups. + :vartype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :ivar outputs: List of connection monitor outputs. + :vartype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :ivar notes: Optional notes to be associated with the connection monitor. + :vartype notes: str + """ + + _validation = { + "monitoring_interval_in_seconds": {"maximum": 1800, "minimum": 30}, + } + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "source": {"key": "properties.source", "type": "ConnectionMonitorSource"}, + "destination": {"key": "properties.destination", "type": "ConnectionMonitorDestination"}, + "auto_start": {"key": "properties.autoStart", "type": "bool"}, + "monitoring_interval_in_seconds": {"key": "properties.monitoringIntervalInSeconds", "type": "int"}, + "endpoints": {"key": "properties.endpoints", "type": "[ConnectionMonitorEndpoint]"}, + "test_configurations": {"key": "properties.testConfigurations", "type": "[ConnectionMonitorTestConfiguration]"}, + "test_groups": {"key": "properties.testGroups", "type": "[ConnectionMonitorTestGroup]"}, + "outputs": {"key": "properties.outputs", "type": "[ConnectionMonitorOutput]"}, + "notes": {"key": "properties.notes", "type": "str"}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["_models.ConnectionMonitorSource"] = None, + destination: Optional["_models.ConnectionMonitorDestination"] = None, + auto_start: bool = True, + monitoring_interval_in_seconds: int = 60, + endpoints: Optional[List["_models.ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["_models.ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["_models.ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["_models.ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: Connection monitor location. + :paramtype location: str + :keyword tags: Connection monitor tags. + :paramtype tags: dict[str, str] + :keyword source: Describes the source of connection monitor. + :paramtype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :keyword destination: Describes the destination of connection monitor. + :paramtype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :keyword auto_start: Determines if the connection monitor will start automatically once + created. + :paramtype auto_start: bool + :keyword monitoring_interval_in_seconds: Monitoring interval in seconds. + :paramtype monitoring_interval_in_seconds: int + :keyword endpoints: List of connection monitor endpoints. + :paramtype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :keyword test_configurations: List of connection monitor test configurations. + :paramtype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :keyword test_groups: List of connection monitor test groups. + :paramtype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :keyword outputs: List of connection monitor outputs. + :paramtype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :keyword notes: Optional notes to be associated with the connection monitor. + :paramtype notes: str + """ + super().__init__(**kwargs) + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.endpoints = endpoints + self.test_configurations = test_configurations + self.test_groups = test_groups + self.outputs = outputs + self.notes = notes + + +class ConnectionMonitorDestination(_serialization.Model): + """Describes the destination of connection monitor. + + :ivar resource_id: The ID of the resource used as the destination by connection monitor. + :vartype resource_id: str + :ivar address: Address of the connection monitor destination (IP or domain name). + :vartype address: str + :ivar port: The destination port used by connection monitor. + :vartype port: int + """ + + _validation = { + "port": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + address: Optional[str] = None, + port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The ID of the resource used as the destination by connection monitor. + :paramtype resource_id: str + :keyword address: Address of the connection monitor destination (IP or domain name). + :paramtype address: str + :keyword port: The destination port used by connection monitor. + :paramtype port: int + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port + + +class ConnectionMonitorEndpoint(_serialization.Model): + """Describes the connection monitor endpoint. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the connection monitor endpoint. Required. + :vartype name: str + :ivar type: The endpoint type. Known values are: "AzureVM", "AzureVNet", "AzureSubnet", + "ExternalAddress", "MMAWorkspaceMachine", "MMAWorkspaceNetwork", "AzureArcVM", and "AzureVMSS". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.EndpointType + :ivar resource_id: Resource ID of the connection monitor endpoint. + :vartype resource_id: str + :ivar address: Address of the connection monitor endpoint (IP or domain name). + :vartype address: str + :ivar filter: Filter for sub-items within the endpoint. + :vartype filter: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilter + :ivar scope: Endpoint scope. + :vartype scope: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointScope + :ivar coverage_level: Test coverage for the endpoint. Known values are: "Default", "Low", + "BelowAverage", "Average", "AboveAverage", and "Full". + :vartype coverage_level: str or ~azure.mgmt.network.v2023_09_01.models.CoverageLevel + """ + + _validation = { + "name": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "filter": {"key": "filter", "type": "ConnectionMonitorEndpointFilter"}, + "scope": {"key": "scope", "type": "ConnectionMonitorEndpointScope"}, + "coverage_level": {"key": "coverageLevel", "type": "str"}, + } + + def __init__( + self, + *, + name: str, + type: Optional[Union[str, "_models.EndpointType"]] = None, + resource_id: Optional[str] = None, + address: Optional[str] = None, + filter: Optional["_models.ConnectionMonitorEndpointFilter"] = None, # pylint: disable=redefined-builtin + scope: Optional["_models.ConnectionMonitorEndpointScope"] = None, + coverage_level: Optional[Union[str, "_models.CoverageLevel"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the connection monitor endpoint. Required. + :paramtype name: str + :keyword type: The endpoint type. Known values are: "AzureVM", "AzureVNet", "AzureSubnet", + "ExternalAddress", "MMAWorkspaceMachine", "MMAWorkspaceNetwork", "AzureArcVM", and "AzureVMSS". + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.EndpointType + :keyword resource_id: Resource ID of the connection monitor endpoint. + :paramtype resource_id: str + :keyword address: Address of the connection monitor endpoint (IP or domain name). + :paramtype address: str + :keyword filter: Filter for sub-items within the endpoint. + :paramtype filter: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilter + :keyword scope: Endpoint scope. + :paramtype scope: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointScope + :keyword coverage_level: Test coverage for the endpoint. Known values are: "Default", "Low", + "BelowAverage", "Average", "AboveAverage", and "Full". + :paramtype coverage_level: str or ~azure.mgmt.network.v2023_09_01.models.CoverageLevel + """ + super().__init__(**kwargs) + self.name = name + self.type = type + self.resource_id = resource_id + self.address = address + self.filter = filter + self.scope = scope + self.coverage_level = coverage_level + + +class ConnectionMonitorEndpointFilter(_serialization.Model): + """Describes the connection monitor endpoint filter. + + :ivar type: The behavior of the endpoint filter. Currently only 'Include' is supported. + "Include" + :vartype type: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilterType + :ivar items: List of items in the filter. + :vartype items: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "items": {"key": "items", "type": "[ConnectionMonitorEndpointFilterItem]"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ConnectionMonitorEndpointFilterType"]] = None, + items: Optional[List["_models.ConnectionMonitorEndpointFilterItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: The behavior of the endpoint filter. Currently only 'Include' is supported. + "Include" + :paramtype type: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilterType + :keyword items: List of items in the filter. + :paramtype items: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilterItem] + """ + super().__init__(**kwargs) + self.type = type + self.items = items + + +class ConnectionMonitorEndpointFilterItem(_serialization.Model): + """Describes the connection monitor endpoint filter item. + + :ivar type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. "AgentAddress" + :vartype type: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilterItemType + :ivar address: The address of the filter item. + :vartype address: str + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "address": {"key": "address", "type": "str"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ConnectionMonitorEndpointFilterItemType"]] = None, + address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. "AgentAddress" + :paramtype type: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointFilterItemType + :keyword address: The address of the filter item. + :paramtype address: str + """ + super().__init__(**kwargs) + self.type = type + self.address = address + + +class ConnectionMonitorEndpointScope(_serialization.Model): + """Describes the connection monitor endpoint scope. + + :ivar include: List of items which needs to be included to the endpoint scope. + :vartype include: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointScopeItem] + :ivar exclude: List of items which needs to be excluded from the endpoint scope. + :vartype exclude: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointScopeItem] + """ + + _attribute_map = { + "include": {"key": "include", "type": "[ConnectionMonitorEndpointScopeItem]"}, + "exclude": {"key": "exclude", "type": "[ConnectionMonitorEndpointScopeItem]"}, + } + + def __init__( + self, + *, + include: Optional[List["_models.ConnectionMonitorEndpointScopeItem"]] = None, + exclude: Optional[List["_models.ConnectionMonitorEndpointScopeItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword include: List of items which needs to be included to the endpoint scope. + :paramtype include: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointScopeItem] + :keyword exclude: List of items which needs to be excluded from the endpoint scope. + :paramtype exclude: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpointScopeItem] + """ + super().__init__(**kwargs) + self.include = include + self.exclude = exclude + + +class ConnectionMonitorEndpointScopeItem(_serialization.Model): + """Describes the connection monitor endpoint scope item. + + :ivar address: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + IPv4/IPv6 IP address. + :vartype address: str + """ + + _attribute_map = { + "address": {"key": "address", "type": "str"}, + } + + def __init__(self, *, address: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword address: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask + or IPv4/IPv6 IP address. + :paramtype address: str + """ + super().__init__(**kwargs) + self.address = address + + +class ConnectionMonitorHttpConfiguration(_serialization.Model): + """Describes the HTTP configuration. + + :ivar port: The port to connect to. + :vartype port: int + :ivar method: The HTTP method to use. Known values are: "Get" and "Post". + :vartype method: str or ~azure.mgmt.network.v2023_09_01.models.HTTPConfigurationMethod + :ivar path: The path component of the URI. For instance, "/dir1/dir2". + :vartype path: str + :ivar request_headers: The HTTP headers to transmit with the request. + :vartype request_headers: list[~azure.mgmt.network.v2023_09_01.models.HTTPHeader] + :ivar valid_status_code_ranges: HTTP status codes to consider successful. For instance, + "2xx,301-304,418". + :vartype valid_status_code_ranges: list[str] + :ivar prefer_https: Value indicating whether HTTPS is preferred over HTTP in cases where the + choice is not explicit. + :vartype prefer_https: bool + """ + + _validation = { + "port": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "port": {"key": "port", "type": "int"}, + "method": {"key": "method", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "request_headers": {"key": "requestHeaders", "type": "[HTTPHeader]"}, + "valid_status_code_ranges": {"key": "validStatusCodeRanges", "type": "[str]"}, + "prefer_https": {"key": "preferHTTPS", "type": "bool"}, + } + + def __init__( + self, + *, + port: Optional[int] = None, + method: Optional[Union[str, "_models.HTTPConfigurationMethod"]] = None, + path: Optional[str] = None, + request_headers: Optional[List["_models.HTTPHeader"]] = None, + valid_status_code_ranges: Optional[List[str]] = None, + prefer_https: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword port: The port to connect to. + :paramtype port: int + :keyword method: The HTTP method to use. Known values are: "Get" and "Post". + :paramtype method: str or ~azure.mgmt.network.v2023_09_01.models.HTTPConfigurationMethod + :keyword path: The path component of the URI. For instance, "/dir1/dir2". + :paramtype path: str + :keyword request_headers: The HTTP headers to transmit with the request. + :paramtype request_headers: list[~azure.mgmt.network.v2023_09_01.models.HTTPHeader] + :keyword valid_status_code_ranges: HTTP status codes to consider successful. For instance, + "2xx,301-304,418". + :paramtype valid_status_code_ranges: list[str] + :keyword prefer_https: Value indicating whether HTTPS is preferred over HTTP in cases where the + choice is not explicit. + :paramtype prefer_https: bool + """ + super().__init__(**kwargs) + self.port = port + self.method = method + self.path = path + self.request_headers = request_headers + self.valid_status_code_ranges = valid_status_code_ranges + self.prefer_https = prefer_https + + +class ConnectionMonitorIcmpConfiguration(_serialization.Model): + """Describes the ICMP configuration. + + :ivar disable_trace_route: Value indicating whether path evaluation with trace route should be + disabled. + :vartype disable_trace_route: bool + """ + + _attribute_map = { + "disable_trace_route": {"key": "disableTraceRoute", "type": "bool"}, + } + + def __init__(self, *, disable_trace_route: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword disable_trace_route: Value indicating whether path evaluation with trace route should + be disabled. + :paramtype disable_trace_route: bool + """ + super().__init__(**kwargs) + self.disable_trace_route = disable_trace_route + + +class ConnectionMonitorListResult(_serialization.Model): + """List of connection monitors. + + :ivar value: Information about connection monitors. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ConnectionMonitorResult]"}, + } + + def __init__(self, *, value: Optional[List["_models.ConnectionMonitorResult"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Information about connection monitors. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + """ + super().__init__(**kwargs) + self.value = value + + +class ConnectionMonitorOutput(_serialization.Model): + """Describes a connection monitor output destination. + + :ivar type: Connection monitor output destination type. Currently, only "Workspace" is + supported. "Workspace" + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.OutputType + :ivar workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :vartype workspace_settings: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorWorkspaceSettings + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "workspace_settings": {"key": "workspaceSettings", "type": "ConnectionMonitorWorkspaceSettings"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.OutputType"]] = None, + workspace_settings: Optional["_models.ConnectionMonitorWorkspaceSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Connection monitor output destination type. Currently, only "Workspace" is + supported. "Workspace" + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.OutputType + :keyword workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :paramtype workspace_settings: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorWorkspaceSettings + """ + super().__init__(**kwargs) + self.type = type + self.workspace_settings = workspace_settings + + +class ConnectionMonitorParameters(_serialization.Model): + """Parameters that define the operation to create a connection monitor. + + :ivar source: Describes the source of connection monitor. + :vartype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :ivar destination: Describes the destination of connection monitor. + :vartype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :ivar auto_start: Determines if the connection monitor will start automatically once created. + :vartype auto_start: bool + :ivar monitoring_interval_in_seconds: Monitoring interval in seconds. + :vartype monitoring_interval_in_seconds: int + :ivar endpoints: List of connection monitor endpoints. + :vartype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :ivar test_configurations: List of connection monitor test configurations. + :vartype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :ivar test_groups: List of connection monitor test groups. + :vartype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :ivar outputs: List of connection monitor outputs. + :vartype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :ivar notes: Optional notes to be associated with the connection monitor. + :vartype notes: str + """ + + _validation = { + "monitoring_interval_in_seconds": {"maximum": 1800, "minimum": 30}, + } + + _attribute_map = { + "source": {"key": "source", "type": "ConnectionMonitorSource"}, + "destination": {"key": "destination", "type": "ConnectionMonitorDestination"}, + "auto_start": {"key": "autoStart", "type": "bool"}, + "monitoring_interval_in_seconds": {"key": "monitoringIntervalInSeconds", "type": "int"}, + "endpoints": {"key": "endpoints", "type": "[ConnectionMonitorEndpoint]"}, + "test_configurations": {"key": "testConfigurations", "type": "[ConnectionMonitorTestConfiguration]"}, + "test_groups": {"key": "testGroups", "type": "[ConnectionMonitorTestGroup]"}, + "outputs": {"key": "outputs", "type": "[ConnectionMonitorOutput]"}, + "notes": {"key": "notes", "type": "str"}, + } + + def __init__( + self, + *, + source: Optional["_models.ConnectionMonitorSource"] = None, + destination: Optional["_models.ConnectionMonitorDestination"] = None, + auto_start: bool = True, + monitoring_interval_in_seconds: int = 60, + endpoints: Optional[List["_models.ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["_models.ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["_models.ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["_models.ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword source: Describes the source of connection monitor. + :paramtype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :keyword destination: Describes the destination of connection monitor. + :paramtype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :keyword auto_start: Determines if the connection monitor will start automatically once + created. + :paramtype auto_start: bool + :keyword monitoring_interval_in_seconds: Monitoring interval in seconds. + :paramtype monitoring_interval_in_seconds: int + :keyword endpoints: List of connection monitor endpoints. + :paramtype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :keyword test_configurations: List of connection monitor test configurations. + :paramtype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :keyword test_groups: List of connection monitor test groups. + :paramtype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :keyword outputs: List of connection monitor outputs. + :paramtype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :keyword notes: Optional notes to be associated with the connection monitor. + :paramtype notes: str + """ + super().__init__(**kwargs) + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.endpoints = endpoints + self.test_configurations = test_configurations + self.test_groups = test_groups + self.outputs = outputs + self.notes = notes + + +class ConnectionMonitorQueryResult(_serialization.Model): + """List of connection states snapshots. + + :ivar source_status: Status of connection monitor source. Known values are: "Unknown", + "Active", and "Inactive". + :vartype source_status: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSourceStatus + :ivar states: Information about connection states. + :vartype states: list[~azure.mgmt.network.v2023_09_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + "source_status": {"key": "sourceStatus", "type": "str"}, + "states": {"key": "states", "type": "[ConnectionStateSnapshot]"}, + } + + def __init__( + self, + *, + source_status: Optional[Union[str, "_models.ConnectionMonitorSourceStatus"]] = None, + states: Optional[List["_models.ConnectionStateSnapshot"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword source_status: Status of connection monitor source. Known values are: "Unknown", + "Active", and "Inactive". + :paramtype source_status: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSourceStatus + :keyword states: Information about connection states. + :paramtype states: list[~azure.mgmt.network.v2023_09_01.models.ConnectionStateSnapshot] + """ + super().__init__(**kwargs) + self.source_status = source_status + self.states = states + + +class ConnectionMonitorResult(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Connection monitor type. + :vartype type: str + :ivar location: Connection monitor location. + :vartype location: str + :ivar tags: Connection monitor tags. + :vartype tags: dict[str, str] + :ivar source: Describes the source of connection monitor. + :vartype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :ivar destination: Describes the destination of connection monitor. + :vartype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :ivar auto_start: Determines if the connection monitor will start automatically once created. + :vartype auto_start: bool + :ivar monitoring_interval_in_seconds: Monitoring interval in seconds. + :vartype monitoring_interval_in_seconds: int + :ivar endpoints: List of connection monitor endpoints. + :vartype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :ivar test_configurations: List of connection monitor test configurations. + :vartype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :ivar test_groups: List of connection monitor test groups. + :vartype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :ivar outputs: List of connection monitor outputs. + :vartype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :ivar notes: Optional notes to be associated with the connection monitor. + :vartype notes: str + :ivar provisioning_state: The provisioning state of the connection monitor. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar start_time: The date and time when the connection monitor was started. + :vartype start_time: ~datetime.datetime + :ivar monitoring_status: The monitoring status of the connection monitor. + :vartype monitoring_status: str + :ivar connection_monitor_type: Type of connection monitor. Known values are: "MultiEndpoint" + and "SingleSourceDestination". + :vartype connection_monitor_type: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorType + """ + + _validation = { + "name": {"readonly": True}, + "id": {"readonly": True}, + "etag": {"readonly": True}, + "type": {"readonly": True}, + "monitoring_interval_in_seconds": {"maximum": 1800, "minimum": 30}, + "provisioning_state": {"readonly": True}, + "start_time": {"readonly": True}, + "monitoring_status": {"readonly": True}, + "connection_monitor_type": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "source": {"key": "properties.source", "type": "ConnectionMonitorSource"}, + "destination": {"key": "properties.destination", "type": "ConnectionMonitorDestination"}, + "auto_start": {"key": "properties.autoStart", "type": "bool"}, + "monitoring_interval_in_seconds": {"key": "properties.monitoringIntervalInSeconds", "type": "int"}, + "endpoints": {"key": "properties.endpoints", "type": "[ConnectionMonitorEndpoint]"}, + "test_configurations": {"key": "properties.testConfigurations", "type": "[ConnectionMonitorTestConfiguration]"}, + "test_groups": {"key": "properties.testGroups", "type": "[ConnectionMonitorTestGroup]"}, + "outputs": {"key": "properties.outputs", "type": "[ConnectionMonitorOutput]"}, + "notes": {"key": "properties.notes", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "monitoring_status": {"key": "properties.monitoringStatus", "type": "str"}, + "connection_monitor_type": {"key": "properties.connectionMonitorType", "type": "str"}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["_models.ConnectionMonitorSource"] = None, + destination: Optional["_models.ConnectionMonitorDestination"] = None, + auto_start: bool = True, + monitoring_interval_in_seconds: int = 60, + endpoints: Optional[List["_models.ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["_models.ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["_models.ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["_models.ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: Connection monitor location. + :paramtype location: str + :keyword tags: Connection monitor tags. + :paramtype tags: dict[str, str] + :keyword source: Describes the source of connection monitor. + :paramtype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :keyword destination: Describes the destination of connection monitor. + :paramtype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :keyword auto_start: Determines if the connection monitor will start automatically once + created. + :paramtype auto_start: bool + :keyword monitoring_interval_in_seconds: Monitoring interval in seconds. + :paramtype monitoring_interval_in_seconds: int + :keyword endpoints: List of connection monitor endpoints. + :paramtype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :keyword test_configurations: List of connection monitor test configurations. + :paramtype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :keyword test_groups: List of connection monitor test groups. + :paramtype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :keyword outputs: List of connection monitor outputs. + :paramtype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :keyword notes: Optional notes to be associated with the connection monitor. + :paramtype notes: str + """ + super().__init__(**kwargs) + self.name = None + self.id = None + self.etag = None + self.type = None + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.endpoints = endpoints + self.test_configurations = test_configurations + self.test_groups = test_groups + self.outputs = outputs + self.notes = notes + self.provisioning_state = None + self.start_time = None + self.monitoring_status = None + self.connection_monitor_type = None + + +class ConnectionMonitorResultProperties(ConnectionMonitorParameters): # pylint: disable=too-many-instance-attributes + """Describes the properties of a connection monitor. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar source: Describes the source of connection monitor. + :vartype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :ivar destination: Describes the destination of connection monitor. + :vartype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :ivar auto_start: Determines if the connection monitor will start automatically once created. + :vartype auto_start: bool + :ivar monitoring_interval_in_seconds: Monitoring interval in seconds. + :vartype monitoring_interval_in_seconds: int + :ivar endpoints: List of connection monitor endpoints. + :vartype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :ivar test_configurations: List of connection monitor test configurations. + :vartype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :ivar test_groups: List of connection monitor test groups. + :vartype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :ivar outputs: List of connection monitor outputs. + :vartype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :ivar notes: Optional notes to be associated with the connection monitor. + :vartype notes: str + :ivar provisioning_state: The provisioning state of the connection monitor. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar start_time: The date and time when the connection monitor was started. + :vartype start_time: ~datetime.datetime + :ivar monitoring_status: The monitoring status of the connection monitor. + :vartype monitoring_status: str + :ivar connection_monitor_type: Type of connection monitor. Known values are: "MultiEndpoint" + and "SingleSourceDestination". + :vartype connection_monitor_type: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorType + """ + + _validation = { + "monitoring_interval_in_seconds": {"maximum": 1800, "minimum": 30}, + "provisioning_state": {"readonly": True}, + "start_time": {"readonly": True}, + "monitoring_status": {"readonly": True}, + "connection_monitor_type": {"readonly": True}, + } + + _attribute_map = { + "source": {"key": "source", "type": "ConnectionMonitorSource"}, + "destination": {"key": "destination", "type": "ConnectionMonitorDestination"}, + "auto_start": {"key": "autoStart", "type": "bool"}, + "monitoring_interval_in_seconds": {"key": "monitoringIntervalInSeconds", "type": "int"}, + "endpoints": {"key": "endpoints", "type": "[ConnectionMonitorEndpoint]"}, + "test_configurations": {"key": "testConfigurations", "type": "[ConnectionMonitorTestConfiguration]"}, + "test_groups": {"key": "testGroups", "type": "[ConnectionMonitorTestGroup]"}, + "outputs": {"key": "outputs", "type": "[ConnectionMonitorOutput]"}, + "notes": {"key": "notes", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "monitoring_status": {"key": "monitoringStatus", "type": "str"}, + "connection_monitor_type": {"key": "connectionMonitorType", "type": "str"}, + } + + def __init__( + self, + *, + source: Optional["_models.ConnectionMonitorSource"] = None, + destination: Optional["_models.ConnectionMonitorDestination"] = None, + auto_start: bool = True, + monitoring_interval_in_seconds: int = 60, + endpoints: Optional[List["_models.ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["_models.ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["_models.ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["_models.ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword source: Describes the source of connection monitor. + :paramtype source: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSource + :keyword destination: Describes the destination of connection monitor. + :paramtype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorDestination + :keyword auto_start: Determines if the connection monitor will start automatically once + created. + :paramtype auto_start: bool + :keyword monitoring_interval_in_seconds: Monitoring interval in seconds. + :paramtype monitoring_interval_in_seconds: int + :keyword endpoints: List of connection monitor endpoints. + :paramtype endpoints: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorEndpoint] + :keyword test_configurations: List of connection monitor test configurations. + :paramtype test_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfiguration] + :keyword test_groups: List of connection monitor test groups. + :paramtype test_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestGroup] + :keyword outputs: List of connection monitor outputs. + :paramtype outputs: list[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorOutput] + :keyword notes: Optional notes to be associated with the connection monitor. + :paramtype notes: str + """ + super().__init__( + source=source, + destination=destination, + auto_start=auto_start, + monitoring_interval_in_seconds=monitoring_interval_in_seconds, + endpoints=endpoints, + test_configurations=test_configurations, + test_groups=test_groups, + outputs=outputs, + notes=notes, + **kwargs + ) + self.provisioning_state = None + self.start_time = None + self.monitoring_status = None + self.connection_monitor_type = None + + +class ConnectionMonitorSource(_serialization.Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: The ID of the resource used as the source by connection monitor. Required. + :vartype resource_id: str + :ivar port: The source port used by connection monitor. + :vartype port: int + """ + + _validation = { + "resource_id": {"required": True}, + "port": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, resource_id: str, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword resource_id: The ID of the resource used as the source by connection monitor. + Required. + :paramtype resource_id: str + :keyword port: The source port used by connection monitor. + :paramtype port: int + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.port = port + + +class ConnectionMonitorSuccessThreshold(_serialization.Model): + """Describes the threshold for declaring a test successful. + + :ivar checks_failed_percent: The maximum percentage of failed checks permitted for a test to + evaluate as successful. + :vartype checks_failed_percent: int + :ivar round_trip_time_ms: The maximum round-trip time in milliseconds permitted for a test to + evaluate as successful. + :vartype round_trip_time_ms: float + """ + + _attribute_map = { + "checks_failed_percent": {"key": "checksFailedPercent", "type": "int"}, + "round_trip_time_ms": {"key": "roundTripTimeMs", "type": "float"}, + } + + def __init__( + self, *, checks_failed_percent: Optional[int] = None, round_trip_time_ms: Optional[float] = None, **kwargs: Any + ) -> None: + """ + :keyword checks_failed_percent: The maximum percentage of failed checks permitted for a test to + evaluate as successful. + :paramtype checks_failed_percent: int + :keyword round_trip_time_ms: The maximum round-trip time in milliseconds permitted for a test + to evaluate as successful. + :paramtype round_trip_time_ms: float + """ + super().__init__(**kwargs) + self.checks_failed_percent = checks_failed_percent + self.round_trip_time_ms = round_trip_time_ms + + +class ConnectionMonitorTcpConfiguration(_serialization.Model): + """Describes the TCP configuration. + + :ivar port: The port to connect to. + :vartype port: int + :ivar disable_trace_route: Value indicating whether path evaluation with trace route should be + disabled. + :vartype disable_trace_route: bool + :ivar destination_port_behavior: Destination port behavior. Known values are: "None" and + "ListenIfAvailable". + :vartype destination_port_behavior: str or + ~azure.mgmt.network.v2023_09_01.models.DestinationPortBehavior + """ + + _validation = { + "port": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "port": {"key": "port", "type": "int"}, + "disable_trace_route": {"key": "disableTraceRoute", "type": "bool"}, + "destination_port_behavior": {"key": "destinationPortBehavior", "type": "str"}, + } + + def __init__( + self, + *, + port: Optional[int] = None, + disable_trace_route: Optional[bool] = None, + destination_port_behavior: Optional[Union[str, "_models.DestinationPortBehavior"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword port: The port to connect to. + :paramtype port: int + :keyword disable_trace_route: Value indicating whether path evaluation with trace route should + be disabled. + :paramtype disable_trace_route: bool + :keyword destination_port_behavior: Destination port behavior. Known values are: "None" and + "ListenIfAvailable". + :paramtype destination_port_behavior: str or + ~azure.mgmt.network.v2023_09_01.models.DestinationPortBehavior + """ + super().__init__(**kwargs) + self.port = port + self.disable_trace_route = disable_trace_route + self.destination_port_behavior = destination_port_behavior + + +class ConnectionMonitorTestConfiguration(_serialization.Model): + """Describes a connection monitor test configuration. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the connection monitor test configuration. Required. + :vartype name: str + :ivar test_frequency_sec: The frequency of test evaluation, in seconds. + :vartype test_frequency_sec: int + :ivar protocol: The protocol to use in test evaluation. Required. Known values are: "Tcp", + "Http", and "Icmp". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfigurationProtocol + :ivar preferred_ip_version: The preferred IP version to use in test evaluation. The connection + monitor may choose to use a different version depending on other parameters. Known values are: + "IPv4" and "IPv6". + :vartype preferred_ip_version: str or ~azure.mgmt.network.v2023_09_01.models.PreferredIPVersion + :ivar http_configuration: The parameters used to perform test evaluation over HTTP. + :vartype http_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorHttpConfiguration + :ivar tcp_configuration: The parameters used to perform test evaluation over TCP. + :vartype tcp_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTcpConfiguration + :ivar icmp_configuration: The parameters used to perform test evaluation over ICMP. + :vartype icmp_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorIcmpConfiguration + :ivar success_threshold: The threshold for declaring a test successful. + :vartype success_threshold: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSuccessThreshold + """ + + _validation = { + "name": {"required": True}, + "protocol": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "test_frequency_sec": {"key": "testFrequencySec", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + "preferred_ip_version": {"key": "preferredIPVersion", "type": "str"}, + "http_configuration": {"key": "httpConfiguration", "type": "ConnectionMonitorHttpConfiguration"}, + "tcp_configuration": {"key": "tcpConfiguration", "type": "ConnectionMonitorTcpConfiguration"}, + "icmp_configuration": {"key": "icmpConfiguration", "type": "ConnectionMonitorIcmpConfiguration"}, + "success_threshold": {"key": "successThreshold", "type": "ConnectionMonitorSuccessThreshold"}, + } + + def __init__( + self, + *, + name: str, + protocol: Union[str, "_models.ConnectionMonitorTestConfigurationProtocol"], + test_frequency_sec: Optional[int] = None, + preferred_ip_version: Optional[Union[str, "_models.PreferredIPVersion"]] = None, + http_configuration: Optional["_models.ConnectionMonitorHttpConfiguration"] = None, + tcp_configuration: Optional["_models.ConnectionMonitorTcpConfiguration"] = None, + icmp_configuration: Optional["_models.ConnectionMonitorIcmpConfiguration"] = None, + success_threshold: Optional["_models.ConnectionMonitorSuccessThreshold"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the connection monitor test configuration. Required. + :paramtype name: str + :keyword test_frequency_sec: The frequency of test evaluation, in seconds. + :paramtype test_frequency_sec: int + :keyword protocol: The protocol to use in test evaluation. Required. Known values are: "Tcp", + "Http", and "Icmp". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTestConfigurationProtocol + :keyword preferred_ip_version: The preferred IP version to use in test evaluation. The + connection monitor may choose to use a different version depending on other parameters. Known + values are: "IPv4" and "IPv6". + :paramtype preferred_ip_version: str or + ~azure.mgmt.network.v2023_09_01.models.PreferredIPVersion + :keyword http_configuration: The parameters used to perform test evaluation over HTTP. + :paramtype http_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorHttpConfiguration + :keyword tcp_configuration: The parameters used to perform test evaluation over TCP. + :paramtype tcp_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorTcpConfiguration + :keyword icmp_configuration: The parameters used to perform test evaluation over ICMP. + :paramtype icmp_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorIcmpConfiguration + :keyword success_threshold: The threshold for declaring a test successful. + :paramtype success_threshold: + ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorSuccessThreshold + """ + super().__init__(**kwargs) + self.name = name + self.test_frequency_sec = test_frequency_sec + self.protocol = protocol + self.preferred_ip_version = preferred_ip_version + self.http_configuration = http_configuration + self.tcp_configuration = tcp_configuration + self.icmp_configuration = icmp_configuration + self.success_threshold = success_threshold + + +class ConnectionMonitorTestGroup(_serialization.Model): + """Describes the connection monitor test group. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the connection monitor test group. Required. + :vartype name: str + :ivar disable: Value indicating whether test group is disabled. + :vartype disable: bool + :ivar test_configurations: List of test configuration names. Required. + :vartype test_configurations: list[str] + :ivar sources: List of source endpoint names. Required. + :vartype sources: list[str] + :ivar destinations: List of destination endpoint names. Required. + :vartype destinations: list[str] + """ + + _validation = { + "name": {"required": True}, + "test_configurations": {"required": True}, + "sources": {"required": True}, + "destinations": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "disable": {"key": "disable", "type": "bool"}, + "test_configurations": {"key": "testConfigurations", "type": "[str]"}, + "sources": {"key": "sources", "type": "[str]"}, + "destinations": {"key": "destinations", "type": "[str]"}, + } + + def __init__( + self, + *, + name: str, + test_configurations: List[str], + sources: List[str], + destinations: List[str], + disable: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the connection monitor test group. Required. + :paramtype name: str + :keyword disable: Value indicating whether test group is disabled. + :paramtype disable: bool + :keyword test_configurations: List of test configuration names. Required. + :paramtype test_configurations: list[str] + :keyword sources: List of source endpoint names. Required. + :paramtype sources: list[str] + :keyword destinations: List of destination endpoint names. Required. + :paramtype destinations: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.disable = disable + self.test_configurations = test_configurations + self.sources = sources + self.destinations = destinations + + +class ConnectionMonitorWorkspaceSettings(_serialization.Model): + """Describes the settings for producing output into a log analytics workspace. + + :ivar workspace_resource_id: Log analytics workspace resource ID. + :vartype workspace_resource_id: str + """ + + _attribute_map = { + "workspace_resource_id": {"key": "workspaceResourceId", "type": "str"}, + } + + def __init__(self, *, workspace_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword workspace_resource_id: Log analytics workspace resource ID. + :paramtype workspace_resource_id: str + """ + super().__init__(**kwargs) + self.workspace_resource_id = workspace_resource_id + + +class ConnectionResetSharedKey(_serialization.Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to server. + + :ivar key_length: The virtual network connection reset shared key length, should between 1 and + 128. Required. + :vartype key_length: int + """ + + _validation = { + "key_length": {"required": True, "maximum": 128, "minimum": 1}, + } + + _attribute_map = { + "key_length": {"key": "keyLength", "type": "int"}, + } + + def __init__(self, *, key_length: int, **kwargs: Any) -> None: + """ + :keyword key_length: The virtual network connection reset shared key length, should between 1 + and 128. Required. + :paramtype key_length: int + """ + super().__init__(**kwargs) + self.key_length = key_length + + +class ConnectionSharedKey(SubResource): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar value: The virtual network connection shared key value. Required. + :vartype value: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__( + self, *, value: str, id: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword value: The virtual network connection shared key value. Required. + :paramtype value: str + """ + super().__init__(id=id, **kwargs) + self.value = value + + +class ConnectionStateSnapshot(_serialization.Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar connection_state: The connection state. Known values are: "Reachable", "Unreachable", and + "Unknown". + :vartype connection_state: str or ~azure.mgmt.network.v2023_09_01.models.ConnectionState + :ivar start_time: The start time of the connection snapshot. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the connection snapshot. + :vartype end_time: ~datetime.datetime + :ivar evaluation_state: Connectivity analysis evaluation state. Known values are: "NotStarted", + "InProgress", and "Completed". + :vartype evaluation_state: str or ~azure.mgmt.network.v2023_09_01.models.EvaluationState + :ivar avg_latency_in_ms: Average latency in ms. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in ms. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in ms. + :vartype max_latency_in_ms: int + :ivar probes_sent: The number of sent probes. + :vartype probes_sent: int + :ivar probes_failed: The number of failed probes. + :vartype probes_failed: int + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityHop] + """ + + _validation = { + "avg_latency_in_ms": {"maximum": 4294967295, "minimum": 0}, + "min_latency_in_ms": {"maximum": 4294967295, "minimum": 0}, + "max_latency_in_ms": {"maximum": 4294967295, "minimum": 0}, + "probes_sent": {"maximum": 4294967295, "minimum": 0}, + "probes_failed": {"maximum": 4294967295, "minimum": 0}, + "hops": {"readonly": True}, + } + + _attribute_map = { + "connection_state": {"key": "connectionState", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "evaluation_state": {"key": "evaluationState", "type": "str"}, + "avg_latency_in_ms": {"key": "avgLatencyInMs", "type": "int"}, + "min_latency_in_ms": {"key": "minLatencyInMs", "type": "int"}, + "max_latency_in_ms": {"key": "maxLatencyInMs", "type": "int"}, + "probes_sent": {"key": "probesSent", "type": "int"}, + "probes_failed": {"key": "probesFailed", "type": "int"}, + "hops": {"key": "hops", "type": "[ConnectivityHop]"}, + } + + def __init__( + self, + *, + connection_state: Optional[Union[str, "_models.ConnectionState"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + evaluation_state: Optional[Union[str, "_models.EvaluationState"]] = None, + avg_latency_in_ms: Optional[int] = None, + min_latency_in_ms: Optional[int] = None, + max_latency_in_ms: Optional[int] = None, + probes_sent: Optional[int] = None, + probes_failed: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword connection_state: The connection state. Known values are: "Reachable", "Unreachable", + and "Unknown". + :paramtype connection_state: str or ~azure.mgmt.network.v2023_09_01.models.ConnectionState + :keyword start_time: The start time of the connection snapshot. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the connection snapshot. + :paramtype end_time: ~datetime.datetime + :keyword evaluation_state: Connectivity analysis evaluation state. Known values are: + "NotStarted", "InProgress", and "Completed". + :paramtype evaluation_state: str or ~azure.mgmt.network.v2023_09_01.models.EvaluationState + :keyword avg_latency_in_ms: Average latency in ms. + :paramtype avg_latency_in_ms: int + :keyword min_latency_in_ms: Minimum latency in ms. + :paramtype min_latency_in_ms: int + :keyword max_latency_in_ms: Maximum latency in ms. + :paramtype max_latency_in_ms: int + :keyword probes_sent: The number of sent probes. + :paramtype probes_sent: int + :keyword probes_failed: The number of failed probes. + :paramtype probes_failed: int + """ + super().__init__(**kwargs) + self.connection_state = connection_state + self.start_time = start_time + self.end_time = end_time + self.evaluation_state = evaluation_state + self.avg_latency_in_ms = avg_latency_in_ms + self.min_latency_in_ms = min_latency_in_ms + self.max_latency_in_ms = max_latency_in_ms + self.probes_sent = probes_sent + self.probes_failed = probes_failed + self.hops = None + + +class ConnectivityConfiguration(ChildResource): # pylint: disable=too-many-instance-attributes + """The network manager connectivity configuration resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description of the connectivity configuration. + :vartype description: str + :ivar connectivity_topology: Connectivity topology type. Known values are: "HubAndSpoke" and + "Mesh". + :vartype connectivity_topology: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectivityTopology + :ivar hubs: List of hubItems. + :vartype hubs: list[~azure.mgmt.network.v2023_09_01.models.Hub] + :ivar is_global: Flag if global mesh is supported. Known values are: "False" and "True". + :vartype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :ivar applies_to_groups: Groups for configuration. + :vartype applies_to_groups: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityGroupItem] + :ivar provisioning_state: The provisioning state of the connectivity configuration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar delete_existing_peering: Flag if need to remove current existing peerings. Known values + are: "False" and "True". + :vartype delete_existing_peering: str or + ~azure.mgmt.network.v2023_09_01.models.DeleteExistingPeering + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "connectivity_topology": {"key": "properties.connectivityTopology", "type": "str"}, + "hubs": {"key": "properties.hubs", "type": "[Hub]"}, + "is_global": {"key": "properties.isGlobal", "type": "str"}, + "applies_to_groups": {"key": "properties.appliesToGroups", "type": "[ConnectivityGroupItem]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "delete_existing_peering": {"key": "properties.deleteExistingPeering", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + connectivity_topology: Optional[Union[str, "_models.ConnectivityTopology"]] = None, + hubs: Optional[List["_models.Hub"]] = None, + is_global: Optional[Union[str, "_models.IsGlobal"]] = None, + applies_to_groups: Optional[List["_models.ConnectivityGroupItem"]] = None, + delete_existing_peering: Optional[Union[str, "_models.DeleteExistingPeering"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword description: A description of the connectivity configuration. + :paramtype description: str + :keyword connectivity_topology: Connectivity topology type. Known values are: "HubAndSpoke" and + "Mesh". + :paramtype connectivity_topology: str or + ~azure.mgmt.network.v2023_09_01.models.ConnectivityTopology + :keyword hubs: List of hubItems. + :paramtype hubs: list[~azure.mgmt.network.v2023_09_01.models.Hub] + :keyword is_global: Flag if global mesh is supported. Known values are: "False" and "True". + :paramtype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :keyword applies_to_groups: Groups for configuration. + :paramtype applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.ConnectivityGroupItem] + :keyword delete_existing_peering: Flag if need to remove current existing peerings. Known + values are: "False" and "True". + :paramtype delete_existing_peering: str or + ~azure.mgmt.network.v2023_09_01.models.DeleteExistingPeering + """ + super().__init__(**kwargs) + self.system_data = None + self.description = description + self.connectivity_topology = connectivity_topology + self.hubs = hubs + self.is_global = is_global + self.applies_to_groups = applies_to_groups + self.provisioning_state = None + self.delete_existing_peering = delete_existing_peering + self.resource_guid = None + + +class ConnectivityConfigurationListResult(_serialization.Model): + """Result of the request to list network manager connectivity configurations. It contains a list + of configurations and a link to get the next set of results. + + :ivar value: Gets a page of Connectivity Configurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration] + :ivar next_link: Gets the URL to get the next page of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ConnectivityConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ConnectivityConfiguration"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of Connectivity Configurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration] + :keyword next_link: Gets the URL to get the next page of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConnectivityDestination(_serialization.Model): + """Parameters that define destination of connection. + + :ivar resource_id: The ID of the resource to which a connection attempt will be made. + :vartype resource_id: str + :ivar address: The IP address or URI the resource to which a connection attempt will be made. + :vartype address: str + :ivar port: Port on which check connectivity will be performed. + :vartype port: int + """ + + _validation = { + "port": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + address: Optional[str] = None, + port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The ID of the resource to which a connection attempt will be made. + :paramtype resource_id: str + :keyword address: The IP address or URI the resource to which a connection attempt will be + made. + :paramtype address: str + :keyword port: Port on which check connectivity will be performed. + :paramtype port: int + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port + + +class ConnectivityGroupItem(_serialization.Model): + """Connectivity group item. + + All required parameters must be populated in order to send to server. + + :ivar network_group_id: Network group Id. Required. + :vartype network_group_id: str + :ivar use_hub_gateway: Flag if need to use hub gateway. Known values are: "False" and "True". + :vartype use_hub_gateway: str or ~azure.mgmt.network.v2023_09_01.models.UseHubGateway + :ivar is_global: Flag if global is supported. Known values are: "False" and "True". + :vartype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :ivar group_connectivity: Group connectivity type. Required. Known values are: "None" and + "DirectlyConnected". + :vartype group_connectivity: str or ~azure.mgmt.network.v2023_09_01.models.GroupConnectivity + """ + + _validation = { + "network_group_id": {"required": True}, + "group_connectivity": {"required": True}, + } + + _attribute_map = { + "network_group_id": {"key": "networkGroupId", "type": "str"}, + "use_hub_gateway": {"key": "useHubGateway", "type": "str"}, + "is_global": {"key": "isGlobal", "type": "str"}, + "group_connectivity": {"key": "groupConnectivity", "type": "str"}, + } + + def __init__( + self, + *, + network_group_id: str, + group_connectivity: Union[str, "_models.GroupConnectivity"], + use_hub_gateway: Optional[Union[str, "_models.UseHubGateway"]] = None, + is_global: Optional[Union[str, "_models.IsGlobal"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_group_id: Network group Id. Required. + :paramtype network_group_id: str + :keyword use_hub_gateway: Flag if need to use hub gateway. Known values are: "False" and + "True". + :paramtype use_hub_gateway: str or ~azure.mgmt.network.v2023_09_01.models.UseHubGateway + :keyword is_global: Flag if global is supported. Known values are: "False" and "True". + :paramtype is_global: str or ~azure.mgmt.network.v2023_09_01.models.IsGlobal + :keyword group_connectivity: Group connectivity type. Required. Known values are: "None" and + "DirectlyConnected". + :paramtype group_connectivity: str or ~azure.mgmt.network.v2023_09_01.models.GroupConnectivity + """ + super().__init__(**kwargs) + self.network_group_id = network_group_id + self.use_hub_gateway = use_hub_gateway + self.is_global = is_global + self.group_connectivity = group_connectivity + + +class ConnectivityHop(_serialization.Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar previous_hop_ids: List of previous hop identifiers. + :vartype previous_hop_ids: list[str] + :ivar links: List of hop links. + :vartype links: list[~azure.mgmt.network.v2023_09_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2023_09_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityIssue] + """ + + _validation = { + "type": {"readonly": True}, + "id": {"readonly": True}, + "address": {"readonly": True}, + "resource_id": {"readonly": True}, + "next_hop_ids": {"readonly": True}, + "previous_hop_ids": {"readonly": True}, + "links": {"readonly": True}, + "previous_links": {"readonly": True}, + "issues": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "next_hop_ids": {"key": "nextHopIds", "type": "[str]"}, + "previous_hop_ids": {"key": "previousHopIds", "type": "[str]"}, + "links": {"key": "links", "type": "[HopLink]"}, + "previous_links": {"key": "previousLinks", "type": "[HopLink]"}, + "issues": {"key": "issues", "type": "[ConnectivityIssue]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.previous_hop_ids = None + self.links = None + self.previous_links = None + self.issues = None + + +class ConnectivityInformation(_serialization.Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Known values are: "Unknown", "Connected", + "Disconnected", and "Degraded". + :vartype connection_status: str or ~azure.mgmt.network.v2023_09_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + "hops": {"readonly": True}, + "connection_status": {"readonly": True}, + "avg_latency_in_ms": {"readonly": True}, + "min_latency_in_ms": {"readonly": True}, + "max_latency_in_ms": {"readonly": True}, + "probes_sent": {"readonly": True}, + "probes_failed": {"readonly": True}, + } + + _attribute_map = { + "hops": {"key": "hops", "type": "[ConnectivityHop]"}, + "connection_status": {"key": "connectionStatus", "type": "str"}, + "avg_latency_in_ms": {"key": "avgLatencyInMs", "type": "int"}, + "min_latency_in_ms": {"key": "minLatencyInMs", "type": "int"}, + "max_latency_in_ms": {"key": "maxLatencyInMs", "type": "int"}, + "probes_sent": {"key": "probesSent", "type": "int"}, + "probes_failed": {"key": "probesFailed", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None + + +class ConnectivityIssue(_serialization.Model): + """Information about an issue encountered in the process of checking for connectivity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the issue. Known values are: "Local", "Inbound", and "Outbound". + :vartype origin: str or ~azure.mgmt.network.v2023_09_01.models.Origin + :ivar severity: The severity of the issue. Known values are: "Error" and "Warning". + :vartype severity: str or ~azure.mgmt.network.v2023_09_01.models.Severity + :ivar type: The type of issue. Known values are: "Unknown", "AgentStopped", "GuestFirewall", + "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", "PortThrottled", and + "Platform". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + "origin": {"readonly": True}, + "severity": {"readonly": True}, + "type": {"readonly": True}, + "context": {"readonly": True}, + } + + _attribute_map = { + "origin": {"key": "origin", "type": "str"}, + "severity": {"key": "severity", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "context": {"key": "context", "type": "[{str}]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None + + +class ConnectivityParameters(_serialization.Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to server. + + :ivar source: The source of the connection. Required. + :vartype source: ~azure.mgmt.network.v2023_09_01.models.ConnectivitySource + :ivar destination: The destination of connection. Required. + :vartype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectivityDestination + :ivar protocol: Network protocol. Known values are: "Tcp", "Http", "Https", and "Icmp". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.Protocol + :ivar protocol_configuration: Configuration of the protocol. + :vartype protocol_configuration: ~azure.mgmt.network.v2023_09_01.models.ProtocolConfiguration + :ivar preferred_ip_version: Preferred IP version of the connection. Known values are: "IPv4" + and "IPv6". + :vartype preferred_ip_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + """ + + _validation = { + "source": {"required": True}, + "destination": {"required": True}, + } + + _attribute_map = { + "source": {"key": "source", "type": "ConnectivitySource"}, + "destination": {"key": "destination", "type": "ConnectivityDestination"}, + "protocol": {"key": "protocol", "type": "str"}, + "protocol_configuration": {"key": "protocolConfiguration", "type": "ProtocolConfiguration"}, + "preferred_ip_version": {"key": "preferredIPVersion", "type": "str"}, + } + + def __init__( + self, + *, + source: "_models.ConnectivitySource", + destination: "_models.ConnectivityDestination", + protocol: Optional[Union[str, "_models.Protocol"]] = None, + protocol_configuration: Optional["_models.ProtocolConfiguration"] = None, + preferred_ip_version: Optional[Union[str, "_models.IPVersion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword source: The source of the connection. Required. + :paramtype source: ~azure.mgmt.network.v2023_09_01.models.ConnectivitySource + :keyword destination: The destination of connection. Required. + :paramtype destination: ~azure.mgmt.network.v2023_09_01.models.ConnectivityDestination + :keyword protocol: Network protocol. Known values are: "Tcp", "Http", "Https", and "Icmp". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.Protocol + :keyword protocol_configuration: Configuration of the protocol. + :paramtype protocol_configuration: ~azure.mgmt.network.v2023_09_01.models.ProtocolConfiguration + :keyword preferred_ip_version: Preferred IP version of the connection. Known values are: "IPv4" + and "IPv6". + :paramtype preferred_ip_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + """ + super().__init__(**kwargs) + self.source = source + self.destination = destination + self.protocol = protocol + self.protocol_configuration = protocol_configuration + self.preferred_ip_version = preferred_ip_version + + +class ConnectivitySource(_serialization.Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: The ID of the resource from which a connectivity check will be initiated. + Required. + :vartype resource_id: str + :ivar port: The source port from which a connectivity check will be performed. + :vartype port: int + """ + + _validation = { + "resource_id": {"required": True}, + "port": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, resource_id: str, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword resource_id: The ID of the resource from which a connectivity check will be initiated. + Required. + :paramtype resource_id: str + :keyword port: The source port from which a connectivity check will be performed. + :paramtype port: int + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.port = port + + +class Container(SubResource): + """Reference to container resource in remote resource provider. + + :ivar id: Resource ID. + :vartype id: str + """ + + +class ContainerNetworkInterface(SubResource): + """Container network interface child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource. This name can be used to access the resource. + :vartype name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar container_network_interface_configuration: Container network interface configuration from + which this container network interface is created. + :vartype container_network_interface_configuration: + ~azure.mgmt.network.v2023_09_01.models.ContainerNetworkInterfaceConfiguration + :ivar container: Reference to the container to which this container network interface is + attached. + :vartype container: ~azure.mgmt.network.v2023_09_01.models.Container + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ContainerNetworkInterfaceIpConfiguration] + :ivar provisioning_state: The provisioning state of the container network interface resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + "container_network_interface_configuration": {"readonly": True}, + "ip_configurations": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "container_network_interface_configuration": { + "key": "properties.containerNetworkInterfaceConfiguration", + "type": "ContainerNetworkInterfaceConfiguration", + }, + "container": {"key": "properties.container", "type": "Container"}, + "ip_configurations": { + "key": "properties.ipConfigurations", + "type": "[ContainerNetworkInterfaceIpConfiguration]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + container: Optional["_models.Container"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource. This name can be used to access the resource. + :paramtype name: str + :keyword container: Reference to the container to which this container network interface is + attached. + :paramtype container: ~azure.mgmt.network.v2023_09_01.models.Container + """ + super().__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.container_network_interface_configuration = None + self.container = container + self.ip_configurations = None + self.provisioning_state = None + + +class ContainerNetworkInterfaceConfiguration(SubResource): + """Container network interface configuration child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource. This name can be used to access the resource. + :vartype name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar ip_configurations: A list of ip configurations of the container network interface + configuration. + :vartype ip_configurations: list[~azure.mgmt.network.v2023_09_01.models.IPConfigurationProfile] + :ivar container_network_interfaces: A list of container network interfaces created from this + container network interface configuration. + :vartype container_network_interfaces: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the container network interface + configuration resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[IPConfigurationProfile]"}, + "container_network_interfaces": {"key": "properties.containerNetworkInterfaces", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + ip_configurations: Optional[List["_models.IPConfigurationProfile"]] = None, + container_network_interfaces: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource. This name can be used to access the resource. + :paramtype name: str + :keyword ip_configurations: A list of ip configurations of the container network interface + configuration. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.IPConfigurationProfile] + :keyword container_network_interfaces: A list of container network interfaces created from this + container network interface configuration. + :paramtype container_network_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.ip_configurations = ip_configurations + self.container_network_interfaces = container_network_interfaces + self.provisioning_state = None + + +class ContainerNetworkInterfaceIpConfiguration(_serialization.Model): + """The ip configuration for a container network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the resource. This name can be used to access the resource. + :vartype name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the container network interface IP + configuration resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The name of the resource. This name can be used to access the resource. + :paramtype name: str + """ + super().__init__(**kwargs) + self.name = name + self.type = None + self.etag = None + self.provisioning_state = None + + +class Criterion(_serialization.Model): + """A matching criteria which matches routes based on route prefix, community, and AS path. + + :ivar route_prefix: List of route prefixes which this criteria matches. + :vartype route_prefix: list[str] + :ivar community: List of BGP communities which this criteria matches. + :vartype community: list[str] + :ivar as_path: List of AS paths which this criteria matches. + :vartype as_path: list[str] + :ivar match_condition: Match condition to apply RouteMap rules. Known values are: "Unknown", + "Contains", "Equals", "NotContains", and "NotEquals". + :vartype match_condition: str or ~azure.mgmt.network.v2023_09_01.models.RouteMapMatchCondition + """ + + _attribute_map = { + "route_prefix": {"key": "routePrefix", "type": "[str]"}, + "community": {"key": "community", "type": "[str]"}, + "as_path": {"key": "asPath", "type": "[str]"}, + "match_condition": {"key": "matchCondition", "type": "str"}, + } + + def __init__( + self, + *, + route_prefix: Optional[List[str]] = None, + community: Optional[List[str]] = None, + as_path: Optional[List[str]] = None, + match_condition: Optional[Union[str, "_models.RouteMapMatchCondition"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword route_prefix: List of route prefixes which this criteria matches. + :paramtype route_prefix: list[str] + :keyword community: List of BGP communities which this criteria matches. + :paramtype community: list[str] + :keyword as_path: List of AS paths which this criteria matches. + :paramtype as_path: list[str] + :keyword match_condition: Match condition to apply RouteMap rules. Known values are: "Unknown", + "Contains", "Equals", "NotContains", and "NotEquals". + :paramtype match_condition: str or + ~azure.mgmt.network.v2023_09_01.models.RouteMapMatchCondition + """ + super().__init__(**kwargs) + self.route_prefix = route_prefix + self.community = community + self.as_path = as_path + self.match_condition = match_condition + + +class CrossTenantScopes(_serialization.Model): + """Cross tenant scopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tenant_id: Tenant ID. + :vartype tenant_id: str + :ivar management_groups: List of management groups. + :vartype management_groups: list[str] + :ivar subscriptions: List of subscriptions. + :vartype subscriptions: list[str] + """ + + _validation = { + "tenant_id": {"readonly": True}, + "management_groups": {"readonly": True}, + "subscriptions": {"readonly": True}, + } + + _attribute_map = { + "tenant_id": {"key": "tenantId", "type": "str"}, + "management_groups": {"key": "managementGroups", "type": "[str]"}, + "subscriptions": {"key": "subscriptions", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.tenant_id = None + self.management_groups = None + self.subscriptions = None + + +class CustomDnsConfigPropertiesFormat(_serialization.Model): + """Contains custom Dns resolution configuration from customer. + + :ivar fqdn: Fqdn that resolves to private endpoint ip address. + :vartype fqdn: str + :ivar ip_addresses: A list of private ip addresses of the private endpoint. + :vartype ip_addresses: list[str] + """ + + _attribute_map = { + "fqdn": {"key": "fqdn", "type": "str"}, + "ip_addresses": {"key": "ipAddresses", "type": "[str]"}, + } + + def __init__(self, *, fqdn: Optional[str] = None, ip_addresses: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword fqdn: Fqdn that resolves to private endpoint ip address. + :paramtype fqdn: str + :keyword ip_addresses: A list of private ip addresses of the private endpoint. + :paramtype ip_addresses: list[str] + """ + super().__init__(**kwargs) + self.fqdn = fqdn + self.ip_addresses = ip_addresses + + +class CustomIpPrefix(Resource): # pylint: disable=too-many-instance-attributes + """Custom IP prefix resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the custom IP prefix. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :vartype zones: list[str] + :ivar asn: The ASN for CIDR advertising. Should be an integer as string. + :vartype asn: str + :ivar cidr: The prefix range in CIDR notation. Should include the start address and the prefix + length. + :vartype cidr: str + :ivar signed_message: Signed message for WAN validation. + :vartype signed_message: str + :ivar authorization_message: Authorization message for WAN validation. + :vartype authorization_message: str + :ivar custom_ip_prefix_parent: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + :vartype custom_ip_prefix_parent: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar child_custom_ip_prefixes: The list of all Children for IPv6 /48 CustomIpPrefix. + :vartype child_custom_ip_prefixes: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar commissioned_state: The commissioned state of the Custom IP Prefix. Known values are: + "Provisioning", "Provisioned", "Commissioning", "CommissionedNoInternetAdvertise", + "Commissioned", "Decommissioning", "Deprovisioning", and "Deprovisioned". + :vartype commissioned_state: str or ~azure.mgmt.network.v2023_09_01.models.CommissionedState + :ivar express_route_advertise: Whether to do express route advertise. + :vartype express_route_advertise: bool + :ivar geo: The Geo for CIDR advertising. Should be an Geo code. Known values are: "GLOBAL", + "AFRI", "APAC", "EURO", "LATAM", "NAM", "ME", "OCEANIA", and "AQ". + :vartype geo: str or ~azure.mgmt.network.v2023_09_01.models.Geo + :ivar no_internet_advertise: Whether to Advertise the range to Internet. + :vartype no_internet_advertise: bool + :ivar prefix_type: Type of custom IP prefix. Should be Singular, Parent, or Child. Known values + are: "Singular", "Parent", and "Child". + :vartype prefix_type: str or ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefixType + :ivar public_ip_prefixes: The list of all referenced PublicIpPrefixes. + :vartype public_ip_prefixes: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar resource_guid: The resource GUID property of the custom IP prefix resource. + :vartype resource_guid: str + :ivar failed_reason: The reason why resource is in failed state. + :vartype failed_reason: str + :ivar provisioning_state: The provisioning state of the custom IP prefix resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "child_custom_ip_prefixes": {"readonly": True}, + "public_ip_prefixes": {"readonly": True}, + "resource_guid": {"readonly": True}, + "failed_reason": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "etag": {"key": "etag", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "asn": {"key": "properties.asn", "type": "str"}, + "cidr": {"key": "properties.cidr", "type": "str"}, + "signed_message": {"key": "properties.signedMessage", "type": "str"}, + "authorization_message": {"key": "properties.authorizationMessage", "type": "str"}, + "custom_ip_prefix_parent": {"key": "properties.customIpPrefixParent", "type": "SubResource"}, + "child_custom_ip_prefixes": {"key": "properties.childCustomIpPrefixes", "type": "[SubResource]"}, + "commissioned_state": {"key": "properties.commissionedState", "type": "str"}, + "express_route_advertise": {"key": "properties.expressRouteAdvertise", "type": "bool"}, + "geo": {"key": "properties.geo", "type": "str"}, + "no_internet_advertise": {"key": "properties.noInternetAdvertise", "type": "bool"}, + "prefix_type": {"key": "properties.prefixType", "type": "str"}, + "public_ip_prefixes": {"key": "properties.publicIpPrefixes", "type": "[SubResource]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "failed_reason": {"key": "properties.failedReason", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + zones: Optional[List[str]] = None, + asn: Optional[str] = None, + cidr: Optional[str] = None, + signed_message: Optional[str] = None, + authorization_message: Optional[str] = None, + custom_ip_prefix_parent: Optional["_models.SubResource"] = None, + commissioned_state: Optional[Union[str, "_models.CommissionedState"]] = None, + express_route_advertise: Optional[bool] = None, + geo: Optional[Union[str, "_models.Geo"]] = None, + no_internet_advertise: Optional[bool] = None, + prefix_type: Optional[Union[str, "_models.CustomIpPrefixType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the custom IP prefix. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword zones: A list of availability zones denoting the IP allocated for the resource needs + to come from. + :paramtype zones: list[str] + :keyword asn: The ASN for CIDR advertising. Should be an integer as string. + :paramtype asn: str + :keyword cidr: The prefix range in CIDR notation. Should include the start address and the + prefix length. + :paramtype cidr: str + :keyword signed_message: Signed message for WAN validation. + :paramtype signed_message: str + :keyword authorization_message: Authorization message for WAN validation. + :paramtype authorization_message: str + :keyword custom_ip_prefix_parent: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + :paramtype custom_ip_prefix_parent: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword commissioned_state: The commissioned state of the Custom IP Prefix. Known values are: + "Provisioning", "Provisioned", "Commissioning", "CommissionedNoInternetAdvertise", + "Commissioned", "Decommissioning", "Deprovisioning", and "Deprovisioned". + :paramtype commissioned_state: str or ~azure.mgmt.network.v2023_09_01.models.CommissionedState + :keyword express_route_advertise: Whether to do express route advertise. + :paramtype express_route_advertise: bool + :keyword geo: The Geo for CIDR advertising. Should be an Geo code. Known values are: "GLOBAL", + "AFRI", "APAC", "EURO", "LATAM", "NAM", "ME", "OCEANIA", and "AQ". + :paramtype geo: str or ~azure.mgmt.network.v2023_09_01.models.Geo + :keyword no_internet_advertise: Whether to Advertise the range to Internet. + :paramtype no_internet_advertise: bool + :keyword prefix_type: Type of custom IP prefix. Should be Singular, Parent, or Child. Known + values are: "Singular", "Parent", and "Child". + :paramtype prefix_type: str or ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefixType + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.zones = zones + self.asn = asn + self.cidr = cidr + self.signed_message = signed_message + self.authorization_message = authorization_message + self.custom_ip_prefix_parent = custom_ip_prefix_parent + self.child_custom_ip_prefixes = None + self.commissioned_state = commissioned_state + self.express_route_advertise = express_route_advertise + self.geo = geo + self.no_internet_advertise = no_internet_advertise + self.prefix_type = prefix_type + self.public_ip_prefixes = None + self.resource_guid = None + self.failed_reason = None + self.provisioning_state = None + + +class CustomIpPrefixListResult(_serialization.Model): + """Response for ListCustomIpPrefixes API service call. + + :ivar value: A list of Custom IP prefixes that exists in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[CustomIpPrefix]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.CustomIpPrefix"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of Custom IP prefixes that exists in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DdosCustomPolicy(Resource): + """A DDoS custom policy in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the DDoS custom policy resource. It uniquely + identifies the resource, even if the user changes its name or migrate the resource across + subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DDoS custom policy resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + + +class DdosProtectionPlan(_serialization.Model): + """A DDoS protection plan in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the DDoS protection plan resource. It + uniquely identifies the resource, even if the user changes its name or migrate the resource + across subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DDoS protection plan resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar public_ip_addresses: The list of public IPs associated with the DDoS protection plan + resource. This list is read-only. + :vartype public_ip_addresses: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar virtual_networks: The list of virtual networks associated with the DDoS protection plan + resource. This list is read-only. + :vartype virtual_networks: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "public_ip_addresses": {"readonly": True}, + "virtual_networks": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "public_ip_addresses": {"key": "properties.publicIPAddresses", "type": "[SubResource]"}, + "virtual_networks": {"key": "properties.virtualNetworks", "type": "[SubResource]"}, + } + + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.etag = None + self.resource_guid = None + self.provisioning_state = None + self.public_ip_addresses = None + self.virtual_networks = None + + +class DdosProtectionPlanListResult(_serialization.Model): + """A list of DDoS protection plans. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of DDoS protection plans. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[DdosProtectionPlan]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.DdosProtectionPlan"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of DDoS protection plans. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class DdosSettings(_serialization.Model): + """Contains the DDoS protection settings of the public IP. + + :ivar protection_mode: The DDoS protection mode of the public IP. Known values are: + "VirtualNetworkInherited", "Enabled", and "Disabled". + :vartype protection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.DdosSettingsProtectionMode + :ivar ddos_protection_plan: The DDoS protection plan associated with the public IP. Can only be + set if ProtectionMode is Enabled. + :vartype ddos_protection_plan: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "protection_mode": {"key": "protectionMode", "type": "str"}, + "ddos_protection_plan": {"key": "ddosProtectionPlan", "type": "SubResource"}, + } + + def __init__( + self, + *, + protection_mode: Optional[Union[str, "_models.DdosSettingsProtectionMode"]] = None, + ddos_protection_plan: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword protection_mode: The DDoS protection mode of the public IP. Known values are: + "VirtualNetworkInherited", "Enabled", and "Disabled". + :paramtype protection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.DdosSettingsProtectionMode + :keyword ddos_protection_plan: The DDoS protection plan associated with the public IP. Can only + be set if ProtectionMode is Enabled. + :paramtype ddos_protection_plan: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.protection_mode = protection_mode + self.ddos_protection_plan = ddos_protection_plan + + +class DefaultAdminRule(BaseAdminRule): # pylint: disable=too-many-instance-attributes + """Network default admin rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.AdminRuleKind + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar flag: Default rule flag. + :vartype flag: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "Any", and "Ah". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :ivar sources: The CIDR or source IP ranges. + :vartype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar destinations: The destination address prefixes. CIDR or destination IP ranges. + :vartype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: Indicates the access allowed for this particular rule. Known values are: "Allow", + "Deny", and "AlwaysAllow". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :ivar priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :vartype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "kind": {"required": True}, + "system_data": {"readonly": True}, + "description": {"readonly": True}, + "protocol": {"readonly": True}, + "sources": {"readonly": True}, + "destinations": {"readonly": True}, + "source_port_ranges": {"readonly": True}, + "destination_port_ranges": {"readonly": True}, + "access": {"readonly": True}, + "priority": {"readonly": True}, + "direction": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "flag": {"key": "properties.flag", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "sources": {"key": "properties.sources", "type": "[AddressPrefixItem]"}, + "destinations": {"key": "properties.destinations", "type": "[AddressPrefixItem]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__(self, *, flag: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword flag: Default rule flag. + :paramtype flag: str + """ + super().__init__(**kwargs) + self.kind: str = "Default" + self.description = None + self.flag = flag + self.protocol = None + self.sources = None + self.destinations = None + self.source_port_ranges = None + self.destination_port_ranges = None + self.access = None + self.priority = None + self.direction = None + self.provisioning_state = None + self.resource_guid = None + + +class Delegation(SubResource): + """Details the service to which the subnet is delegated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a subnet. This name can be used to + access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar service_name: The name of the service to whom the subnet should be delegated (e.g. + Microsoft.Sql/servers). + :vartype service_name: str + :ivar actions: The actions permitted to the service upon delegation. + :vartype actions: list[str] + :ivar provisioning_state: The provisioning state of the service delegation resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "actions": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "service_name": {"key": "properties.serviceName", "type": "str"}, + "actions": {"key": "properties.actions", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + service_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a subnet. This name can be used + to access the resource. + :paramtype name: str + :keyword type: Resource type. + :paramtype type: str + :keyword service_name: The name of the service to whom the subnet should be delegated (e.g. + Microsoft.Sql/servers). + :paramtype service_name: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.service_name = service_name + self.actions = None + self.provisioning_state = None + + +class DelegationProperties(_serialization.Model): + """Properties of the delegation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_name: The service name to which the NVA is delegated. + :vartype service_name: str + :ivar provisioning_state: The current provisioning state. Known values are: "Succeeded", + "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "service_name": {"key": "serviceName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + def __init__(self, *, service_name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword service_name: The service name to which the NVA is delegated. + :paramtype service_name: str + """ + super().__init__(**kwargs) + self.service_name = service_name + self.provisioning_state = None + + +class DeviceProperties(_serialization.Model): + """List of properties of the device. + + :ivar device_vendor: Name of the device Vendor. + :vartype device_vendor: str + :ivar device_model: Model of the device. + :vartype device_model: str + :ivar link_speed_in_mbps: Link speed. + :vartype link_speed_in_mbps: int + """ + + _attribute_map = { + "device_vendor": {"key": "deviceVendor", "type": "str"}, + "device_model": {"key": "deviceModel", "type": "str"}, + "link_speed_in_mbps": {"key": "linkSpeedInMbps", "type": "int"}, + } + + def __init__( + self, + *, + device_vendor: Optional[str] = None, + device_model: Optional[str] = None, + link_speed_in_mbps: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword device_vendor: Name of the device Vendor. + :paramtype device_vendor: str + :keyword device_model: Model of the device. + :paramtype device_model: str + :keyword link_speed_in_mbps: Link speed. + :paramtype link_speed_in_mbps: int + """ + super().__init__(**kwargs) + self.device_vendor = device_vendor + self.device_model = device_model + self.link_speed_in_mbps = link_speed_in_mbps + + +class DhcpOptions(_serialization.Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. + Standard DHCP option for a subnet overrides VNET DHCP options. + + :ivar dns_servers: The list of DNS servers IP addresses. + :vartype dns_servers: list[str] + """ + + _attribute_map = { + "dns_servers": {"key": "dnsServers", "type": "[str]"}, + } + + def __init__(self, *, dns_servers: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword dns_servers: The list of DNS servers IP addresses. + :paramtype dns_servers: list[str] + """ + super().__init__(**kwargs) + self.dns_servers = dns_servers + + +class Dimension(_serialization.Model): + """Dimension of the metric. + + :ivar name: The name of the dimension. + :vartype name: str + :ivar display_name: The display name of the dimension. + :vartype display_name: str + :ivar internal_name: The internal name of the dimension. + :vartype internal_name: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "internal_name": {"key": "internalName", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the dimension. + :paramtype name: str + :keyword display_name: The display name of the dimension. + :paramtype display_name: str + :keyword internal_name: The internal name of the dimension. + :paramtype internal_name: str + """ + super().__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + + +class DnsNameAvailabilityResult(_serialization.Model): + """Response for the CheckDnsNameAvailability API service call. + + :ivar available: Domain availability (True/False). + :vartype available: bool + """ + + _attribute_map = { + "available": {"key": "available", "type": "bool"}, + } + + def __init__(self, *, available: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword available: Domain availability (True/False). + :paramtype available: bool + """ + super().__init__(**kwargs) + self.available = available + + +class DnsSettings(_serialization.Model): + """DNS Proxy Settings in Firewall Policy. + + :ivar servers: List of Custom DNS Servers. + :vartype servers: list[str] + :ivar enable_proxy: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + :vartype enable_proxy: bool + :ivar require_proxy_for_network_rules: FQDNs in Network Rules are supported when set to true. + :vartype require_proxy_for_network_rules: bool + """ + + _attribute_map = { + "servers": {"key": "servers", "type": "[str]"}, + "enable_proxy": {"key": "enableProxy", "type": "bool"}, + "require_proxy_for_network_rules": {"key": "requireProxyForNetworkRules", "type": "bool"}, + } + + def __init__( + self, + *, + servers: Optional[List[str]] = None, + enable_proxy: Optional[bool] = None, + require_proxy_for_network_rules: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword servers: List of Custom DNS Servers. + :paramtype servers: list[str] + :keyword enable_proxy: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + :paramtype enable_proxy: bool + :keyword require_proxy_for_network_rules: FQDNs in Network Rules are supported when set to + true. + :paramtype require_proxy_for_network_rules: bool + """ + super().__init__(**kwargs) + self.servers = servers + self.enable_proxy = enable_proxy + self.require_proxy_for_network_rules = require_proxy_for_network_rules + + +class DscpConfiguration(Resource): # pylint: disable=too-many-instance-attributes + """Differentiated Services Code Point configuration for any given network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar markings: List of markings to be used in the configuration. + :vartype markings: list[int] + :ivar source_ip_ranges: Source IP ranges. + :vartype source_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :ivar destination_ip_ranges: Destination IP ranges. + :vartype destination_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :ivar source_port_ranges: Sources port ranges. + :vartype source_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :ivar destination_port_ranges: Destination port ranges. + :vartype destination_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :ivar protocol: RNM supported protocol types. Known values are: "DoNotUse", "Icmp", "Tcp", + "Udp", "Gre", "Esp", "Ah", "Vxlan", and "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ProtocolType + :ivar qos_definition_collection: QoS object definitions. + :vartype qos_definition_collection: list[~azure.mgmt.network.v2023_09_01.models.QosDefinition] + :ivar qos_collection_id: Qos Collection ID generated by RNM. + :vartype qos_collection_id: str + :ivar associated_network_interfaces: Associated Network Interfaces to the DSCP Configuration. + :vartype associated_network_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :ivar resource_guid: The resource GUID property of the DSCP Configuration resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DSCP Configuration resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "qos_collection_id": {"readonly": True}, + "associated_network_interfaces": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "markings": {"key": "properties.markings", "type": "[int]"}, + "source_ip_ranges": {"key": "properties.sourceIpRanges", "type": "[QosIpRange]"}, + "destination_ip_ranges": {"key": "properties.destinationIpRanges", "type": "[QosIpRange]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[QosPortRange]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[QosPortRange]"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "qos_definition_collection": {"key": "properties.qosDefinitionCollection", "type": "[QosDefinition]"}, + "qos_collection_id": {"key": "properties.qosCollectionId", "type": "str"}, + "associated_network_interfaces": { + "key": "properties.associatedNetworkInterfaces", + "type": "[NetworkInterface]", + }, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + markings: Optional[List[int]] = None, + source_ip_ranges: Optional[List["_models.QosIpRange"]] = None, + destination_ip_ranges: Optional[List["_models.QosIpRange"]] = None, + source_port_ranges: Optional[List["_models.QosPortRange"]] = None, + destination_port_ranges: Optional[List["_models.QosPortRange"]] = None, + protocol: Optional[Union[str, "_models.ProtocolType"]] = None, + qos_definition_collection: Optional[List["_models.QosDefinition"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword markings: List of markings to be used in the configuration. + :paramtype markings: list[int] + :keyword source_ip_ranges: Source IP ranges. + :paramtype source_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :keyword destination_ip_ranges: Destination IP ranges. + :paramtype destination_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :keyword source_port_ranges: Sources port ranges. + :paramtype source_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :keyword destination_port_ranges: Destination port ranges. + :paramtype destination_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :keyword protocol: RNM supported protocol types. Known values are: "DoNotUse", "Icmp", "Tcp", + "Udp", "Gre", "Esp", "Ah", "Vxlan", and "All". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ProtocolType + :keyword qos_definition_collection: QoS object definitions. + :paramtype qos_definition_collection: + list[~azure.mgmt.network.v2023_09_01.models.QosDefinition] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.markings = markings + self.source_ip_ranges = source_ip_ranges + self.destination_ip_ranges = destination_ip_ranges + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.protocol = protocol + self.qos_definition_collection = qos_definition_collection + self.qos_collection_id = None + self.associated_network_interfaces = None + self.resource_guid = None + self.provisioning_state = None + + +class DscpConfigurationListResult(_serialization.Model): + """Response for the DscpConfigurationList API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of dscp configurations in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[DscpConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.DscpConfiguration"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of dscp configurations in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class EffectiveBaseSecurityAdminRule(_serialization.Model): + """Network base admin rule. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EffectiveSecurityAdminRule, EffectiveDefaultSecurityAdminRule + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar configuration_description: A description of the security admin configuration. + :vartype configuration_description: str + :ivar rule_collection_description: A description of the rule collection. + :vartype rule_collection_description: str + :ivar rule_collection_applies_to_groups: Groups for rule collection. + :vartype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar rule_groups: Effective configuration groups. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveAdminRuleKind + """ + + _validation = { + "kind": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "configuration_description": {"key": "configurationDescription", "type": "str"}, + "rule_collection_description": {"key": "ruleCollectionDescription", "type": "str"}, + "rule_collection_applies_to_groups": { + "key": "ruleCollectionAppliesToGroups", + "type": "[NetworkManagerSecurityGroupItem]", + }, + "rule_groups": {"key": "ruleGroups", "type": "[ConfigurationGroup]"}, + "kind": {"key": "kind", "type": "str"}, + } + + _subtype_map = {"kind": {"Custom": "EffectiveSecurityAdminRule", "Default": "EffectiveDefaultSecurityAdminRule"}} + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + configuration_description: Optional[str] = None, + rule_collection_description: Optional[str] = None, + rule_collection_applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + rule_groups: Optional[List["_models.ConfigurationGroup"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword configuration_description: A description of the security admin configuration. + :paramtype configuration_description: str + :keyword rule_collection_description: A description of the rule collection. + :paramtype rule_collection_description: str + :keyword rule_collection_applies_to_groups: Groups for rule collection. + :paramtype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :keyword rule_groups: Effective configuration groups. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + """ + super().__init__(**kwargs) + self.id = id + self.configuration_description = configuration_description + self.rule_collection_description = rule_collection_description + self.rule_collection_applies_to_groups = rule_collection_applies_to_groups + self.rule_groups = rule_groups + self.kind: Optional[str] = None + + +class EffectiveDefaultSecurityAdminRule(EffectiveBaseSecurityAdminRule): # pylint: disable=too-many-instance-attributes + """Network default admin rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar configuration_description: A description of the security admin configuration. + :vartype configuration_description: str + :ivar rule_collection_description: A description of the rule collection. + :vartype rule_collection_description: str + :ivar rule_collection_applies_to_groups: Groups for rule collection. + :vartype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar rule_groups: Effective configuration groups. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveAdminRuleKind + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar flag: Default rule flag. + :vartype flag: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "Any", and "Ah". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :ivar sources: The CIDR or source IP ranges. + :vartype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar destinations: The destination address prefixes. CIDR or destination IP ranges. + :vartype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: Indicates the access allowed for this particular rule. Known values are: "Allow", + "Deny", and "AlwaysAllow". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :ivar priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :vartype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "kind": {"required": True}, + "description": {"readonly": True}, + "protocol": {"readonly": True}, + "sources": {"readonly": True}, + "destinations": {"readonly": True}, + "source_port_ranges": {"readonly": True}, + "destination_port_ranges": {"readonly": True}, + "access": {"readonly": True}, + "priority": {"readonly": True}, + "direction": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "configuration_description": {"key": "configurationDescription", "type": "str"}, + "rule_collection_description": {"key": "ruleCollectionDescription", "type": "str"}, + "rule_collection_applies_to_groups": { + "key": "ruleCollectionAppliesToGroups", + "type": "[NetworkManagerSecurityGroupItem]", + }, + "rule_groups": {"key": "ruleGroups", "type": "[ConfigurationGroup]"}, + "kind": {"key": "kind", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "flag": {"key": "properties.flag", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "sources": {"key": "properties.sources", "type": "[AddressPrefixItem]"}, + "destinations": {"key": "properties.destinations", "type": "[AddressPrefixItem]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + configuration_description: Optional[str] = None, + rule_collection_description: Optional[str] = None, + rule_collection_applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + rule_groups: Optional[List["_models.ConfigurationGroup"]] = None, + flag: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword configuration_description: A description of the security admin configuration. + :paramtype configuration_description: str + :keyword rule_collection_description: A description of the rule collection. + :paramtype rule_collection_description: str + :keyword rule_collection_applies_to_groups: Groups for rule collection. + :paramtype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :keyword rule_groups: Effective configuration groups. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :keyword flag: Default rule flag. + :paramtype flag: str + """ + super().__init__( + id=id, + configuration_description=configuration_description, + rule_collection_description=rule_collection_description, + rule_collection_applies_to_groups=rule_collection_applies_to_groups, + rule_groups=rule_groups, + **kwargs + ) + self.kind: str = "Default" + self.description = None + self.flag = flag + self.protocol = None + self.sources = None + self.destinations = None + self.source_port_ranges = None + self.destination_port_ranges = None + self.access = None + self.priority = None + self.direction = None + self.provisioning_state = None + self.resource_guid = None + + +class EffectiveNetworkSecurityGroup(_serialization.Model): + """Effective network security group. + + :ivar network_security_group: The ID of network security group that is applied. + :vartype network_security_group: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar association: Associated resources. + :vartype association: + ~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityGroupAssociation + :ivar effective_security_rules: A collection of effective security rules. + :vartype effective_security_rules: + list[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityRule] + :ivar tag_map: Mapping of tags to list of IP Addresses included within the tag. + :vartype tag_map: str + """ + + _attribute_map = { + "network_security_group": {"key": "networkSecurityGroup", "type": "SubResource"}, + "association": {"key": "association", "type": "EffectiveNetworkSecurityGroupAssociation"}, + "effective_security_rules": {"key": "effectiveSecurityRules", "type": "[EffectiveNetworkSecurityRule]"}, + "tag_map": {"key": "tagMap", "type": "str"}, + } + + def __init__( + self, + *, + network_security_group: Optional["_models.SubResource"] = None, + association: Optional["_models.EffectiveNetworkSecurityGroupAssociation"] = None, + effective_security_rules: Optional[List["_models.EffectiveNetworkSecurityRule"]] = None, + tag_map: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_security_group: The ID of network security group that is applied. + :paramtype network_security_group: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword association: Associated resources. + :paramtype association: + ~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityGroupAssociation + :keyword effective_security_rules: A collection of effective security rules. + :paramtype effective_security_rules: + list[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityRule] + :keyword tag_map: Mapping of tags to list of IP Addresses included within the tag. + :paramtype tag_map: str + """ + super().__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map + + +class EffectiveNetworkSecurityGroupAssociation(_serialization.Model): + """The effective network security group association. + + :ivar network_manager: The ID of the Azure network manager if assigned. + :vartype network_manager: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar subnet: The ID of the subnet if assigned. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar network_interface: The ID of the network interface if assigned. + :vartype network_interface: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "network_manager": {"key": "networkManager", "type": "SubResource"}, + "subnet": {"key": "subnet", "type": "SubResource"}, + "network_interface": {"key": "networkInterface", "type": "SubResource"}, + } + + def __init__( + self, + *, + network_manager: Optional["_models.SubResource"] = None, + subnet: Optional["_models.SubResource"] = None, + network_interface: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_manager: The ID of the Azure network manager if assigned. + :paramtype network_manager: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword subnet: The ID of the subnet if assigned. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword network_interface: The ID of the network interface if assigned. + :paramtype network_interface: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.network_manager = network_manager + self.subnet = subnet + self.network_interface = network_interface + + +class EffectiveNetworkSecurityGroupListResult(_serialization.Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of effective network security groups. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[EffectiveNetworkSecurityGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.EffectiveNetworkSecurityGroup"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of effective network security groups. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityGroup] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class EffectiveNetworkSecurityRule(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Effective network security rules. + + :ivar name: The name of the security rule specified by the user (if created by the user). + :vartype name: str + :ivar protocol: The network protocol this rule applies to. Known values are: "Tcp", "Udp", and + "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveSecurityRuleProtocol + :ivar source_port_range: The source port or range. + :vartype source_port_range: str + :ivar destination_port_range: The destination port or range. + :vartype destination_port_range: str + :ivar source_port_ranges: The source port ranges. Expected values include a single integer + between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. Expected values include a single + integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :vartype destination_port_ranges: list[str] + :ivar source_address_prefix: The source address prefix. + :vartype source_address_prefix: str + :ivar destination_address_prefix: The destination address prefix. + :vartype destination_address_prefix: str + :ivar source_address_prefixes: The source address prefixes. Expected values include CIDR IP + ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the + asterisk (*). + :vartype source_address_prefixes: list[str] + :ivar destination_address_prefixes: The destination address prefixes. Expected values include + CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and + the asterisk (*). + :vartype destination_address_prefixes: list[str] + :ivar expanded_source_address_prefix: The expanded source address prefix. + :vartype expanded_source_address_prefix: list[str] + :ivar expanded_destination_address_prefix: Expanded destination address prefix. + :vartype expanded_destination_address_prefix: list[str] + :ivar access: Whether network traffic is allowed or denied. Known values are: "Allow" and + "Deny". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAccess + :ivar priority: The priority of the rule. + :vartype priority: int + :ivar direction: The direction of the rule. Known values are: "Inbound" and "Outbound". + :vartype direction: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleDirection + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "source_port_range": {"key": "sourcePortRange", "type": "str"}, + "destination_port_range": {"key": "destinationPortRange", "type": "str"}, + "source_port_ranges": {"key": "sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "destinationPortRanges", "type": "[str]"}, + "source_address_prefix": {"key": "sourceAddressPrefix", "type": "str"}, + "destination_address_prefix": {"key": "destinationAddressPrefix", "type": "str"}, + "source_address_prefixes": {"key": "sourceAddressPrefixes", "type": "[str]"}, + "destination_address_prefixes": {"key": "destinationAddressPrefixes", "type": "[str]"}, + "expanded_source_address_prefix": {"key": "expandedSourceAddressPrefix", "type": "[str]"}, + "expanded_destination_address_prefix": {"key": "expandedDestinationAddressPrefix", "type": "[str]"}, + "access": {"key": "access", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, + "direction": {"key": "direction", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + protocol: Optional[Union[str, "_models.EffectiveSecurityRuleProtocol"]] = None, + source_port_range: Optional[str] = None, + destination_port_range: Optional[str] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + source_address_prefix: Optional[str] = None, + destination_address_prefix: Optional[str] = None, + source_address_prefixes: Optional[List[str]] = None, + destination_address_prefixes: Optional[List[str]] = None, + expanded_source_address_prefix: Optional[List[str]] = None, + expanded_destination_address_prefix: Optional[List[str]] = None, + access: Optional[Union[str, "_models.SecurityRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "_models.SecurityRuleDirection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the security rule specified by the user (if created by the user). + :paramtype name: str + :keyword protocol: The network protocol this rule applies to. Known values are: "Tcp", "Udp", + and "All". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.EffectiveSecurityRuleProtocol + :keyword source_port_range: The source port or range. + :paramtype source_port_range: str + :keyword destination_port_range: The destination port or range. + :paramtype destination_port_range: str + :keyword source_port_ranges: The source port ranges. Expected values include a single integer + between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :paramtype source_port_ranges: list[str] + :keyword destination_port_ranges: The destination port ranges. Expected values include a single + integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :paramtype destination_port_ranges: list[str] + :keyword source_address_prefix: The source address prefix. + :paramtype source_address_prefix: str + :keyword destination_address_prefix: The destination address prefix. + :paramtype destination_address_prefix: str + :keyword source_address_prefixes: The source address prefixes. Expected values include CIDR IP + ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the + asterisk (*). + :paramtype source_address_prefixes: list[str] + :keyword destination_address_prefixes: The destination address prefixes. Expected values + include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System + Tags, and the asterisk (*). + :paramtype destination_address_prefixes: list[str] + :keyword expanded_source_address_prefix: The expanded source address prefix. + :paramtype expanded_source_address_prefix: list[str] + :keyword expanded_destination_address_prefix: Expanded destination address prefix. + :paramtype expanded_destination_address_prefix: list[str] + :keyword access: Whether network traffic is allowed or denied. Known values are: "Allow" and + "Deny". + :paramtype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAccess + :keyword priority: The priority of the rule. + :paramtype priority: int + :keyword direction: The direction of the rule. Known values are: "Inbound" and "Outbound". + :paramtype direction: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleDirection + """ + super().__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction + + +class EffectiveRoute(_serialization.Model): + """Effective Route. + + :ivar name: The name of the user defined route. This is optional. + :vartype name: str + :ivar disable_bgp_route_propagation: If true, on-premises routes are not propagated to the + network interfaces in the subnet. + :vartype disable_bgp_route_propagation: bool + :ivar source: Who created the route. Known values are: "Unknown", "User", + "VirtualNetworkGateway", and "Default". + :vartype source: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveRouteSource + :ivar state: The value of effective route. Known values are: "Active" and "Invalid". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveRouteState + :ivar address_prefix: The address prefixes of the effective routes in CIDR notation. + :vartype address_prefix: list[str] + :ivar next_hop_ip_address: The IP address of the next hop of the effective route. + :vartype next_hop_ip_address: list[str] + :ivar next_hop_type: The type of Azure hop the packet should be sent to. Known values are: + "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", and "None". + :vartype next_hop_type: str or ~azure.mgmt.network.v2023_09_01.models.RouteNextHopType + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "disable_bgp_route_propagation": {"key": "disableBgpRoutePropagation", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "address_prefix": {"key": "addressPrefix", "type": "[str]"}, + "next_hop_ip_address": {"key": "nextHopIpAddress", "type": "[str]"}, + "next_hop_type": {"key": "nextHopType", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + disable_bgp_route_propagation: Optional[bool] = None, + source: Optional[Union[str, "_models.EffectiveRouteSource"]] = None, + state: Optional[Union[str, "_models.EffectiveRouteState"]] = None, + address_prefix: Optional[List[str]] = None, + next_hop_ip_address: Optional[List[str]] = None, + next_hop_type: Optional[Union[str, "_models.RouteNextHopType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the user defined route. This is optional. + :paramtype name: str + :keyword disable_bgp_route_propagation: If true, on-premises routes are not propagated to the + network interfaces in the subnet. + :paramtype disable_bgp_route_propagation: bool + :keyword source: Who created the route. Known values are: "Unknown", "User", + "VirtualNetworkGateway", and "Default". + :paramtype source: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveRouteSource + :keyword state: The value of effective route. Known values are: "Active" and "Invalid". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveRouteState + :keyword address_prefix: The address prefixes of the effective routes in CIDR notation. + :paramtype address_prefix: list[str] + :keyword next_hop_ip_address: The IP address of the next hop of the effective route. + :paramtype next_hop_ip_address: list[str] + :keyword next_hop_type: The type of Azure hop the packet should be sent to. Known values are: + "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", and "None". + :paramtype next_hop_type: str or ~azure.mgmt.network.v2023_09_01.models.RouteNextHopType + """ + super().__init__(**kwargs) + self.name = name + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type + + +class EffectiveRouteListResult(_serialization.Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of effective routes. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[EffectiveRoute]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.EffectiveRoute"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of effective routes. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveRoute] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class EffectiveRouteMapRoute(_serialization.Model): + """The effective RouteMap route configured on the connection resource. + + :ivar prefix: The address prefix of the route. + :vartype prefix: str + :ivar bgp_communities: BGP communities of the route. + :vartype bgp_communities: str + :ivar as_path: The ASPath of this route. + :vartype as_path: str + """ + + _attribute_map = { + "prefix": {"key": "prefix", "type": "str"}, + "bgp_communities": {"key": "bgpCommunities", "type": "str"}, + "as_path": {"key": "asPath", "type": "str"}, + } + + def __init__( + self, + *, + prefix: Optional[str] = None, + bgp_communities: Optional[str] = None, + as_path: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword prefix: The address prefix of the route. + :paramtype prefix: str + :keyword bgp_communities: BGP communities of the route. + :paramtype bgp_communities: str + :keyword as_path: The ASPath of this route. + :paramtype as_path: str + """ + super().__init__(**kwargs) + self.prefix = prefix + self.bgp_communities = bgp_communities + self.as_path = as_path + + +class EffectiveRouteMapRouteList(_serialization.Model): + """EffectiveRouteMapRoute List. + + :ivar value: The list of Effective RouteMap Routes configured on the connection resource. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRoute] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[EffectiveRouteMapRoute]"}, + } + + def __init__(self, *, value: Optional[List["_models.EffectiveRouteMapRoute"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of Effective RouteMap Routes configured on the connection resource. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRoute] + """ + super().__init__(**kwargs) + self.value = value + + +class EffectiveRoutesParameters(_serialization.Model): + """The parameters specifying the resource whose effective routes are being requested. + + :ivar resource_id: The resource whose effective routes are being requested. + :vartype resource_id: str + :ivar virtual_wan_resource_type: The type of the specified resource like RouteTable, + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :vartype virtual_wan_resource_type: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "virtual_wan_resource_type": {"key": "virtualWanResourceType", "type": "str"}, + } + + def __init__( + self, *, resource_id: Optional[str] = None, virtual_wan_resource_type: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_id: The resource whose effective routes are being requested. + :paramtype resource_id: str + :keyword virtual_wan_resource_type: The type of the specified resource like RouteTable, + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :paramtype virtual_wan_resource_type: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.virtual_wan_resource_type = virtual_wan_resource_type + + +class EffectiveSecurityAdminRule(EffectiveBaseSecurityAdminRule): # pylint: disable=too-many-instance-attributes + """Network admin rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar configuration_description: A description of the security admin configuration. + :vartype configuration_description: str + :ivar rule_collection_description: A description of the rule collection. + :vartype rule_collection_description: str + :ivar rule_collection_applies_to_groups: Groups for rule collection. + :vartype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :ivar rule_groups: Effective configuration groups. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :ivar kind: Whether the rule is custom or default. Required. Known values are: "Custom" and + "Default". + :vartype kind: str or ~azure.mgmt.network.v2023_09_01.models.EffectiveAdminRuleKind + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "Any", and "Ah". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :ivar sources: The CIDR or source IP ranges. + :vartype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar destinations: The destination address prefixes. CIDR or destination IP ranges. + :vartype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: Indicates the access allowed for this particular rule. Known values are: "Allow", + "Deny", and "AlwaysAllow". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :ivar priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :vartype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "kind": {"required": True}, + "priority": {"maximum": 4096, "minimum": 1}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "configuration_description": {"key": "configurationDescription", "type": "str"}, + "rule_collection_description": {"key": "ruleCollectionDescription", "type": "str"}, + "rule_collection_applies_to_groups": { + "key": "ruleCollectionAppliesToGroups", + "type": "[NetworkManagerSecurityGroupItem]", + }, + "rule_groups": {"key": "ruleGroups", "type": "[ConfigurationGroup]"}, + "kind": {"key": "kind", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "sources": {"key": "properties.sources", "type": "[AddressPrefixItem]"}, + "destinations": {"key": "properties.destinations", "type": "[AddressPrefixItem]"}, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + configuration_description: Optional[str] = None, + rule_collection_description: Optional[str] = None, + rule_collection_applies_to_groups: Optional[List["_models.NetworkManagerSecurityGroupItem"]] = None, + rule_groups: Optional[List["_models.ConfigurationGroup"]] = None, + description: Optional[str] = None, + protocol: Optional[Union[str, "_models.SecurityConfigurationRuleProtocol"]] = None, + sources: Optional[List["_models.AddressPrefixItem"]] = None, + destinations: Optional[List["_models.AddressPrefixItem"]] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + access: Optional[Union[str, "_models.SecurityConfigurationRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "_models.SecurityConfigurationRuleDirection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword configuration_description: A description of the security admin configuration. + :paramtype configuration_description: str + :keyword rule_collection_description: A description of the rule collection. + :paramtype rule_collection_description: str + :keyword rule_collection_applies_to_groups: Groups for rule collection. + :paramtype rule_collection_applies_to_groups: + list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerSecurityGroupItem] + :keyword rule_groups: Effective configuration groups. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ConfigurationGroup] + :keyword description: A description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", + "Icmp", "Esp", "Any", and "Ah". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleProtocol + :keyword sources: The CIDR or source IP ranges. + :paramtype sources: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :keyword destinations: The destination address prefixes. CIDR or destination IP ranges. + :paramtype destinations: list[~azure.mgmt.network.v2023_09_01.models.AddressPrefixItem] + :keyword source_port_ranges: The source port ranges. + :paramtype source_port_ranges: list[str] + :keyword destination_port_ranges: The destination port ranges. + :paramtype destination_port_ranges: list[str] + :keyword access: Indicates the access allowed for this particular rule. Known values are: + "Allow", "Deny", and "AlwaysAllow". + :paramtype access: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleAccess + :keyword priority: The priority of the rule. The value can be between 1 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :paramtype priority: int + :keyword direction: Indicates if the traffic matched against the rule in inbound or outbound. + Known values are: "Inbound" and "Outbound". + :paramtype direction: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityConfigurationRuleDirection + """ + super().__init__( + id=id, + configuration_description=configuration_description, + rule_collection_description=rule_collection_description, + rule_collection_applies_to_groups=rule_collection_applies_to_groups, + rule_groups=rule_groups, + **kwargs + ) + self.kind: str = "Custom" + self.description = description + self.protocol = protocol + self.sources = sources + self.destinations = destinations + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = None + self.resource_guid = None + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource ID. + :paramtype id: str + """ + super().__init__(id=id, **kwargs) + self.name = None + self.type = None + + +class EndpointServicesListResult(_serialization.Model): + """Response for the ListAvailableEndpointServices API service call. + + :ivar value: List of available endpoint services in a region. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.EndpointServiceResult] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[EndpointServiceResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.EndpointServiceResult"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of available endpoint services in a region. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.EndpointServiceResult] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Error(_serialization.Model): + """Common error representation. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar details: Error details. + :vartype details: list[~azure.mgmt.network.v2023_09_01.models.ErrorDetails] + :ivar inner_error: Inner error message. + :vartype inner_error: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetails]"}, + "inner_error": {"key": "innerError", "type": "str"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.ErrorDetails"]] = None, + inner_error: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: Error code. + :paramtype code: str + :keyword message: Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword details: Error details. + :paramtype details: list[~azure.mgmt.network.v2023_09_01.models.ErrorDetails] + :keyword inner_error: Inner error message. + :paramtype inner_error: str + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error + + +class ErrorDetails(_serialization.Model): + """Common error details representation. + + :ivar code: Error code. + :vartype code: str + :ivar target: Error target. + :vartype target: str + :ivar message: Error message. + :vartype message: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__( + self, *, code: Optional[str] = None, target: Optional[str] = None, message: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword code: Error code. + :paramtype code: str + :keyword target: Error target. + :paramtype target: str + :keyword message: Error message. + :paramtype message: str + """ + super().__init__(**kwargs) + self.code = code + self.target = target + self.message = message + + +class ErrorResponse(_serialization.Model): + """The error object. + + :ivar error: The error details object. + :vartype error: ~azure.mgmt.network.v2023_09_01.models.ErrorDetails + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetails"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error details object. + :paramtype error: ~azure.mgmt.network.v2023_09_01.models.ErrorDetails + """ + super().__init__(**kwargs) + self.error = error + + +class EvaluatedNetworkSecurityGroup(_serialization.Model): + """Results of network security group evaluation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar network_security_group_id: Network security group ID. + :vartype network_security_group_id: str + :ivar applied_to: Resource ID of nic or subnet to which network security group is applied. + :vartype applied_to: str + :ivar matched_rule: Matched network security rule. + :vartype matched_rule: ~azure.mgmt.network.v2023_09_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityRulesEvaluationResult] + """ + + _validation = { + "rules_evaluation_result": {"readonly": True}, + } + + _attribute_map = { + "network_security_group_id": {"key": "networkSecurityGroupId", "type": "str"}, + "applied_to": {"key": "appliedTo", "type": "str"}, + "matched_rule": {"key": "matchedRule", "type": "MatchedRule"}, + "rules_evaluation_result": {"key": "rulesEvaluationResult", "type": "[NetworkSecurityRulesEvaluationResult]"}, + } + + def __init__( + self, + *, + network_security_group_id: Optional[str] = None, + applied_to: Optional[str] = None, + matched_rule: Optional["_models.MatchedRule"] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_security_group_id: Network security group ID. + :paramtype network_security_group_id: str + :keyword applied_to: Resource ID of nic or subnet to which network security group is applied. + :paramtype applied_to: str + :keyword matched_rule: Matched network security rule. + :paramtype matched_rule: ~azure.mgmt.network.v2023_09_01.models.MatchedRule + """ + super().__init__(**kwargs) + self.network_security_group_id = network_security_group_id + self.applied_to = applied_to + self.matched_rule = matched_rule + self.rules_evaluation_result = None + + +class ExclusionManagedRule(_serialization.Model): + """Defines a managed rule to use for exclusion. + + All required parameters must be populated in order to send to server. + + :ivar rule_id: Identifier for the managed rule. Required. + :vartype rule_id: str + """ + + _validation = { + "rule_id": {"required": True}, + } + + _attribute_map = { + "rule_id": {"key": "ruleId", "type": "str"}, + } + + def __init__(self, *, rule_id: str, **kwargs: Any) -> None: + """ + :keyword rule_id: Identifier for the managed rule. Required. + :paramtype rule_id: str + """ + super().__init__(**kwargs) + self.rule_id = rule_id + + +class ExclusionManagedRuleGroup(_serialization.Model): + """Defines a managed rule group to use for exclusion. + + All required parameters must be populated in order to send to server. + + :ivar rule_group_name: The managed rule group for exclusion. Required. + :vartype rule_group_name: str + :ivar rules: List of rules that will be excluded. If none specified, all rules in the group + will be excluded. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.ExclusionManagedRule] + """ + + _validation = { + "rule_group_name": {"required": True}, + } + + _attribute_map = { + "rule_group_name": {"key": "ruleGroupName", "type": "str"}, + "rules": {"key": "rules", "type": "[ExclusionManagedRule]"}, + } + + def __init__( + self, *, rule_group_name: str, rules: Optional[List["_models.ExclusionManagedRule"]] = None, **kwargs: Any + ) -> None: + """ + :keyword rule_group_name: The managed rule group for exclusion. Required. + :paramtype rule_group_name: str + :keyword rules: List of rules that will be excluded. If none specified, all rules in the group + will be excluded. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.ExclusionManagedRule] + """ + super().__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules + + +class ExclusionManagedRuleSet(_serialization.Model): + """Defines a managed rule set for Exclusions. + + All required parameters must be populated in order to send to server. + + :ivar rule_set_type: Defines the rule set type to use. Required. + :vartype rule_set_type: str + :ivar rule_set_version: Defines the version of the rule set to use. Required. + :vartype rule_set_version: str + :ivar rule_groups: Defines the rule groups to apply to the rule set. + :vartype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ExclusionManagedRuleGroup] + """ + + _validation = { + "rule_set_type": {"required": True}, + "rule_set_version": {"required": True}, + } + + _attribute_map = { + "rule_set_type": {"key": "ruleSetType", "type": "str"}, + "rule_set_version": {"key": "ruleSetVersion", "type": "str"}, + "rule_groups": {"key": "ruleGroups", "type": "[ExclusionManagedRuleGroup]"}, + } + + def __init__( + self, + *, + rule_set_type: str, + rule_set_version: str, + rule_groups: Optional[List["_models.ExclusionManagedRuleGroup"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword rule_set_type: Defines the rule set type to use. Required. + :paramtype rule_set_type: str + :keyword rule_set_version: Defines the version of the rule set to use. Required. + :paramtype rule_set_version: str + :keyword rule_groups: Defines the rule groups to apply to the rule set. + :paramtype rule_groups: list[~azure.mgmt.network.v2023_09_01.models.ExclusionManagedRuleGroup] + """ + super().__init__(**kwargs) + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups + + +class ExplicitProxy(_serialization.Model): + """Explicit Proxy Settings in Firewall Policy. + + :ivar enable_explicit_proxy: When set to true, explicit proxy mode is enabled. + :vartype enable_explicit_proxy: bool + :ivar http_port: Port number for explicit proxy http protocol, cannot be greater than 64000. + :vartype http_port: int + :ivar https_port: Port number for explicit proxy https protocol, cannot be greater than 64000. + :vartype https_port: int + :ivar enable_pac_file: When set to true, pac file port and url needs to be provided. + :vartype enable_pac_file: bool + :ivar pac_file_port: Port number for firewall to serve PAC file. + :vartype pac_file_port: int + :ivar pac_file: SAS URL for PAC file. + :vartype pac_file: str + """ + + _validation = { + "http_port": {"maximum": 64000, "minimum": 0}, + "https_port": {"maximum": 64000, "minimum": 0}, + "pac_file_port": {"maximum": 64000, "minimum": 0}, + } + + _attribute_map = { + "enable_explicit_proxy": {"key": "enableExplicitProxy", "type": "bool"}, + "http_port": {"key": "httpPort", "type": "int"}, + "https_port": {"key": "httpsPort", "type": "int"}, + "enable_pac_file": {"key": "enablePacFile", "type": "bool"}, + "pac_file_port": {"key": "pacFilePort", "type": "int"}, + "pac_file": {"key": "pacFile", "type": "str"}, + } + + def __init__( + self, + *, + enable_explicit_proxy: Optional[bool] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + enable_pac_file: Optional[bool] = None, + pac_file_port: Optional[int] = None, + pac_file: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enable_explicit_proxy: When set to true, explicit proxy mode is enabled. + :paramtype enable_explicit_proxy: bool + :keyword http_port: Port number for explicit proxy http protocol, cannot be greater than 64000. + :paramtype http_port: int + :keyword https_port: Port number for explicit proxy https protocol, cannot be greater than + 64000. + :paramtype https_port: int + :keyword enable_pac_file: When set to true, pac file port and url needs to be provided. + :paramtype enable_pac_file: bool + :keyword pac_file_port: Port number for firewall to serve PAC file. + :paramtype pac_file_port: int + :keyword pac_file: SAS URL for PAC file. + :paramtype pac_file: str + """ + super().__init__(**kwargs) + self.enable_explicit_proxy = enable_explicit_proxy + self.http_port = http_port + self.https_port = https_port + self.enable_pac_file = enable_pac_file + self.pac_file_port = pac_file_port + self.pac_file = pac_file + + +class ExpressRouteCircuit(Resource): # pylint: disable=too-many-instance-attributes + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar allow_classic_operations: Allow classic operations. + :vartype allow_classic_operations: bool + :ivar circuit_provisioning_state: The CircuitProvisioningState state of the resource. + :vartype circuit_provisioning_state: str + :ivar service_provider_provisioning_state: The ServiceProviderProvisioningState state of the + resource. Known values are: "NotProvisioned", "Provisioning", "Provisioned", and + "Deprovisioning". + :vartype service_provider_provisioning_state: str or + ~azure.mgmt.network.v2023_09_01.models.ServiceProviderProvisioningState + :ivar authorizations: The list of authorizations. + :vartype authorizations: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :ivar peerings: The list of peerings. + :vartype peerings: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :ivar service_key: The ServiceKey. + :vartype service_key: str + :ivar service_provider_notes: The ServiceProviderNotes. + :vartype service_provider_notes: str + :ivar service_provider_properties: The ServiceProviderProperties. + :vartype service_provider_properties: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitServiceProviderProperties + :ivar express_route_port: The reference to the ExpressRoutePort resource when the circuit is + provisioned on an ExpressRoutePort resource. + :vartype express_route_port: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar bandwidth_in_gbps: The bandwidth of the circuit when the circuit is provisioned on an + ExpressRoutePort resource. + :vartype bandwidth_in_gbps: float + :ivar stag: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + :vartype stag: int + :ivar provisioning_state: The provisioning state of the express route circuit resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar gateway_manager_etag: The GatewayManager Etag. + :vartype gateway_manager_etag: str + :ivar global_reach_enabled: Flag denoting global reach status. + :vartype global_reach_enabled: bool + :ivar authorization_key: The authorizationKey. + :vartype authorization_key: str + :ivar authorization_status: The authorization status of the Circuit. + :vartype authorization_status: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "stag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "authorization_status": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "ExpressRouteCircuitSku"}, + "etag": {"key": "etag", "type": "str"}, + "allow_classic_operations": {"key": "properties.allowClassicOperations", "type": "bool"}, + "circuit_provisioning_state": {"key": "properties.circuitProvisioningState", "type": "str"}, + "service_provider_provisioning_state": {"key": "properties.serviceProviderProvisioningState", "type": "str"}, + "authorizations": {"key": "properties.authorizations", "type": "[ExpressRouteCircuitAuthorization]"}, + "peerings": {"key": "properties.peerings", "type": "[ExpressRouteCircuitPeering]"}, + "service_key": {"key": "properties.serviceKey", "type": "str"}, + "service_provider_notes": {"key": "properties.serviceProviderNotes", "type": "str"}, + "service_provider_properties": { + "key": "properties.serviceProviderProperties", + "type": "ExpressRouteCircuitServiceProviderProperties", + }, + "express_route_port": {"key": "properties.expressRoutePort", "type": "SubResource"}, + "bandwidth_in_gbps": {"key": "properties.bandwidthInGbps", "type": "float"}, + "stag": {"key": "properties.stag", "type": "int"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "gateway_manager_etag": {"key": "properties.gatewayManagerEtag", "type": "str"}, + "global_reach_enabled": {"key": "properties.globalReachEnabled", "type": "bool"}, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "authorization_status": {"key": "properties.authorizationStatus", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["_models.ExpressRouteCircuitSku"] = None, + allow_classic_operations: Optional[bool] = None, + circuit_provisioning_state: Optional[str] = None, + service_provider_provisioning_state: Optional[Union[str, "_models.ServiceProviderProvisioningState"]] = None, + authorizations: Optional[List["_models.ExpressRouteCircuitAuthorization"]] = None, + peerings: Optional[List["_models.ExpressRouteCircuitPeering"]] = None, + service_key: Optional[str] = None, + service_provider_notes: Optional[str] = None, + service_provider_properties: Optional["_models.ExpressRouteCircuitServiceProviderProperties"] = None, + express_route_port: Optional["_models.SubResource"] = None, + bandwidth_in_gbps: Optional[float] = None, + gateway_manager_etag: Optional[str] = None, + global_reach_enabled: Optional[bool] = None, + authorization_key: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitSku + :keyword allow_classic_operations: Allow classic operations. + :paramtype allow_classic_operations: bool + :keyword circuit_provisioning_state: The CircuitProvisioningState state of the resource. + :paramtype circuit_provisioning_state: str + :keyword service_provider_provisioning_state: The ServiceProviderProvisioningState state of the + resource. Known values are: "NotProvisioned", "Provisioning", "Provisioned", and + "Deprovisioning". + :paramtype service_provider_provisioning_state: str or + ~azure.mgmt.network.v2023_09_01.models.ServiceProviderProvisioningState + :keyword authorizations: The list of authorizations. + :paramtype authorizations: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :keyword peerings: The list of peerings. + :paramtype peerings: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :keyword service_key: The ServiceKey. + :paramtype service_key: str + :keyword service_provider_notes: The ServiceProviderNotes. + :paramtype service_provider_notes: str + :keyword service_provider_properties: The ServiceProviderProperties. + :paramtype service_provider_properties: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitServiceProviderProperties + :keyword express_route_port: The reference to the ExpressRoutePort resource when the circuit is + provisioned on an ExpressRoutePort resource. + :paramtype express_route_port: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword bandwidth_in_gbps: The bandwidth of the circuit when the circuit is provisioned on an + ExpressRoutePort resource. + :paramtype bandwidth_in_gbps: float + :keyword gateway_manager_etag: The GatewayManager Etag. + :paramtype gateway_manager_etag: str + :keyword global_reach_enabled: Flag denoting global reach status. + :paramtype global_reach_enabled: bool + :keyword authorization_key: The authorizationKey. + :paramtype authorization_key: str + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.etag = None + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.express_route_port = express_route_port + self.bandwidth_in_gbps = bandwidth_in_gbps + self.stag = None + self.provisioning_state = None + self.gateway_manager_etag = gateway_manager_etag + self.global_reach_enabled = global_reach_enabled + self.authorization_key = authorization_key + self.authorization_status = None + + +class ExpressRouteCircuitArpTable(_serialization.Model): + """The ARP table associated with the ExpressRouteCircuit. + + :ivar age: Entry age in minutes. + :vartype age: int + :ivar interface: Interface address. + :vartype interface: str + :ivar ip_address: The IP address. + :vartype ip_address: str + :ivar mac_address: The MAC address. + :vartype mac_address: str + """ + + _attribute_map = { + "age": {"key": "age", "type": "int"}, + "interface": {"key": "interface", "type": "str"}, + "ip_address": {"key": "ipAddress", "type": "str"}, + "mac_address": {"key": "macAddress", "type": "str"}, + } + + def __init__( + self, + *, + age: Optional[int] = None, + interface: Optional[str] = None, + ip_address: Optional[str] = None, + mac_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword age: Entry age in minutes. + :paramtype age: int + :keyword interface: Interface address. + :paramtype interface: str + :keyword ip_address: The IP address. + :paramtype ip_address: str + :keyword mac_address: The MAC address. + :paramtype mac_address: str + """ + super().__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar authorization_key: The authorization key. + :vartype authorization_key: str + :ivar authorization_use_status: The authorization use status. Known values are: "Available" and + "InUse". + :vartype authorization_use_status: str or + ~azure.mgmt.network.v2023_09_01.models.AuthorizationUseStatus + :ivar provisioning_state: The provisioning state of the authorization resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "authorization_use_status": {"key": "properties.authorizationUseStatus", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + authorization_key: Optional[str] = None, + authorization_use_status: Optional[Union[str, "_models.AuthorizationUseStatus"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword authorization_key: The authorization key. + :paramtype authorization_key: str + :keyword authorization_use_status: The authorization use status. Known values are: "Available" + and "InUse". + :paramtype authorization_use_status: str or + ~azure.mgmt.network.v2023_09_01.models.AuthorizationUseStatus + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = None + + +class ExpressRouteCircuitConnection(SubResource): # pylint: disable=too-many-instance-attributes + """Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit initiating connection. + :vartype express_route_circuit_peering: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :vartype peer_express_route_circuit_peering: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :vartype address_prefix: str + :ivar authorization_key: The authorization key. + :vartype authorization_key: str + :ivar ipv6_circuit_connection_config: IPv6 Address PrefixProperties of the express route + circuit connection. + :vartype ipv6_circuit_connection_config: + ~azure.mgmt.network.v2023_09_01.models.Ipv6CircuitConnectionConfig + :ivar circuit_connection_status: Express Route Circuit connection state. Known values are: + "Connected", "Connecting", and "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.CircuitConnectionStatus + :ivar provisioning_state: The provisioning state of the express route circuit connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "circuit_connection_status": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "express_route_circuit_peering": {"key": "properties.expressRouteCircuitPeering", "type": "SubResource"}, + "peer_express_route_circuit_peering": { + "key": "properties.peerExpressRouteCircuitPeering", + "type": "SubResource", + }, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "ipv6_circuit_connection_config": { + "key": "properties.ipv6CircuitConnectionConfig", + "type": "Ipv6CircuitConnectionConfig", + }, + "circuit_connection_status": {"key": "properties.circuitConnectionStatus", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + express_route_circuit_peering: Optional["_models.SubResource"] = None, + peer_express_route_circuit_peering: Optional["_models.SubResource"] = None, + address_prefix: Optional[str] = None, + authorization_key: Optional[str] = None, + ipv6_circuit_connection_config: Optional["_models.Ipv6CircuitConnectionConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit initiating connection. + :paramtype express_route_circuit_peering: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :paramtype peer_express_route_circuit_peering: + ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :paramtype address_prefix: str + :keyword authorization_key: The authorization key. + :paramtype authorization_key: str + :keyword ipv6_circuit_connection_config: IPv6 Address PrefixProperties of the express route + circuit connection. + :paramtype ipv6_circuit_connection_config: + ~azure.mgmt.network.v2023_09_01.models.Ipv6CircuitConnectionConfig + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.express_route_circuit_peering = express_route_circuit_peering + self.peer_express_route_circuit_peering = peer_express_route_circuit_peering + self.address_prefix = address_prefix + self.authorization_key = authorization_key + self.ipv6_circuit_connection_config = ipv6_circuit_connection_config + self.circuit_connection_status = None + self.provisioning_state = None + + +class ExpressRouteCircuitConnectionListResult(_serialization.Model): + """Response for ListConnections API service call retrieves all global reach connections that + belongs to a Private Peering for an ExpressRouteCircuit. + + :ivar value: The global reach connection associated with Private Peering in an ExpressRoute + Circuit. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuitConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuitConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The global reach connection associated with Private Peering in an ExpressRoute + Circuit. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitListResult(_serialization.Model): + """Response for ListExpressRouteCircuit API service call. + + :ivar value: A list of ExpressRouteCircuits in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuit]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuit"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of ExpressRouteCircuits in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitPeering(SubResource): # pylint: disable=too-many-instance-attributes + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar peering_type: The peering type. Known values are: "AzurePublicPeering", + "AzurePrivatePeering", and "MicrosoftPeering". + :vartype peering_type: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringType + :ivar state: The peering state. Known values are: "Disabled" and "Enabled". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringState + :ivar azure_asn: The Azure ASN. + :vartype azure_asn: int + :ivar peer_asn: The peer ASN. + :vartype peer_asn: int + :ivar primary_peer_address_prefix: The primary address prefix. + :vartype primary_peer_address_prefix: str + :ivar secondary_peer_address_prefix: The secondary address prefix. + :vartype secondary_peer_address_prefix: str + :ivar primary_azure_port: The primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The secondary port. + :vartype secondary_azure_port: str + :ivar shared_key: The shared key. + :vartype shared_key: str + :ivar vlan_id: The VLAN ID. + :vartype vlan_id: int + :ivar microsoft_peering_config: The Microsoft peering configuration. + :vartype microsoft_peering_config: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringConfig + :ivar stats: The peering stats of express route circuit. + :vartype stats: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitStats + :ivar provisioning_state: The provisioning state of the express route circuit peering resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar gateway_manager_etag: The GatewayManager Etag. + :vartype gateway_manager_etag: str + :ivar last_modified_by: Who was the last to modify the peering. + :vartype last_modified_by: str + :ivar route_filter: The reference to the RouteFilter resource. + :vartype route_filter: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar ipv6_peering_config: The IPv6 peering configuration. + :vartype ipv6_peering_config: + ~azure.mgmt.network.v2023_09_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :ivar express_route_connection: The ExpressRoute connection. + :vartype express_route_connection: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnectionId + :ivar connections: The list of circuit connections associated with Azure Private Peering for + this circuit. + :vartype connections: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :ivar peered_connections: The list of peered circuit connections associated with Azure Private + Peering for this circuit. + :vartype peered_connections: + list[~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "peer_asn": {"maximum": 4294967295, "minimum": 1}, + "provisioning_state": {"readonly": True}, + "last_modified_by": {"readonly": True}, + "peered_connections": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "peering_type": {"key": "properties.peeringType", "type": "str"}, + "state": {"key": "properties.state", "type": "str"}, + "azure_asn": {"key": "properties.azureASN", "type": "int"}, + "peer_asn": {"key": "properties.peerASN", "type": "int"}, + "primary_peer_address_prefix": {"key": "properties.primaryPeerAddressPrefix", "type": "str"}, + "secondary_peer_address_prefix": {"key": "properties.secondaryPeerAddressPrefix", "type": "str"}, + "primary_azure_port": {"key": "properties.primaryAzurePort", "type": "str"}, + "secondary_azure_port": {"key": "properties.secondaryAzurePort", "type": "str"}, + "shared_key": {"key": "properties.sharedKey", "type": "str"}, + "vlan_id": {"key": "properties.vlanId", "type": "int"}, + "microsoft_peering_config": { + "key": "properties.microsoftPeeringConfig", + "type": "ExpressRouteCircuitPeeringConfig", + }, + "stats": {"key": "properties.stats", "type": "ExpressRouteCircuitStats"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "gateway_manager_etag": {"key": "properties.gatewayManagerEtag", "type": "str"}, + "last_modified_by": {"key": "properties.lastModifiedBy", "type": "str"}, + "route_filter": {"key": "properties.routeFilter", "type": "SubResource"}, + "ipv6_peering_config": {"key": "properties.ipv6PeeringConfig", "type": "Ipv6ExpressRouteCircuitPeeringConfig"}, + "express_route_connection": {"key": "properties.expressRouteConnection", "type": "ExpressRouteConnectionId"}, + "connections": {"key": "properties.connections", "type": "[ExpressRouteCircuitConnection]"}, + "peered_connections": {"key": "properties.peeredConnections", "type": "[PeerExpressRouteCircuitConnection]"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + peering_type: Optional[Union[str, "_models.ExpressRoutePeeringType"]] = None, + state: Optional[Union[str, "_models.ExpressRoutePeeringState"]] = None, + azure_asn: Optional[int] = None, + peer_asn: Optional[int] = None, + primary_peer_address_prefix: Optional[str] = None, + secondary_peer_address_prefix: Optional[str] = None, + primary_azure_port: Optional[str] = None, + secondary_azure_port: Optional[str] = None, + shared_key: Optional[str] = None, + vlan_id: Optional[int] = None, + microsoft_peering_config: Optional["_models.ExpressRouteCircuitPeeringConfig"] = None, + stats: Optional["_models.ExpressRouteCircuitStats"] = None, + gateway_manager_etag: Optional[str] = None, + route_filter: Optional["_models.SubResource"] = None, + ipv6_peering_config: Optional["_models.Ipv6ExpressRouteCircuitPeeringConfig"] = None, + express_route_connection: Optional["_models.ExpressRouteConnectionId"] = None, + connections: Optional[List["_models.ExpressRouteCircuitConnection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword peering_type: The peering type. Known values are: "AzurePublicPeering", + "AzurePrivatePeering", and "MicrosoftPeering". + :paramtype peering_type: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringType + :keyword state: The peering state. Known values are: "Disabled" and "Enabled". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringState + :keyword azure_asn: The Azure ASN. + :paramtype azure_asn: int + :keyword peer_asn: The peer ASN. + :paramtype peer_asn: int + :keyword primary_peer_address_prefix: The primary address prefix. + :paramtype primary_peer_address_prefix: str + :keyword secondary_peer_address_prefix: The secondary address prefix. + :paramtype secondary_peer_address_prefix: str + :keyword primary_azure_port: The primary port. + :paramtype primary_azure_port: str + :keyword secondary_azure_port: The secondary port. + :paramtype secondary_azure_port: str + :keyword shared_key: The shared key. + :paramtype shared_key: str + :keyword vlan_id: The VLAN ID. + :paramtype vlan_id: int + :keyword microsoft_peering_config: The Microsoft peering configuration. + :paramtype microsoft_peering_config: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringConfig + :keyword stats: The peering stats of express route circuit. + :paramtype stats: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitStats + :keyword gateway_manager_etag: The GatewayManager Etag. + :paramtype gateway_manager_etag: str + :keyword route_filter: The reference to the RouteFilter resource. + :paramtype route_filter: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword ipv6_peering_config: The IPv6 peering configuration. + :paramtype ipv6_peering_config: + ~azure.mgmt.network.v2023_09_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :keyword express_route_connection: The ExpressRoute connection. + :paramtype express_route_connection: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnectionId + :keyword connections: The list of circuit connections associated with Azure Private Peering for + this circuit. + :paramtype connections: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = None + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = None + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.express_route_connection = express_route_connection + self.connections = connections + self.peered_connections = None + + +class ExpressRouteCircuitPeeringConfig(_serialization.Model): + """Specifies the peering configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar advertised_public_prefixes: The reference to AdvertisedPublicPrefixes. + :vartype advertised_public_prefixes: list[str] + :ivar advertised_communities: The communities of bgp peering. Specified for microsoft peering. + :vartype advertised_communities: list[str] + :ivar advertised_public_prefixes_state: The advertised public prefix state of the Peering + resource. Known values are: "NotConfigured", "Configuring", "Configured", and + "ValidationNeeded". + :vartype advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :ivar legacy_mode: The legacy mode of the peering. + :vartype legacy_mode: int + :ivar customer_asn: The CustomerASN of the peering. + :vartype customer_asn: int + :ivar routing_registry_name: The RoutingRegistryName of the configuration. + :vartype routing_registry_name: str + """ + + _validation = { + "advertised_public_prefixes_state": {"readonly": True}, + } + + _attribute_map = { + "advertised_public_prefixes": {"key": "advertisedPublicPrefixes", "type": "[str]"}, + "advertised_communities": {"key": "advertisedCommunities", "type": "[str]"}, + "advertised_public_prefixes_state": {"key": "advertisedPublicPrefixesState", "type": "str"}, + "legacy_mode": {"key": "legacyMode", "type": "int"}, + "customer_asn": {"key": "customerASN", "type": "int"}, + "routing_registry_name": {"key": "routingRegistryName", "type": "str"}, + } + + def __init__( + self, + *, + advertised_public_prefixes: Optional[List[str]] = None, + advertised_communities: Optional[List[str]] = None, + legacy_mode: Optional[int] = None, + customer_asn: Optional[int] = None, + routing_registry_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword advertised_public_prefixes: The reference to AdvertisedPublicPrefixes. + :paramtype advertised_public_prefixes: list[str] + :keyword advertised_communities: The communities of bgp peering. Specified for microsoft + peering. + :paramtype advertised_communities: list[str] + :keyword legacy_mode: The legacy mode of the peering. + :paramtype legacy_mode: int + :keyword customer_asn: The CustomerASN of the peering. + :paramtype customer_asn: int + :keyword routing_registry_name: The RoutingRegistryName of the configuration. + :paramtype routing_registry_name: str + """ + super().__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = None + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name + + +class ExpressRouteCircuitPeeringId(_serialization.Model): + """ExpressRoute circuit peering identifier. + + :ivar id: The ID of the ExpressRoute circuit peering. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The ID of the ExpressRoute circuit peering. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class ExpressRouteCircuitPeeringListResult(_serialization.Model): + """Response for ListPeering API service call retrieves all peerings that belong to an + ExpressRouteCircuit. + + :ivar value: The peerings in an express route circuit. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuitPeering]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuitPeering"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The peerings in an express route circuit. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitReference(_serialization.Model): + """Reference to an express route circuit. + + :ivar id: Corresponding Express Route Circuit Id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Corresponding Express Route Circuit Id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class ExpressRouteCircuitRoutesTable(_serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :ivar network: IP address of a network entity. + :vartype network: str + :ivar next_hop: NextHop address. + :vartype next_hop: str + :ivar loc_prf: Local preference value as set with the set local-preference route-map + configuration command. + :vartype loc_prf: str + :ivar weight: Route Weight. + :vartype weight: int + :ivar path: Autonomous system paths to the destination network. + :vartype path: str + """ + + _attribute_map = { + "network": {"key": "network", "type": "str"}, + "next_hop": {"key": "nextHop", "type": "str"}, + "loc_prf": {"key": "locPrf", "type": "str"}, + "weight": {"key": "weight", "type": "int"}, + "path": {"key": "path", "type": "str"}, + } + + def __init__( + self, + *, + network: Optional[str] = None, + next_hop: Optional[str] = None, + loc_prf: Optional[str] = None, + weight: Optional[int] = None, + path: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword network: IP address of a network entity. + :paramtype network: str + :keyword next_hop: NextHop address. + :paramtype next_hop: str + :keyword loc_prf: Local preference value as set with the set local-preference route-map + configuration command. + :paramtype loc_prf: str + :keyword weight: Route Weight. + :paramtype weight: int + :keyword path: Autonomous system paths to the destination network. + :paramtype path: str + """ + super().__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path + + +class ExpressRouteCircuitRoutesTableSummary(_serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :ivar neighbor: IP address of the neighbor. + :vartype neighbor: str + :ivar v: BGP version number spoken to the neighbor. + :vartype v: int + :ivar as_property: Autonomous system number. + :vartype as_property: int + :ivar up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :vartype up_down: str + :ivar state_pfx_rcd: Current state of the BGP session, and the number of prefixes that have + been received from a neighbor or peer group. + :vartype state_pfx_rcd: str + """ + + _attribute_map = { + "neighbor": {"key": "neighbor", "type": "str"}, + "v": {"key": "v", "type": "int"}, + "as_property": {"key": "as", "type": "int"}, + "up_down": {"key": "upDown", "type": "str"}, + "state_pfx_rcd": {"key": "statePfxRcd", "type": "str"}, + } + + def __init__( + self, + *, + neighbor: Optional[str] = None, + v: Optional[int] = None, + as_property: Optional[int] = None, + up_down: Optional[str] = None, + state_pfx_rcd: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword neighbor: IP address of the neighbor. + :paramtype neighbor: str + :keyword v: BGP version number spoken to the neighbor. + :paramtype v: int + :keyword as_property: Autonomous system number. + :paramtype as_property: int + :keyword up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :paramtype up_down: str + :keyword state_pfx_rcd: Current state of the BGP session, and the number of prefixes that have + been received from a neighbor or peer group. + :paramtype state_pfx_rcd: str + """ + super().__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd + + +class ExpressRouteCircuitsArpTableListResult(_serialization.Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :ivar value: A list of the ARP tables. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitArpTable] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuitArpTable]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuitArpTable"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of the ARP tables. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitArpTable] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitServiceProviderProperties(_serialization.Model): # pylint: disable=name-too-long + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :ivar service_provider_name: The serviceProviderName. + :vartype service_provider_name: str + :ivar peering_location: The peering location. + :vartype peering_location: str + :ivar bandwidth_in_mbps: The BandwidthInMbps. + :vartype bandwidth_in_mbps: int + """ + + _attribute_map = { + "service_provider_name": {"key": "serviceProviderName", "type": "str"}, + "peering_location": {"key": "peeringLocation", "type": "str"}, + "bandwidth_in_mbps": {"key": "bandwidthInMbps", "type": "int"}, + } + + def __init__( + self, + *, + service_provider_name: Optional[str] = None, + peering_location: Optional[str] = None, + bandwidth_in_mbps: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword service_provider_name: The serviceProviderName. + :paramtype service_provider_name: str + :keyword peering_location: The peering location. + :paramtype peering_location: str + :keyword bandwidth_in_mbps: The BandwidthInMbps. + :paramtype bandwidth_in_mbps: int + """ + super().__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps + + +class ExpressRouteCircuitSku(_serialization.Model): + """Contains SKU in an ExpressRouteCircuit. + + :ivar name: The name of the SKU. + :vartype name: str + :ivar tier: The tier of the SKU. Known values are: "Standard", "Premium", "Basic", and "Local". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitSkuTier + :ivar family: The family of the SKU. Known values are: "UnlimitedData" and "MeteredData". + :vartype family: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "family": {"key": "family", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[Union[str, "_models.ExpressRouteCircuitSkuTier"]] = None, + family: Optional[Union[str, "_models.ExpressRouteCircuitSkuFamily"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the SKU. + :paramtype name: str + :keyword tier: The tier of the SKU. Known values are: "Standard", "Premium", "Basic", and + "Local". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitSkuTier + :keyword family: The family of the SKU. Known values are: "UnlimitedData" and "MeteredData". + :paramtype family: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitSkuFamily + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family + + +class ExpressRouteCircuitsRoutesTableListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListRoutesTable associated with the Express Route Circuits API. + + :ivar value: The list of routes table. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitRoutesTable] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuitRoutesTable]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuitRoutesTable"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of routes table. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitRoutesTable] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListRoutesTable associated with the Express Route Circuits API. + + :ivar value: A list of the routes table. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitRoutesTableSummary] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCircuitRoutesTableSummary]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteCircuitRoutesTableSummary"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of the routes table. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitRoutesTableSummary] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitStats(_serialization.Model): + """Contains stats associated with the peering. + + :ivar primarybytes_in: The Primary BytesIn of the peering. + :vartype primarybytes_in: int + :ivar primarybytes_out: The primary BytesOut of the peering. + :vartype primarybytes_out: int + :ivar secondarybytes_in: The secondary BytesIn of the peering. + :vartype secondarybytes_in: int + :ivar secondarybytes_out: The secondary BytesOut of the peering. + :vartype secondarybytes_out: int + """ + + _attribute_map = { + "primarybytes_in": {"key": "primarybytesIn", "type": "int"}, + "primarybytes_out": {"key": "primarybytesOut", "type": "int"}, + "secondarybytes_in": {"key": "secondarybytesIn", "type": "int"}, + "secondarybytes_out": {"key": "secondarybytesOut", "type": "int"}, + } + + def __init__( + self, + *, + primarybytes_in: Optional[int] = None, + primarybytes_out: Optional[int] = None, + secondarybytes_in: Optional[int] = None, + secondarybytes_out: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword primarybytes_in: The Primary BytesIn of the peering. + :paramtype primarybytes_in: int + :keyword primarybytes_out: The primary BytesOut of the peering. + :paramtype primarybytes_out: int + :keyword secondarybytes_in: The secondary BytesIn of the peering. + :paramtype secondarybytes_in: int + :keyword secondarybytes_out: The secondary BytesOut of the peering. + :paramtype secondarybytes_out: int + """ + super().__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out + + +class ExpressRouteConnection(SubResource): + """ExpressRouteConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar provisioning_state: The provisioning state of the express route connection resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar express_route_circuit_peering: The ExpressRoute circuit peering. + :vartype express_route_circuit_peering: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringId + :ivar authorization_key: Authorization key to establish the connection. + :vartype authorization_key: str + :ivar routing_weight: The routing weight associated to the connection. + :vartype routing_weight: int + :ivar enable_internet_security: Enable internet security. + :vartype enable_internet_security: bool + :ivar express_route_gateway_bypass: Enable FastPath to vWan Firewall hub. + :vartype express_route_gateway_bypass: bool + :ivar enable_private_link_fast_path: Bypass the ExpressRoute gateway when accessing + private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + :vartype enable_private_link_fast_path: bool + :ivar routing_configuration: The Routing Configuration indicating the associated and propagated + route tables on this connection. + :vartype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + + _validation = { + "name": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "express_route_circuit_peering": { + "key": "properties.expressRouteCircuitPeering", + "type": "ExpressRouteCircuitPeeringId", + }, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "routing_weight": {"key": "properties.routingWeight", "type": "int"}, + "enable_internet_security": {"key": "properties.enableInternetSecurity", "type": "bool"}, + "express_route_gateway_bypass": {"key": "properties.expressRouteGatewayBypass", "type": "bool"}, + "enable_private_link_fast_path": {"key": "properties.enablePrivateLinkFastPath", "type": "bool"}, + "routing_configuration": {"key": "properties.routingConfiguration", "type": "RoutingConfiguration"}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + express_route_circuit_peering: Optional["_models.ExpressRouteCircuitPeeringId"] = None, + authorization_key: Optional[str] = None, + routing_weight: Optional[int] = None, + enable_internet_security: Optional[bool] = None, + express_route_gateway_bypass: Optional[bool] = None, + enable_private_link_fast_path: Optional[bool] = None, + routing_configuration: Optional["_models.RoutingConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource. Required. + :paramtype name: str + :keyword express_route_circuit_peering: The ExpressRoute circuit peering. + :paramtype express_route_circuit_peering: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringId + :keyword authorization_key: Authorization key to establish the connection. + :paramtype authorization_key: str + :keyword routing_weight: The routing weight associated to the connection. + :paramtype routing_weight: int + :keyword enable_internet_security: Enable internet security. + :paramtype enable_internet_security: bool + :keyword express_route_gateway_bypass: Enable FastPath to vWan Firewall hub. + :paramtype express_route_gateway_bypass: bool + :keyword enable_private_link_fast_path: Bypass the ExpressRoute gateway when accessing + private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + :paramtype enable_private_link_fast_path: bool + :keyword routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :paramtype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + super().__init__(id=id, **kwargs) + self.name = name + self.provisioning_state = None + self.express_route_circuit_peering = express_route_circuit_peering + self.authorization_key = authorization_key + self.routing_weight = routing_weight + self.enable_internet_security = enable_internet_security + self.express_route_gateway_bypass = express_route_gateway_bypass + self.enable_private_link_fast_path = enable_private_link_fast_path + self.routing_configuration = routing_configuration + + +class ExpressRouteConnectionId(_serialization.Model): + """The ID of the ExpressRouteConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the ExpressRouteConnection. + :vartype id: str + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + + +class ExpressRouteConnectionList(_serialization.Model): + """ExpressRouteConnection list. + + :ivar value: The list of ExpressRoute connections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteConnection]"}, + } + + def __init__(self, *, value: Optional[List["_models.ExpressRouteConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of ExpressRoute connections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + """ + super().__init__(**kwargs) + self.value = value + + +class ExpressRouteCrossConnection(Resource): # pylint: disable=too-many-instance-attributes + """ExpressRouteCrossConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar primary_azure_port: The name of the primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The name of the secondary port. + :vartype secondary_azure_port: str + :ivar s_tag: The identifier of the circuit traffic. + :vartype s_tag: int + :ivar peering_location: The peering location of the ExpressRoute circuit. + :vartype peering_location: str + :ivar bandwidth_in_mbps: The circuit bandwidth In Mbps. + :vartype bandwidth_in_mbps: int + :ivar express_route_circuit: The ExpressRouteCircuit. + :vartype express_route_circuit: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitReference + :ivar service_provider_provisioning_state: The provisioning state of the circuit in the + connectivity provider system. Known values are: "NotProvisioned", "Provisioning", + "Provisioned", and "Deprovisioning". + :vartype service_provider_provisioning_state: str or + ~azure.mgmt.network.v2023_09_01.models.ServiceProviderProvisioningState + :ivar service_provider_notes: Additional read only notes set by the connectivity provider. + :vartype service_provider_notes: str + :ivar provisioning_state: The provisioning state of the express route cross connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar peerings: The list of peerings. + :vartype peerings: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "primary_azure_port": {"readonly": True}, + "secondary_azure_port": {"readonly": True}, + "s_tag": {"readonly": True}, + "peering_location": {"readonly": True}, + "bandwidth_in_mbps": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "primary_azure_port": {"key": "properties.primaryAzurePort", "type": "str"}, + "secondary_azure_port": {"key": "properties.secondaryAzurePort", "type": "str"}, + "s_tag": {"key": "properties.sTag", "type": "int"}, + "peering_location": {"key": "properties.peeringLocation", "type": "str"}, + "bandwidth_in_mbps": {"key": "properties.bandwidthInMbps", "type": "int"}, + "express_route_circuit": {"key": "properties.expressRouteCircuit", "type": "ExpressRouteCircuitReference"}, + "service_provider_provisioning_state": {"key": "properties.serviceProviderProvisioningState", "type": "str"}, + "service_provider_notes": {"key": "properties.serviceProviderNotes", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "peerings": {"key": "properties.peerings", "type": "[ExpressRouteCrossConnectionPeering]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + express_route_circuit: Optional["_models.ExpressRouteCircuitReference"] = None, + service_provider_provisioning_state: Optional[Union[str, "_models.ServiceProviderProvisioningState"]] = None, + service_provider_notes: Optional[str] = None, + peerings: Optional[List["_models.ExpressRouteCrossConnectionPeering"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword express_route_circuit: The ExpressRouteCircuit. + :paramtype express_route_circuit: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitReference + :keyword service_provider_provisioning_state: The provisioning state of the circuit in the + connectivity provider system. Known values are: "NotProvisioned", "Provisioning", + "Provisioned", and "Deprovisioning". + :paramtype service_provider_provisioning_state: str or + ~azure.mgmt.network.v2023_09_01.models.ServiceProviderProvisioningState + :keyword service_provider_notes: Additional read only notes set by the connectivity provider. + :paramtype service_provider_notes: str + :keyword peerings: The list of peerings. + :paramtype peerings: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.primary_azure_port = None + self.secondary_azure_port = None + self.s_tag = None + self.peering_location = None + self.bandwidth_in_mbps = None + self.express_route_circuit = express_route_circuit + self.service_provider_provisioning_state = service_provider_provisioning_state + self.service_provider_notes = service_provider_notes + self.provisioning_state = None + self.peerings = peerings + + +class ExpressRouteCrossConnectionListResult(_serialization.Model): + """Response for ListExpressRouteCrossConnection API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of ExpressRouteCrossConnection resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCrossConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ExpressRouteCrossConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of ExpressRouteCrossConnection resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteCrossConnectionPeering(SubResource): # pylint: disable=too-many-instance-attributes + """Peering in an ExpressRoute Cross Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar peering_type: The peering type. Known values are: "AzurePublicPeering", + "AzurePrivatePeering", and "MicrosoftPeering". + :vartype peering_type: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringType + :ivar state: The peering state. Known values are: "Disabled" and "Enabled". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringState + :ivar azure_asn: The Azure ASN. + :vartype azure_asn: int + :ivar peer_asn: The peer ASN. + :vartype peer_asn: int + :ivar primary_peer_address_prefix: The primary address prefix. + :vartype primary_peer_address_prefix: str + :ivar secondary_peer_address_prefix: The secondary address prefix. + :vartype secondary_peer_address_prefix: str + :ivar primary_azure_port: The primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The secondary port. + :vartype secondary_azure_port: str + :ivar shared_key: The shared key. + :vartype shared_key: str + :ivar vlan_id: The VLAN ID. + :vartype vlan_id: int + :ivar microsoft_peering_config: The Microsoft peering configuration. + :vartype microsoft_peering_config: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringConfig + :ivar provisioning_state: The provisioning state of the express route cross connection peering + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar gateway_manager_etag: The GatewayManager Etag. + :vartype gateway_manager_etag: str + :ivar last_modified_by: Who was the last to modify the peering. + :vartype last_modified_by: str + :ivar ipv6_peering_config: The IPv6 peering configuration. + :vartype ipv6_peering_config: + ~azure.mgmt.network.v2023_09_01.models.Ipv6ExpressRouteCircuitPeeringConfig + """ + + _validation = { + "etag": {"readonly": True}, + "azure_asn": {"readonly": True}, + "peer_asn": {"maximum": 4294967295, "minimum": 1}, + "primary_azure_port": {"readonly": True}, + "secondary_azure_port": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "last_modified_by": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "peering_type": {"key": "properties.peeringType", "type": "str"}, + "state": {"key": "properties.state", "type": "str"}, + "azure_asn": {"key": "properties.azureASN", "type": "int"}, + "peer_asn": {"key": "properties.peerASN", "type": "int"}, + "primary_peer_address_prefix": {"key": "properties.primaryPeerAddressPrefix", "type": "str"}, + "secondary_peer_address_prefix": {"key": "properties.secondaryPeerAddressPrefix", "type": "str"}, + "primary_azure_port": {"key": "properties.primaryAzurePort", "type": "str"}, + "secondary_azure_port": {"key": "properties.secondaryAzurePort", "type": "str"}, + "shared_key": {"key": "properties.sharedKey", "type": "str"}, + "vlan_id": {"key": "properties.vlanId", "type": "int"}, + "microsoft_peering_config": { + "key": "properties.microsoftPeeringConfig", + "type": "ExpressRouteCircuitPeeringConfig", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "gateway_manager_etag": {"key": "properties.gatewayManagerEtag", "type": "str"}, + "last_modified_by": {"key": "properties.lastModifiedBy", "type": "str"}, + "ipv6_peering_config": {"key": "properties.ipv6PeeringConfig", "type": "Ipv6ExpressRouteCircuitPeeringConfig"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + peering_type: Optional[Union[str, "_models.ExpressRoutePeeringType"]] = None, + state: Optional[Union[str, "_models.ExpressRoutePeeringState"]] = None, + peer_asn: Optional[int] = None, + primary_peer_address_prefix: Optional[str] = None, + secondary_peer_address_prefix: Optional[str] = None, + shared_key: Optional[str] = None, + vlan_id: Optional[int] = None, + microsoft_peering_config: Optional["_models.ExpressRouteCircuitPeeringConfig"] = None, + gateway_manager_etag: Optional[str] = None, + ipv6_peering_config: Optional["_models.Ipv6ExpressRouteCircuitPeeringConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword peering_type: The peering type. Known values are: "AzurePublicPeering", + "AzurePrivatePeering", and "MicrosoftPeering". + :paramtype peering_type: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringType + :keyword state: The peering state. Known values are: "Disabled" and "Enabled". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePeeringState + :keyword peer_asn: The peer ASN. + :paramtype peer_asn: int + :keyword primary_peer_address_prefix: The primary address prefix. + :paramtype primary_peer_address_prefix: str + :keyword secondary_peer_address_prefix: The secondary address prefix. + :paramtype secondary_peer_address_prefix: str + :keyword shared_key: The shared key. + :paramtype shared_key: str + :keyword vlan_id: The VLAN ID. + :paramtype vlan_id: int + :keyword microsoft_peering_config: The Microsoft peering configuration. + :paramtype microsoft_peering_config: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringConfig + :keyword gateway_manager_etag: The GatewayManager Etag. + :paramtype gateway_manager_etag: str + :keyword ipv6_peering_config: The IPv6 peering configuration. + :paramtype ipv6_peering_config: + ~azure.mgmt.network.v2023_09_01.models.Ipv6ExpressRouteCircuitPeeringConfig + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.peering_type = peering_type + self.state = state + self.azure_asn = None + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = None + self.secondary_azure_port = None + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.provisioning_state = None + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = None + self.ipv6_peering_config = ipv6_peering_config + + +class ExpressRouteCrossConnectionPeeringList(_serialization.Model): + """Response for ListPeering API service call retrieves all peerings that belong to an + ExpressRouteCrossConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The peerings in an express route cross connection. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCrossConnectionPeering]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.ExpressRouteCrossConnectionPeering"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The peerings in an express route cross connection. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteCrossConnectionRoutesTableSummary(_serialization.Model): # pylint: disable=name-too-long + """The routes table associated with the ExpressRouteCircuit. + + :ivar neighbor: IP address of Neighbor router. + :vartype neighbor: str + :ivar asn: Autonomous system number. + :vartype asn: int + :ivar up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :vartype up_down: str + :ivar state_or_prefixes_received: Current state of the BGP session, and the number of prefixes + that have been received from a neighbor or peer group. + :vartype state_or_prefixes_received: str + """ + + _attribute_map = { + "neighbor": {"key": "neighbor", "type": "str"}, + "asn": {"key": "asn", "type": "int"}, + "up_down": {"key": "upDown", "type": "str"}, + "state_or_prefixes_received": {"key": "stateOrPrefixesReceived", "type": "str"}, + } + + def __init__( + self, + *, + neighbor: Optional[str] = None, + asn: Optional[int] = None, + up_down: Optional[str] = None, + state_or_prefixes_received: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword neighbor: IP address of Neighbor router. + :paramtype neighbor: str + :keyword asn: Autonomous system number. + :paramtype asn: int + :keyword up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :paramtype up_down: str + :keyword state_or_prefixes_received: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :paramtype state_or_prefixes_received: str + """ + super().__init__(**kwargs) + self.neighbor = neighbor + self.asn = asn + self.up_down = up_down + self.state_or_prefixes_received = state_or_prefixes_received + + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListRoutesTable associated with the Express Route Cross Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of the routes table. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionRoutesTableSummary] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteCrossConnectionRoutesTableSummary]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.ExpressRouteCrossConnectionRoutesTableSummary"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of the routes table. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionRoutesTableSummary] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteGateway(Resource): # pylint: disable=too-many-instance-attributes + """ExpressRoute gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar auto_scale_configuration: Configuration for auto scaling. + :vartype auto_scale_configuration: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :ivar provisioning_state: The provisioning state of the express route gateway resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar virtual_hub: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + :vartype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.VirtualHubId + :ivar allow_non_virtual_wan_traffic: Configures this gateway to accept traffic from non Virtual + WAN networks. + :vartype allow_non_virtual_wan_traffic: bool + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "auto_scale_configuration": { + "key": "properties.autoScaleConfiguration", + "type": "ExpressRouteGatewayPropertiesAutoScaleConfiguration", + }, + "express_route_connections": {"key": "properties.expressRouteConnections", "type": "[ExpressRouteConnection]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "virtual_hub": {"key": "properties.virtualHub", "type": "VirtualHubId"}, + "allow_non_virtual_wan_traffic": {"key": "properties.allowNonVirtualWanTraffic", "type": "bool"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + auto_scale_configuration: Optional["_models.ExpressRouteGatewayPropertiesAutoScaleConfiguration"] = None, + express_route_connections: Optional[List["_models.ExpressRouteConnection"]] = None, + virtual_hub: Optional["_models.VirtualHubId"] = None, + allow_non_virtual_wan_traffic: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword auto_scale_configuration: Configuration for auto scaling. + :paramtype auto_scale_configuration: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :keyword express_route_connections: List of ExpressRoute connections to the ExpressRoute + gateway. + :paramtype express_route_connections: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :keyword virtual_hub: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + :paramtype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.VirtualHubId + :keyword allow_non_virtual_wan_traffic: Configures this gateway to accept traffic from non + Virtual WAN networks. + :paramtype allow_non_virtual_wan_traffic: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.auto_scale_configuration = auto_scale_configuration + self.express_route_connections = express_route_connections + self.provisioning_state = None + self.virtual_hub = virtual_hub + self.allow_non_virtual_wan_traffic = allow_non_virtual_wan_traffic + + +class ExpressRouteGatewayList(_serialization.Model): + """List of ExpressRoute gateways. + + :ivar value: List of ExpressRoute gateways. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteGateway]"}, + } + + def __init__(self, *, value: Optional[List["_models.ExpressRouteGateway"]] = None, **kwargs: Any) -> None: + """ + :keyword value: List of ExpressRoute gateways. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + """ + super().__init__(**kwargs) + self.value = value + + +class ExpressRouteGatewayPropertiesAutoScaleConfiguration(_serialization.Model): # pylint: disable=name-too-long + """Configuration for auto scaling. + + :ivar bounds: Minimum and maximum number of scale units to deploy. + :vartype bounds: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + """ + + _attribute_map = { + "bounds": {"key": "bounds", "type": "ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds"}, + } + + def __init__( + self, + *, + bounds: Optional["_models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds"] = None, + **kwargs: Any + ) -> None: + """ + :keyword bounds: Minimum and maximum number of scale units to deploy. + :paramtype bounds: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + """ + super().__init__(**kwargs) + self.bounds = bounds + + +class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds(_serialization.Model): # pylint: disable=name-too-long + """Minimum and maximum number of scale units to deploy. + + :ivar min: Minimum number of scale units deployed for ExpressRoute gateway. + :vartype min: int + :ivar max: Maximum number of scale units deployed for ExpressRoute gateway. + :vartype max: int + """ + + _attribute_map = { + "min": {"key": "min", "type": "int"}, + "max": {"key": "max", "type": "int"}, + } + + def __init__( + self, + *, + min: Optional[int] = None, # pylint: disable=redefined-builtin + max: Optional[int] = None, # pylint: disable=redefined-builtin + **kwargs: Any + ) -> None: + """ + :keyword min: Minimum number of scale units deployed for ExpressRoute gateway. + :paramtype min: int + :keyword max: Maximum number of scale units deployed for ExpressRoute gateway. + :paramtype max: int + """ + super().__init__(**kwargs) + self.min = min + self.max = max + + +class ExpressRouteLink(SubResource): # pylint: disable=too-many-instance-attributes + """ExpressRouteLink child resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of child port resource that is unique among child port resources of the + parent. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar router_name: Name of Azure router associated with physical port. + :vartype router_name: str + :ivar interface_name: Name of Azure router interface. + :vartype interface_name: str + :ivar patch_panel_id: Mapping between physical port to patch panel port. + :vartype patch_panel_id: str + :ivar rack_id: Mapping of physical patch panel to rack. + :vartype rack_id: str + :ivar colo_location: Cololocation for ExpressRoute Hybrid Direct. + :vartype colo_location: str + :ivar connector_type: Physical fiber port type. Known values are: "LC" and "SC". + :vartype connector_type: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkConnectorType + :ivar admin_state: Administrative state of the physical port. Known values are: "Enabled" and + "Disabled". + :vartype admin_state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkAdminState + :ivar provisioning_state: The provisioning state of the express route link resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar mac_sec_config: MacSec configuration. + :vartype mac_sec_config: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkMacSecConfig + """ + + _validation = { + "etag": {"readonly": True}, + "router_name": {"readonly": True}, + "interface_name": {"readonly": True}, + "patch_panel_id": {"readonly": True}, + "rack_id": {"readonly": True}, + "colo_location": {"readonly": True}, + "connector_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "router_name": {"key": "properties.routerName", "type": "str"}, + "interface_name": {"key": "properties.interfaceName", "type": "str"}, + "patch_panel_id": {"key": "properties.patchPanelId", "type": "str"}, + "rack_id": {"key": "properties.rackId", "type": "str"}, + "colo_location": {"key": "properties.coloLocation", "type": "str"}, + "connector_type": {"key": "properties.connectorType", "type": "str"}, + "admin_state": {"key": "properties.adminState", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "mac_sec_config": {"key": "properties.macSecConfig", "type": "ExpressRouteLinkMacSecConfig"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + admin_state: Optional[Union[str, "_models.ExpressRouteLinkAdminState"]] = None, + mac_sec_config: Optional["_models.ExpressRouteLinkMacSecConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of child port resource that is unique among child port resources of the + parent. + :paramtype name: str + :keyword admin_state: Administrative state of the physical port. Known values are: "Enabled" + and "Disabled". + :paramtype admin_state: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkAdminState + :keyword mac_sec_config: MacSec configuration. + :paramtype mac_sec_config: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkMacSecConfig + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.router_name = None + self.interface_name = None + self.patch_panel_id = None + self.rack_id = None + self.colo_location = None + self.connector_type = None + self.admin_state = admin_state + self.provisioning_state = None + self.mac_sec_config = mac_sec_config + + +class ExpressRouteLinkListResult(_serialization.Model): + """Response for ListExpressRouteLinks API service call. + + :ivar value: The list of ExpressRouteLink sub-resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteLink]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteLink"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of ExpressRouteLink sub-resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteLinkMacSecConfig(_serialization.Model): + """ExpressRouteLink Mac Security Configuration. + + :ivar ckn_secret_identifier: Keyvault Secret Identifier URL containing Mac security CKN key. + :vartype ckn_secret_identifier: str + :ivar cak_secret_identifier: Keyvault Secret Identifier URL containing Mac security CAK key. + :vartype cak_secret_identifier: str + :ivar cipher: Mac security cipher. Known values are: "GcmAes256", "GcmAes128", "GcmAesXpn128", + and "GcmAesXpn256". + :vartype cipher: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkMacSecCipher + :ivar sci_state: Sci mode enabled/disabled. Known values are: "Disabled" and "Enabled". + :vartype sci_state: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkMacSecSciState + """ + + _attribute_map = { + "ckn_secret_identifier": {"key": "cknSecretIdentifier", "type": "str"}, + "cak_secret_identifier": {"key": "cakSecretIdentifier", "type": "str"}, + "cipher": {"key": "cipher", "type": "str"}, + "sci_state": {"key": "sciState", "type": "str"}, + } + + def __init__( + self, + *, + ckn_secret_identifier: Optional[str] = None, + cak_secret_identifier: Optional[str] = None, + cipher: Optional[Union[str, "_models.ExpressRouteLinkMacSecCipher"]] = None, + sci_state: Optional[Union[str, "_models.ExpressRouteLinkMacSecSciState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword ckn_secret_identifier: Keyvault Secret Identifier URL containing Mac security CKN key. + :paramtype ckn_secret_identifier: str + :keyword cak_secret_identifier: Keyvault Secret Identifier URL containing Mac security CAK key. + :paramtype cak_secret_identifier: str + :keyword cipher: Mac security cipher. Known values are: "GcmAes256", "GcmAes128", + "GcmAesXpn128", and "GcmAesXpn256". + :paramtype cipher: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkMacSecCipher + :keyword sci_state: Sci mode enabled/disabled. Known values are: "Disabled" and "Enabled". + :paramtype sci_state: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLinkMacSecSciState + """ + super().__init__(**kwargs) + self.ckn_secret_identifier = ckn_secret_identifier + self.cak_secret_identifier = cak_secret_identifier + self.cipher = cipher + self.sci_state = sci_state + + +class ExpressRoutePort(Resource): # pylint: disable=too-many-instance-attributes + """ExpressRoutePort resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar identity: The identity of ExpressRoutePort, if configured. + :vartype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :ivar peering_location: The name of the peering location that the ExpressRoutePort is mapped to + physically. + :vartype peering_location: str + :ivar bandwidth_in_gbps: Bandwidth of procured ports in Gbps. + :vartype bandwidth_in_gbps: int + :ivar provisioned_bandwidth_in_gbps: Aggregate Gbps of associated circuit bandwidths. + :vartype provisioned_bandwidth_in_gbps: float + :ivar mtu: Maximum transmission unit of the physical port pair(s). + :vartype mtu: str + :ivar encapsulation: Encapsulation method on physical ports. Known values are: "Dot1Q" and + "QinQ". + :vartype encapsulation: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsEncapsulation + :ivar ether_type: Ether type of the physical port. + :vartype ether_type: str + :ivar allocation_date: Date of the physical port allocation to be used in Letter of + Authorization. + :vartype allocation_date: str + :ivar links: The set of physical links of the ExpressRoutePort resource. + :vartype links: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the express route port resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: The resource GUID property of the express route port resource. + :vartype resource_guid: str + :ivar billing_type: The billing type of the ExpressRoutePort resource. Known values are: + "MeteredData" and "UnlimitedData". + :vartype billing_type: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsBillingType + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioned_bandwidth_in_gbps": {"readonly": True}, + "mtu": {"readonly": True}, + "ether_type": {"readonly": True}, + "allocation_date": {"readonly": True}, + "circuits": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "peering_location": {"key": "properties.peeringLocation", "type": "str"}, + "bandwidth_in_gbps": {"key": "properties.bandwidthInGbps", "type": "int"}, + "provisioned_bandwidth_in_gbps": {"key": "properties.provisionedBandwidthInGbps", "type": "float"}, + "mtu": {"key": "properties.mtu", "type": "str"}, + "encapsulation": {"key": "properties.encapsulation", "type": "str"}, + "ether_type": {"key": "properties.etherType", "type": "str"}, + "allocation_date": {"key": "properties.allocationDate", "type": "str"}, + "links": {"key": "properties.links", "type": "[ExpressRouteLink]"}, + "circuits": {"key": "properties.circuits", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "billing_type": {"key": "properties.billingType", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + peering_location: Optional[str] = None, + bandwidth_in_gbps: Optional[int] = None, + encapsulation: Optional[Union[str, "_models.ExpressRoutePortsEncapsulation"]] = None, + links: Optional[List["_models.ExpressRouteLink"]] = None, + billing_type: Optional[Union[str, "_models.ExpressRoutePortsBillingType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of ExpressRoutePort, if configured. + :paramtype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :keyword peering_location: The name of the peering location that the ExpressRoutePort is mapped + to physically. + :paramtype peering_location: str + :keyword bandwidth_in_gbps: Bandwidth of procured ports in Gbps. + :paramtype bandwidth_in_gbps: int + :keyword encapsulation: Encapsulation method on physical ports. Known values are: "Dot1Q" and + "QinQ". + :paramtype encapsulation: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsEncapsulation + :keyword links: The set of physical links of the ExpressRoutePort resource. + :paramtype links: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink] + :keyword billing_type: The billing type of the ExpressRoutePort resource. Known values are: + "MeteredData" and "UnlimitedData". + :paramtype billing_type: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsBillingType + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.identity = identity + self.peering_location = peering_location + self.bandwidth_in_gbps = bandwidth_in_gbps + self.provisioned_bandwidth_in_gbps = None + self.mtu = None + self.encapsulation = encapsulation + self.ether_type = None + self.allocation_date = None + self.links = links + self.circuits = None + self.provisioning_state = None + self.resource_guid = None + self.billing_type = billing_type + + +class ExpressRoutePortAuthorization(SubResource): + """ExpressRoutePort Authorization resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar authorization_key: The authorization key. + :vartype authorization_key: str + :ivar authorization_use_status: The authorization use status. Known values are: "Available" and + "InUse". + :vartype authorization_use_status: str or + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorizationUseStatus + :ivar circuit_resource_uri: The reference to the ExpressRoute circuit resource using the + authorization. + :vartype circuit_resource_uri: str + :ivar provisioning_state: The provisioning state of the authorization resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "authorization_key": {"readonly": True}, + "authorization_use_status": {"readonly": True}, + "circuit_resource_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "authorization_use_status": {"key": "properties.authorizationUseStatus", "type": "str"}, + "circuit_resource_uri": {"key": "properties.circuitResourceUri", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.authorization_key = None + self.authorization_use_status = None + self.circuit_resource_uri = None + self.provisioning_state = None + + +class ExpressRoutePortAuthorizationListResult(_serialization.Model): + """Response for ListExpressRoutePortAuthorizations API service call. + + :ivar value: The authorizations in an ExpressRoute Port. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRoutePortAuthorization]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRoutePortAuthorization"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The authorizations in an ExpressRoute Port. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRoutePortListResult(_serialization.Model): + """Response for ListExpressRoutePorts API service call. + + :ivar value: A list of ExpressRoutePort resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRoutePort]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRoutePort"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of ExpressRoutePort resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRoutePortsLocation(Resource): + """Definition of the ExpressRoutePorts peering location resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar address: Address of peering location. + :vartype address: str + :ivar contact: Contact details of peering locations. + :vartype contact: str + :ivar available_bandwidths: The inventory of available ExpressRoutePort bandwidths. + :vartype available_bandwidths: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocationBandwidths] + :ivar provisioning_state: The provisioning state of the express route port location resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "address": {"readonly": True}, + "contact": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "address": {"key": "properties.address", "type": "str"}, + "contact": {"key": "properties.contact", "type": "str"}, + "available_bandwidths": { + "key": "properties.availableBandwidths", + "type": "[ExpressRoutePortsLocationBandwidths]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + available_bandwidths: Optional[List["_models.ExpressRoutePortsLocationBandwidths"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword available_bandwidths: The inventory of available ExpressRoutePort bandwidths. + :paramtype available_bandwidths: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocationBandwidths] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.address = None + self.contact = None + self.available_bandwidths = available_bandwidths + self.provisioning_state = None + + +class ExpressRoutePortsLocationBandwidths(_serialization.Model): + """Real-time inventory of available ExpressRoute port bandwidths. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar offer_name: Bandwidth descriptive name. + :vartype offer_name: str + :ivar value_in_gbps: Bandwidth value in Gbps. + :vartype value_in_gbps: int + """ + + _validation = { + "offer_name": {"readonly": True}, + "value_in_gbps": {"readonly": True}, + } + + _attribute_map = { + "offer_name": {"key": "offerName", "type": "str"}, + "value_in_gbps": {"key": "valueInGbps", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.offer_name = None + self.value_in_gbps = None + + +class ExpressRoutePortsLocationListResult(_serialization.Model): + """Response for ListExpressRoutePortsLocations API service call. + + :ivar value: The list of all ExpressRoutePort peering locations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRoutePortsLocation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRoutePortsLocation"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of all ExpressRoutePort peering locations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocation] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteProviderPort(Resource): # pylint: disable=too-many-instance-attributes + """ExpressRouteProviderPort resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar port_pair_descriptor: The name of the port pair. + :vartype port_pair_descriptor: str + :ivar primary_azure_port: The name of the primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The name of the secondary port. + :vartype secondary_azure_port: str + :ivar peering_location: The peering location of the port pair. + :vartype peering_location: str + :ivar overprovision_factor: Overprovisioning factor for the port pair. + :vartype overprovision_factor: int + :ivar port_bandwidth_in_mbps: Bandwidth of the port in Mbps. + :vartype port_bandwidth_in_mbps: int + :ivar used_bandwidth_in_mbps: Used Bandwidth of the port in Mbps. + :vartype used_bandwidth_in_mbps: int + :ivar remaining_bandwidth_in_mbps: Remaining Bandwidth of the port in Mbps. + :vartype remaining_bandwidth_in_mbps: int + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "port_pair_descriptor": {"readonly": True}, + "primary_azure_port": {"readonly": True}, + "secondary_azure_port": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "port_pair_descriptor": {"key": "properties.portPairDescriptor", "type": "str"}, + "primary_azure_port": {"key": "properties.primaryAzurePort", "type": "str"}, + "secondary_azure_port": {"key": "properties.secondaryAzurePort", "type": "str"}, + "peering_location": {"key": "properties.peeringLocation", "type": "str"}, + "overprovision_factor": {"key": "properties.overprovisionFactor", "type": "int"}, + "port_bandwidth_in_mbps": {"key": "properties.portBandwidthInMbps", "type": "int"}, + "used_bandwidth_in_mbps": {"key": "properties.usedBandwidthInMbps", "type": "int"}, + "remaining_bandwidth_in_mbps": {"key": "properties.remainingBandwidthInMbps", "type": "int"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + peering_location: Optional[str] = None, + overprovision_factor: Optional[int] = None, + port_bandwidth_in_mbps: Optional[int] = None, + used_bandwidth_in_mbps: Optional[int] = None, + remaining_bandwidth_in_mbps: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword peering_location: The peering location of the port pair. + :paramtype peering_location: str + :keyword overprovision_factor: Overprovisioning factor for the port pair. + :paramtype overprovision_factor: int + :keyword port_bandwidth_in_mbps: Bandwidth of the port in Mbps. + :paramtype port_bandwidth_in_mbps: int + :keyword used_bandwidth_in_mbps: Used Bandwidth of the port in Mbps. + :paramtype used_bandwidth_in_mbps: int + :keyword remaining_bandwidth_in_mbps: Remaining Bandwidth of the port in Mbps. + :paramtype remaining_bandwidth_in_mbps: int + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.port_pair_descriptor = None + self.primary_azure_port = None + self.secondary_azure_port = None + self.peering_location = peering_location + self.overprovision_factor = overprovision_factor + self.port_bandwidth_in_mbps = port_bandwidth_in_mbps + self.used_bandwidth_in_mbps = used_bandwidth_in_mbps + self.remaining_bandwidth_in_mbps = remaining_bandwidth_in_mbps + + +class ExpressRouteProviderPortListResult(_serialization.Model): + """Response for ListExpressRouteProviderPort API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of ExpressRouteProviderPort resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPort] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteProviderPort]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ExpressRouteProviderPort"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of ExpressRouteProviderPort resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPort] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar peering_locations: A list of peering locations. + :vartype peering_locations: list[str] + :ivar bandwidths_offered: A list of bandwidths offered. + :vartype bandwidths_offered: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :ivar provisioning_state: The provisioning state of the express route service provider + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "peering_locations": {"key": "properties.peeringLocations", "type": "[str]"}, + "bandwidths_offered": { + "key": "properties.bandwidthsOffered", + "type": "[ExpressRouteServiceProviderBandwidthsOffered]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + peering_locations: Optional[List[str]] = None, + bandwidths_offered: Optional[List["_models.ExpressRouteServiceProviderBandwidthsOffered"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword peering_locations: A list of peering locations. + :paramtype peering_locations: list[str] + :keyword bandwidths_offered: A list of bandwidths offered. + :paramtype bandwidths_offered: + list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteServiceProviderBandwidthsOffered] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = None + + +class ExpressRouteServiceProviderBandwidthsOffered(_serialization.Model): # pylint: disable=name-too-long + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :ivar offer_name: The OfferName. + :vartype offer_name: str + :ivar value_in_mbps: The ValueInMbps. + :vartype value_in_mbps: int + """ + + _attribute_map = { + "offer_name": {"key": "offerName", "type": "str"}, + "value_in_mbps": {"key": "valueInMbps", "type": "int"}, + } + + def __init__(self, *, offer_name: Optional[str] = None, value_in_mbps: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword offer_name: The OfferName. + :paramtype offer_name: str + :keyword value_in_mbps: The ValueInMbps. + :paramtype value_in_mbps: int + """ + super().__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps + + +class ExpressRouteServiceProviderListResult(_serialization.Model): + """Response for the ListExpressRouteServiceProvider API service call. + + :ivar value: A list of ExpressRouteResourceProvider resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteServiceProvider] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ExpressRouteServiceProvider]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ExpressRouteServiceProvider"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of ExpressRouteResourceProvider resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteServiceProvider] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExtendedLocation(_serialization.Model): + """ExtendedLocation complex type. + + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. "EdgeZone" + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. "EdgeZone" + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + +class FilterItems(_serialization.Model): + """Will contain the filter name and values to operate on. + + :ivar field: The name of the field we would like to filter. + :vartype field: str + :ivar values: List of values to filter the current field by. + :vartype values: list[str] + """ + + _attribute_map = { + "field": {"key": "field", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, + } + + def __init__(self, *, field: Optional[str] = None, values: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword field: The name of the field we would like to filter. + :paramtype field: str + :keyword values: List of values to filter the current field by. + :paramtype values: list[str] + """ + super().__init__(**kwargs) + self.field = field + self.values = values + + +class FirewallPacketCaptureParameters(SubResource): + """Azure Firewall Packet Capture Parameters resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar duration_in_seconds: Duration of packet capture in seconds. + :vartype duration_in_seconds: int + :ivar number_of_packets_to_capture: Number of packets to be captured. + :vartype number_of_packets_to_capture: int + :ivar sas_url: Upload capture location. + :vartype sas_url: str + :ivar file_name: Name of file to be uploaded to sasURL. + :vartype file_name: str + :ivar protocol: The protocol of packets to capture. Known values are: "TCP", "UDP", "Any", and + "ICMP". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleProtocol + :ivar flags: The tcp-flag type to be captured. Used with protocol TCP. + :vartype flags: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallPacketCaptureFlags] + :ivar filters: Rules to filter packet captures. + :vartype filters: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallPacketCaptureRule] + """ + + _validation = { + "duration_in_seconds": {"maximum": 1800, "minimum": 30}, + "number_of_packets_to_capture": {"maximum": 90000, "minimum": 100}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "duration_in_seconds": {"key": "properties.durationInSeconds", "type": "int"}, + "number_of_packets_to_capture": {"key": "properties.numberOfPacketsToCapture", "type": "int"}, + "sas_url": {"key": "properties.sasUrl", "type": "str"}, + "file_name": {"key": "properties.fileName", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "flags": {"key": "properties.flags", "type": "[AzureFirewallPacketCaptureFlags]"}, + "filters": {"key": "properties.filters", "type": "[AzureFirewallPacketCaptureRule]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + duration_in_seconds: Optional[int] = None, + number_of_packets_to_capture: Optional[int] = None, + sas_url: Optional[str] = None, + file_name: Optional[str] = None, + protocol: Optional[Union[str, "_models.AzureFirewallNetworkRuleProtocol"]] = None, + flags: Optional[List["_models.AzureFirewallPacketCaptureFlags"]] = None, + filters: Optional[List["_models.AzureFirewallPacketCaptureRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword duration_in_seconds: Duration of packet capture in seconds. + :paramtype duration_in_seconds: int + :keyword number_of_packets_to_capture: Number of packets to be captured. + :paramtype number_of_packets_to_capture: int + :keyword sas_url: Upload capture location. + :paramtype sas_url: str + :keyword file_name: Name of file to be uploaded to sasURL. + :paramtype file_name: str + :keyword protocol: The protocol of packets to capture. Known values are: "TCP", "UDP", "Any", + and "ICMP". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallNetworkRuleProtocol + :keyword flags: The tcp-flag type to be captured. Used with protocol TCP. + :paramtype flags: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallPacketCaptureFlags] + :keyword filters: Rules to filter packet captures. + :paramtype filters: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallPacketCaptureRule] + """ + super().__init__(id=id, **kwargs) + self.duration_in_seconds = duration_in_seconds + self.number_of_packets_to_capture = number_of_packets_to_capture + self.sas_url = sas_url + self.file_name = file_name + self.protocol = protocol + self.flags = flags + self.filters = filters + + +class FirewallPolicy(Resource): # pylint: disable=too-many-instance-attributes + """FirewallPolicy Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar identity: The identity of the firewall policy. + :vartype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :ivar size: A read-only string that represents the size of the FirewallPolicyPropertiesFormat + in MB. (ex 0.5MB). + :vartype size: str + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the firewall policy resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar base_policy: The parent firewall policy from which rules are inherited. + :vartype base_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar firewalls: List of references to Azure Firewalls that this Firewall Policy is associated + with. + :vartype firewalls: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar threat_intel_mode: The operation mode for Threat Intelligence. Known values are: "Alert", + "Deny", and "Off". + :vartype threat_intel_mode: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallThreatIntelMode + :ivar threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :vartype threat_intel_whitelist: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyThreatIntelWhitelist + :ivar insights: Insights on Firewall Policy. + :vartype insights: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyInsights + :ivar snat: The private IP addresses/IP ranges to which traffic will not be SNAT. + :vartype snat: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySNAT + :ivar sql: SQL Settings definition. + :vartype sql: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySQL + :ivar dns_settings: DNS Proxy Settings definition. + :vartype dns_settings: ~azure.mgmt.network.v2023_09_01.models.DnsSettings + :ivar explicit_proxy: Explicit Proxy Settings definition. + :vartype explicit_proxy: ~azure.mgmt.network.v2023_09_01.models.ExplicitProxy + :ivar intrusion_detection: The configuration for Intrusion detection. + :vartype intrusion_detection: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetection + :ivar transport_security: TLS Configuration definition. + :vartype transport_security: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyTransportSecurity + :ivar sku: The Firewall Policy SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySku + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "size": {"readonly": True}, + "rule_collection_groups": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "firewalls": {"readonly": True}, + "child_policies": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "size": {"key": "properties.size", "type": "str"}, + "rule_collection_groups": {"key": "properties.ruleCollectionGroups", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "base_policy": {"key": "properties.basePolicy", "type": "SubResource"}, + "firewalls": {"key": "properties.firewalls", "type": "[SubResource]"}, + "child_policies": {"key": "properties.childPolicies", "type": "[SubResource]"}, + "threat_intel_mode": {"key": "properties.threatIntelMode", "type": "str"}, + "threat_intel_whitelist": { + "key": "properties.threatIntelWhitelist", + "type": "FirewallPolicyThreatIntelWhitelist", + }, + "insights": {"key": "properties.insights", "type": "FirewallPolicyInsights"}, + "snat": {"key": "properties.snat", "type": "FirewallPolicySNAT"}, + "sql": {"key": "properties.sql", "type": "FirewallPolicySQL"}, + "dns_settings": {"key": "properties.dnsSettings", "type": "DnsSettings"}, + "explicit_proxy": {"key": "properties.explicitProxy", "type": "ExplicitProxy"}, + "intrusion_detection": {"key": "properties.intrusionDetection", "type": "FirewallPolicyIntrusionDetection"}, + "transport_security": {"key": "properties.transportSecurity", "type": "FirewallPolicyTransportSecurity"}, + "sku": {"key": "properties.sku", "type": "FirewallPolicySku"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + base_policy: Optional["_models.SubResource"] = None, + threat_intel_mode: Optional[Union[str, "_models.AzureFirewallThreatIntelMode"]] = None, + threat_intel_whitelist: Optional["_models.FirewallPolicyThreatIntelWhitelist"] = None, + insights: Optional["_models.FirewallPolicyInsights"] = None, + snat: Optional["_models.FirewallPolicySNAT"] = None, + sql: Optional["_models.FirewallPolicySQL"] = None, + dns_settings: Optional["_models.DnsSettings"] = None, + explicit_proxy: Optional["_models.ExplicitProxy"] = None, + intrusion_detection: Optional["_models.FirewallPolicyIntrusionDetection"] = None, + transport_security: Optional["_models.FirewallPolicyTransportSecurity"] = None, + sku: Optional["_models.FirewallPolicySku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the firewall policy. + :paramtype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :keyword base_policy: The parent firewall policy from which rules are inherited. + :paramtype base_policy: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword threat_intel_mode: The operation mode for Threat Intelligence. Known values are: + "Alert", "Deny", and "Off". + :paramtype threat_intel_mode: str or + ~azure.mgmt.network.v2023_09_01.models.AzureFirewallThreatIntelMode + :keyword threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :paramtype threat_intel_whitelist: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyThreatIntelWhitelist + :keyword insights: Insights on Firewall Policy. + :paramtype insights: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyInsights + :keyword snat: The private IP addresses/IP ranges to which traffic will not be SNAT. + :paramtype snat: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySNAT + :keyword sql: SQL Settings definition. + :paramtype sql: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySQL + :keyword dns_settings: DNS Proxy Settings definition. + :paramtype dns_settings: ~azure.mgmt.network.v2023_09_01.models.DnsSettings + :keyword explicit_proxy: Explicit Proxy Settings definition. + :paramtype explicit_proxy: ~azure.mgmt.network.v2023_09_01.models.ExplicitProxy + :keyword intrusion_detection: The configuration for Intrusion detection. + :paramtype intrusion_detection: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetection + :keyword transport_security: TLS Configuration definition. + :paramtype transport_security: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyTransportSecurity + :keyword sku: The Firewall Policy SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySku + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.identity = identity + self.size = None + self.rule_collection_groups = None + self.provisioning_state = None + self.base_policy = base_policy + self.firewalls = None + self.child_policies = None + self.threat_intel_mode = threat_intel_mode + self.threat_intel_whitelist = threat_intel_whitelist + self.insights = insights + self.snat = snat + self.sql = sql + self.dns_settings = dns_settings + self.explicit_proxy = explicit_proxy + self.intrusion_detection = intrusion_detection + self.transport_security = transport_security + self.sku = sku + + +class FirewallPolicyCertificateAuthority(_serialization.Model): + """Trusted Root certificates properties for tls. + + :ivar key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :vartype key_vault_secret_id: str + :ivar name: Name of the CA certificate. + :vartype name: str + """ + + _attribute_map = { + "key_vault_secret_id": {"key": "keyVaultSecretId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, key_vault_secret_id: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :paramtype key_vault_secret_id: str + :keyword name: Name of the CA certificate. + :paramtype name: str + """ + super().__init__(**kwargs) + self.key_vault_secret_id = key_vault_secret_id + self.name = name + + +class FirewallPolicyRuleCollection(_serialization.Model): + """Properties of the rule collection. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FirewallPolicyFilterRuleCollection, FirewallPolicyNatRuleCollection + + All required parameters must be populated in order to send to server. + + :ivar rule_collection_type: The type of the rule collection. Required. Known values are: + "FirewallPolicyNatRuleCollection" and "FirewallPolicyFilterRuleCollection". + :vartype rule_collection_type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionType + :ivar name: The name of the rule collection. + :vartype name: str + :ivar priority: Priority of the Firewall Policy Rule Collection resource. + :vartype priority: int + """ + + _validation = { + "rule_collection_type": {"required": True}, + "priority": {"maximum": 65000, "minimum": 100}, + } + + _attribute_map = { + "rule_collection_type": {"key": "ruleCollectionType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, + } + + _subtype_map = { + "rule_collection_type": { + "FirewallPolicyFilterRuleCollection": "FirewallPolicyFilterRuleCollection", + "FirewallPolicyNatRuleCollection": "FirewallPolicyNatRuleCollection", + } + } + + def __init__(self, *, name: Optional[str] = None, priority: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword name: The name of the rule collection. + :paramtype name: str + :keyword priority: Priority of the Firewall Policy Rule Collection resource. + :paramtype priority: int + """ + super().__init__(**kwargs) + self.rule_collection_type: Optional[str] = None + self.name = name + self.priority = priority + + +class FirewallPolicyFilterRuleCollection(FirewallPolicyRuleCollection): + """Firewall Policy Filter Rule Collection. + + All required parameters must be populated in order to send to server. + + :ivar rule_collection_type: The type of the rule collection. Required. Known values are: + "FirewallPolicyNatRuleCollection" and "FirewallPolicyFilterRuleCollection". + :vartype rule_collection_type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionType + :ivar name: The name of the rule collection. + :vartype name: str + :ivar priority: Priority of the Firewall Policy Rule Collection resource. + :vartype priority: int + :ivar action: The action type of a Filter rule collection. + :vartype action: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyFilterRuleCollectionAction + :ivar rules: List of rules included in a rule collection. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRule] + """ + + _validation = { + "rule_collection_type": {"required": True}, + "priority": {"maximum": 65000, "minimum": 100}, + } + + _attribute_map = { + "rule_collection_type": {"key": "ruleCollectionType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, + "action": {"key": "action", "type": "FirewallPolicyFilterRuleCollectionAction"}, + "rules": {"key": "rules", "type": "[FirewallPolicyRule]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["_models.FirewallPolicyFilterRuleCollectionAction"] = None, + rules: Optional[List["_models.FirewallPolicyRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the rule collection. + :paramtype name: str + :keyword priority: Priority of the Firewall Policy Rule Collection resource. + :paramtype priority: int + :keyword action: The action type of a Filter rule collection. + :paramtype action: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyFilterRuleCollectionAction + :keyword rules: List of rules included in a rule collection. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRule] + """ + super().__init__(name=name, priority=priority, **kwargs) + self.rule_collection_type: str = "FirewallPolicyFilterRuleCollection" + self.action = action + self.rules = rules + + +class FirewallPolicyFilterRuleCollectionAction(_serialization.Model): + """Properties of the FirewallPolicyFilterRuleCollectionAction. + + :ivar type: The type of action. Known values are: "Allow" and "Deny". + :vartype type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyFilterRuleCollectionActionType + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.FirewallPolicyFilterRuleCollectionActionType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: The type of action. Known values are: "Allow" and "Deny". + :paramtype type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyFilterRuleCollectionActionType + """ + super().__init__(**kwargs) + self.type = type + + +class FirewallPolicyHttpHeaderToInsert(_serialization.Model): + """name and value of HTTP/S header to insert. + + :ivar header_name: Contains the name of the header. + :vartype header_name: str + :ivar header_value: Contains the value of the header. + :vartype header_value: str + """ + + _attribute_map = { + "header_name": {"key": "headerName", "type": "str"}, + "header_value": {"key": "headerValue", "type": "str"}, + } + + def __init__(self, *, header_name: Optional[str] = None, header_value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword header_name: Contains the name of the header. + :paramtype header_name: str + :keyword header_value: Contains the value of the header. + :paramtype header_value: str + """ + super().__init__(**kwargs) + self.header_name = header_name + self.header_value = header_value + + +class FirewallPolicyInsights(_serialization.Model): + """Firewall Policy Insights. + + :ivar is_enabled: A flag to indicate if the insights are enabled on the policy. + :vartype is_enabled: bool + :ivar retention_days: Number of days the insights should be enabled on the policy. + :vartype retention_days: int + :ivar log_analytics_resources: Workspaces needed to configure the Firewall Policy Insights. + :vartype log_analytics_resources: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyLogAnalyticsResources + """ + + _attribute_map = { + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "retention_days": {"key": "retentionDays", "type": "int"}, + "log_analytics_resources": {"key": "logAnalyticsResources", "type": "FirewallPolicyLogAnalyticsResources"}, + } + + def __init__( + self, + *, + is_enabled: Optional[bool] = None, + retention_days: Optional[int] = None, + log_analytics_resources: Optional["_models.FirewallPolicyLogAnalyticsResources"] = None, + **kwargs: Any + ) -> None: + """ + :keyword is_enabled: A flag to indicate if the insights are enabled on the policy. + :paramtype is_enabled: bool + :keyword retention_days: Number of days the insights should be enabled on the policy. + :paramtype retention_days: int + :keyword log_analytics_resources: Workspaces needed to configure the Firewall Policy Insights. + :paramtype log_analytics_resources: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyLogAnalyticsResources + """ + super().__init__(**kwargs) + self.is_enabled = is_enabled + self.retention_days = retention_days + self.log_analytics_resources = log_analytics_resources + + +class FirewallPolicyIntrusionDetection(_serialization.Model): + """Configuration for intrusion detection mode and rules. + + :ivar mode: Intrusion detection general state. When attached to a parent policy, the firewall's + effective IDPS mode is the stricter mode of the two. Known values are: "Off", "Alert", and + "Deny". + :vartype mode: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionStateType + :ivar profile: IDPS profile name. When attached to a parent policy, the firewall's effective + profile is the profile name of the parent policy. Known values are: "Basic", "Standard", + "Advanced", and "Extended". + :vartype profile: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionProfileType + :ivar configuration: Intrusion detection configuration properties. + :vartype configuration: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionConfiguration + """ + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "profile": {"key": "profile", "type": "str"}, + "configuration": {"key": "configuration", "type": "FirewallPolicyIntrusionDetectionConfiguration"}, + } + + def __init__( + self, + *, + mode: Optional[Union[str, "_models.FirewallPolicyIntrusionDetectionStateType"]] = None, + profile: Optional[Union[str, "_models.FirewallPolicyIntrusionDetectionProfileType"]] = None, + configuration: Optional["_models.FirewallPolicyIntrusionDetectionConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword mode: Intrusion detection general state. When attached to a parent policy, the + firewall's effective IDPS mode is the stricter mode of the two. Known values are: "Off", + "Alert", and "Deny". + :paramtype mode: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionStateType + :keyword profile: IDPS profile name. When attached to a parent policy, the firewall's effective + profile is the profile name of the parent policy. Known values are: "Basic", "Standard", + "Advanced", and "Extended". + :paramtype profile: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionProfileType + :keyword configuration: Intrusion detection configuration properties. + :paramtype configuration: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionConfiguration + """ + super().__init__(**kwargs) + self.mode = mode + self.profile = profile + self.configuration = configuration + + +class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications( + _serialization.Model +): # pylint: disable=name-too-long + """Intrusion detection bypass traffic specification. + + :ivar name: Name of the bypass traffic rule. + :vartype name: str + :ivar description: Description of the bypass traffic rule. + :vartype description: str + :ivar protocol: The rule bypass protocol. Known values are: "TCP", "UDP", "ICMP", and "ANY". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionProtocol + :ivar source_addresses: List of source IP addresses or ranges for this rule. + :vartype source_addresses: list[str] + :ivar destination_addresses: List of destination IP addresses or ranges for this rule. + :vartype destination_addresses: list[str] + :ivar destination_ports: List of destination ports or ranges. + :vartype destination_ports: list[str] + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + :ivar destination_ip_groups: List of destination IpGroups for this rule. + :vartype destination_ip_groups: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "destination_addresses": {"key": "destinationAddresses", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + "destination_ip_groups": {"key": "destinationIpGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + protocol: Optional[Union[str, "_models.FirewallPolicyIntrusionDetectionProtocol"]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + destination_ip_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the bypass traffic rule. + :paramtype name: str + :keyword description: Description of the bypass traffic rule. + :paramtype description: str + :keyword protocol: The rule bypass protocol. Known values are: "TCP", "UDP", "ICMP", and "ANY". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionProtocol + :keyword source_addresses: List of source IP addresses or ranges for this rule. + :paramtype source_addresses: list[str] + :keyword destination_addresses: List of destination IP addresses or ranges for this rule. + :paramtype destination_addresses: list[str] + :keyword destination_ports: List of destination ports or ranges. + :paramtype destination_ports: list[str] + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + :keyword destination_ip_groups: List of destination IpGroups for this rule. + :paramtype destination_ip_groups: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.description = description + self.protocol = protocol + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.source_ip_groups = source_ip_groups + self.destination_ip_groups = destination_ip_groups + + +class FirewallPolicyIntrusionDetectionConfiguration(_serialization.Model): # pylint: disable=name-too-long + """The operation for configuring intrusion detection. + + :ivar signature_overrides: List of specific signatures states. + :vartype signature_overrides: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionSignatureSpecification] + :ivar bypass_traffic_settings: List of rules for traffic to bypass. + :vartype bypass_traffic_settings: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications] + :ivar private_ranges: IDPS Private IP address ranges are used to identify traffic direction + (i.e. inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered + private IP addresses. To modify default ranges, specify your Private IP address ranges with + this property. + :vartype private_ranges: list[str] + """ + + _attribute_map = { + "signature_overrides": { + "key": "signatureOverrides", + "type": "[FirewallPolicyIntrusionDetectionSignatureSpecification]", + }, + "bypass_traffic_settings": { + "key": "bypassTrafficSettings", + "type": "[FirewallPolicyIntrusionDetectionBypassTrafficSpecifications]", + }, + "private_ranges": {"key": "privateRanges", "type": "[str]"}, + } + + def __init__( + self, + *, + signature_overrides: Optional[List["_models.FirewallPolicyIntrusionDetectionSignatureSpecification"]] = None, + bypass_traffic_settings: Optional[ + List["_models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications"] + ] = None, + private_ranges: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword signature_overrides: List of specific signatures states. + :paramtype signature_overrides: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionSignatureSpecification] + :keyword bypass_traffic_settings: List of rules for traffic to bypass. + :paramtype bypass_traffic_settings: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications] + :keyword private_ranges: IDPS Private IP address ranges are used to identify traffic direction + (i.e. inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered + private IP addresses. To modify default ranges, specify your Private IP address ranges with + this property. + :paramtype private_ranges: list[str] + """ + super().__init__(**kwargs) + self.signature_overrides = signature_overrides + self.bypass_traffic_settings = bypass_traffic_settings + self.private_ranges = private_ranges + + +class FirewallPolicyIntrusionDetectionSignatureSpecification(_serialization.Model): # pylint: disable=name-too-long + """Intrusion detection signatures specification states. + + :ivar id: Signature id. + :vartype id: str + :ivar mode: The signature state. Known values are: "Off", "Alert", and "Deny". + :vartype mode: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionStateType + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + mode: Optional[Union[str, "_models.FirewallPolicyIntrusionDetectionStateType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Signature id. + :paramtype id: str + :keyword mode: The signature state. Known values are: "Off", "Alert", and "Deny". + :paramtype mode: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIntrusionDetectionStateType + """ + super().__init__(**kwargs) + self.id = id + self.mode = mode + + +class FirewallPolicyListResult(_serialization.Model): + """Response for ListFirewallPolicies API service call. + + :ivar value: List of Firewall Policies in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[FirewallPolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.FirewallPolicy"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of Firewall Policies in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class FirewallPolicyLogAnalyticsResources(_serialization.Model): + """Log Analytics Resources for Firewall Policy Insights. + + :ivar workspaces: List of workspaces for Firewall Policy Insights. + :vartype workspaces: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyLogAnalyticsWorkspace] + :ivar default_workspace_id: The default workspace Id for Firewall Policy Insights. + :vartype default_workspace_id: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "workspaces": {"key": "workspaces", "type": "[FirewallPolicyLogAnalyticsWorkspace]"}, + "default_workspace_id": {"key": "defaultWorkspaceId", "type": "SubResource"}, + } + + def __init__( + self, + *, + workspaces: Optional[List["_models.FirewallPolicyLogAnalyticsWorkspace"]] = None, + default_workspace_id: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword workspaces: List of workspaces for Firewall Policy Insights. + :paramtype workspaces: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyLogAnalyticsWorkspace] + :keyword default_workspace_id: The default workspace Id for Firewall Policy Insights. + :paramtype default_workspace_id: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.workspaces = workspaces + self.default_workspace_id = default_workspace_id + + +class FirewallPolicyLogAnalyticsWorkspace(_serialization.Model): + """Log Analytics Workspace for Firewall Policy Insights. + + :ivar region: Region to configure the Workspace. + :vartype region: str + :ivar workspace_id: The workspace Id for Firewall Policy Insights. + :vartype workspace_id: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "region": {"key": "region", "type": "str"}, + "workspace_id": {"key": "workspaceId", "type": "SubResource"}, + } + + def __init__( + self, *, region: Optional[str] = None, workspace_id: Optional["_models.SubResource"] = None, **kwargs: Any + ) -> None: + """ + :keyword region: Region to configure the Workspace. + :paramtype region: str + :keyword workspace_id: The workspace Id for Firewall Policy Insights. + :paramtype workspace_id: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.region = region + self.workspace_id = workspace_id + + +class FirewallPolicyNatRuleCollection(FirewallPolicyRuleCollection): + """Firewall Policy NAT Rule Collection. + + All required parameters must be populated in order to send to server. + + :ivar rule_collection_type: The type of the rule collection. Required. Known values are: + "FirewallPolicyNatRuleCollection" and "FirewallPolicyFilterRuleCollection". + :vartype rule_collection_type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionType + :ivar name: The name of the rule collection. + :vartype name: str + :ivar priority: Priority of the Firewall Policy Rule Collection resource. + :vartype priority: int + :ivar action: The action type of a Nat rule collection. + :vartype action: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyNatRuleCollectionAction + :ivar rules: List of rules included in a rule collection. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRule] + """ + + _validation = { + "rule_collection_type": {"required": True}, + "priority": {"maximum": 65000, "minimum": 100}, + } + + _attribute_map = { + "rule_collection_type": {"key": "ruleCollectionType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, + "action": {"key": "action", "type": "FirewallPolicyNatRuleCollectionAction"}, + "rules": {"key": "rules", "type": "[FirewallPolicyRule]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["_models.FirewallPolicyNatRuleCollectionAction"] = None, + rules: Optional[List["_models.FirewallPolicyRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the rule collection. + :paramtype name: str + :keyword priority: Priority of the Firewall Policy Rule Collection resource. + :paramtype priority: int + :keyword action: The action type of a Nat rule collection. + :paramtype action: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyNatRuleCollectionAction + :keyword rules: List of rules included in a rule collection. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRule] + """ + super().__init__(name=name, priority=priority, **kwargs) + self.rule_collection_type: str = "FirewallPolicyNatRuleCollection" + self.action = action + self.rules = rules + + +class FirewallPolicyNatRuleCollectionAction(_serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + :ivar type: The type of action. "DNAT" + :vartype type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyNatRuleCollectionActionType + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, *, type: Optional[Union[str, "_models.FirewallPolicyNatRuleCollectionActionType"]] = None, **kwargs: Any + ) -> None: + """ + :keyword type: The type of action. "DNAT" + :paramtype type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyNatRuleCollectionActionType + """ + super().__init__(**kwargs) + self.type = type + + +class FirewallPolicyRuleApplicationProtocol(_serialization.Model): + """Properties of the application rule protocol. + + :ivar protocol_type: Protocol type. Known values are: "Http" and "Https". + :vartype protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleApplicationProtocolType + :ivar port: Port number for the protocol, cannot be greater than 64000. + :vartype port: int + """ + + _validation = { + "port": {"maximum": 64000, "minimum": 0}, + } + + _attribute_map = { + "protocol_type": {"key": "protocolType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__( + self, + *, + protocol_type: Optional[Union[str, "_models.FirewallPolicyRuleApplicationProtocolType"]] = None, + port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword protocol_type: Protocol type. Known values are: "Http" and "Https". + :paramtype protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleApplicationProtocolType + :keyword port: Port number for the protocol, cannot be greater than 64000. + :paramtype port: int + """ + super().__init__(**kwargs) + self.protocol_type = protocol_type + self.port = port + + +class FirewallPolicyRuleCollectionGroup(SubResource): + """Rule Collection Group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Rule Group type. + :vartype type: str + :ivar size: A read-only string that represents the size of the + FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + :vartype size: str + :ivar priority: Priority of the Firewall Policy Rule Collection Group resource. + :vartype priority: int + :ivar rule_collections: Group of Firewall Policy rule collections. + :vartype rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollection] + :ivar provisioning_state: The provisioning state of the firewall policy rule collection group + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "size": {"readonly": True}, + "priority": {"maximum": 65000, "minimum": 100}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "size": {"key": "properties.size", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "rule_collections": {"key": "properties.ruleCollections", "type": "[FirewallPolicyRuleCollection]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + priority: Optional[int] = None, + rule_collections: Optional[List["_models.FirewallPolicyRuleCollection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword priority: Priority of the Firewall Policy Rule Collection Group resource. + :paramtype priority: int + :keyword rule_collections: Group of Firewall Policy rule collections. + :paramtype rule_collections: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollection] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.size = None + self.priority = priority + self.rule_collections = rule_collections + self.provisioning_state = None + + +class FirewallPolicyRuleCollectionGroupListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListFirewallPolicyRuleCollectionGroups API service call. + + :ivar value: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[FirewallPolicyRuleCollectionGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.FirewallPolicyRuleCollectionGroup"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class FirewallPolicySku(_serialization.Model): + """SKU of Firewall policy. + + :ivar tier: Tier of Firewall Policy. Known values are: "Standard", "Premium", and "Basic". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySkuTier + """ + + _attribute_map = { + "tier": {"key": "tier", "type": "str"}, + } + + def __init__(self, *, tier: Optional[Union[str, "_models.FirewallPolicySkuTier"]] = None, **kwargs: Any) -> None: + """ + :keyword tier: Tier of Firewall Policy. Known values are: "Standard", "Premium", and "Basic". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicySkuTier + """ + super().__init__(**kwargs) + self.tier = tier + + +class FirewallPolicySNAT(_serialization.Model): + """The private IP addresses/IP ranges to which traffic will not be SNAT. + + :ivar private_ranges: List of private IP addresses/IP address ranges to not be SNAT. + :vartype private_ranges: list[str] + :ivar auto_learn_private_ranges: The operation mode for automatically learning private ranges + to not be SNAT. Known values are: "Enabled" and "Disabled". + :vartype auto_learn_private_ranges: str or + ~azure.mgmt.network.v2023_09_01.models.AutoLearnPrivateRangesMode + """ + + _attribute_map = { + "private_ranges": {"key": "privateRanges", "type": "[str]"}, + "auto_learn_private_ranges": {"key": "autoLearnPrivateRanges", "type": "str"}, + } + + def __init__( + self, + *, + private_ranges: Optional[List[str]] = None, + auto_learn_private_ranges: Optional[Union[str, "_models.AutoLearnPrivateRangesMode"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword private_ranges: List of private IP addresses/IP address ranges to not be SNAT. + :paramtype private_ranges: list[str] + :keyword auto_learn_private_ranges: The operation mode for automatically learning private + ranges to not be SNAT. Known values are: "Enabled" and "Disabled". + :paramtype auto_learn_private_ranges: str or + ~azure.mgmt.network.v2023_09_01.models.AutoLearnPrivateRangesMode + """ + super().__init__(**kwargs) + self.private_ranges = private_ranges + self.auto_learn_private_ranges = auto_learn_private_ranges + + +class FirewallPolicySQL(_serialization.Model): + """SQL Settings in Firewall Policy. + + :ivar allow_sql_redirect: A flag to indicate if SQL Redirect traffic filtering is enabled. + Turning on the flag requires no rule using port 11000-11999. + :vartype allow_sql_redirect: bool + """ + + _attribute_map = { + "allow_sql_redirect": {"key": "allowSqlRedirect", "type": "bool"}, + } + + def __init__(self, *, allow_sql_redirect: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword allow_sql_redirect: A flag to indicate if SQL Redirect traffic filtering is enabled. + Turning on the flag requires no rule using port 11000-11999. + :paramtype allow_sql_redirect: bool + """ + super().__init__(**kwargs) + self.allow_sql_redirect = allow_sql_redirect + + +class FirewallPolicyThreatIntelWhitelist(_serialization.Model): + """ThreatIntel Whitelist for Firewall Policy. + + :ivar ip_addresses: List of IP addresses for the ThreatIntel Whitelist. + :vartype ip_addresses: list[str] + :ivar fqdns: List of FQDNs for the ThreatIntel Whitelist. + :vartype fqdns: list[str] + """ + + _attribute_map = { + "ip_addresses": {"key": "ipAddresses", "type": "[str]"}, + "fqdns": {"key": "fqdns", "type": "[str]"}, + } + + def __init__( + self, *, ip_addresses: Optional[List[str]] = None, fqdns: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword ip_addresses: List of IP addresses for the ThreatIntel Whitelist. + :paramtype ip_addresses: list[str] + :keyword fqdns: List of FQDNs for the ThreatIntel Whitelist. + :paramtype fqdns: list[str] + """ + super().__init__(**kwargs) + self.ip_addresses = ip_addresses + self.fqdns = fqdns + + +class FirewallPolicyTransportSecurity(_serialization.Model): + """Configuration needed to perform TLS termination & initiation. + + :ivar certificate_authority: The CA used for intermediate CA generation. + :vartype certificate_authority: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyCertificateAuthority + """ + + _attribute_map = { + "certificate_authority": {"key": "certificateAuthority", "type": "FirewallPolicyCertificateAuthority"}, + } + + def __init__( + self, *, certificate_authority: Optional["_models.FirewallPolicyCertificateAuthority"] = None, **kwargs: Any + ) -> None: + """ + :keyword certificate_authority: The CA used for intermediate CA generation. + :paramtype certificate_authority: + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyCertificateAuthority + """ + super().__init__(**kwargs) + self.certificate_authority = certificate_authority + + +class FlowLog(Resource): # pylint: disable=too-many-instance-attributes + """A flow log resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar target_resource_id: ID of network security group to which flow log will be applied. + :vartype target_resource_id: str + :ivar target_resource_guid: Guid of network security group to which flow log will be applied. + :vartype target_resource_guid: str + :ivar storage_id: ID of the storage account which is used to store the flow log. + :vartype storage_id: str + :ivar enabled: Flag to enable/disable flow logging. + :vartype enabled: bool + :ivar retention_policy: Parameters that define the retention policy for flow log. + :vartype retention_policy: ~azure.mgmt.network.v2023_09_01.models.RetentionPolicyParameters + :ivar format: Parameters that define the flow log format. + :vartype format: ~azure.mgmt.network.v2023_09_01.models.FlowLogFormatParameters + :ivar flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :vartype flow_analytics_configuration: + ~azure.mgmt.network.v2023_09_01.models.TrafficAnalyticsProperties + :ivar provisioning_state: The provisioning state of the flow log. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "target_resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "target_resource_id": {"key": "properties.targetResourceId", "type": "str"}, + "target_resource_guid": {"key": "properties.targetResourceGuid", "type": "str"}, + "storage_id": {"key": "properties.storageId", "type": "str"}, + "enabled": {"key": "properties.enabled", "type": "bool"}, + "retention_policy": {"key": "properties.retentionPolicy", "type": "RetentionPolicyParameters"}, + "format": {"key": "properties.format", "type": "FlowLogFormatParameters"}, + "flow_analytics_configuration": { + "key": "properties.flowAnalyticsConfiguration", + "type": "TrafficAnalyticsProperties", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + target_resource_id: Optional[str] = None, + storage_id: Optional[str] = None, + enabled: Optional[bool] = None, + retention_policy: Optional["_models.RetentionPolicyParameters"] = None, + format: Optional["_models.FlowLogFormatParameters"] = None, + flow_analytics_configuration: Optional["_models.TrafficAnalyticsProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword target_resource_id: ID of network security group to which flow log will be applied. + :paramtype target_resource_id: str + :keyword storage_id: ID of the storage account which is used to store the flow log. + :paramtype storage_id: str + :keyword enabled: Flag to enable/disable flow logging. + :paramtype enabled: bool + :keyword retention_policy: Parameters that define the retention policy for flow log. + :paramtype retention_policy: ~azure.mgmt.network.v2023_09_01.models.RetentionPolicyParameters + :keyword format: Parameters that define the flow log format. + :paramtype format: ~azure.mgmt.network.v2023_09_01.models.FlowLogFormatParameters + :keyword flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :paramtype flow_analytics_configuration: + ~azure.mgmt.network.v2023_09_01.models.TrafficAnalyticsProperties + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.target_resource_id = target_resource_id + self.target_resource_guid = None + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy + self.format = format + self.flow_analytics_configuration = flow_analytics_configuration + self.provisioning_state = None + + +class FlowLogFormatParameters(_serialization.Model): + """Parameters that define the flow log format. + + :ivar type: The file type of flow log. "JSON" + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.FlowLogFormatType + :ivar version: The version (revision) of the flow log. + :vartype version: int + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "int"}, + } + + def __init__( + self, *, type: Optional[Union[str, "_models.FlowLogFormatType"]] = None, version: int = 0, **kwargs: Any + ) -> None: + """ + :keyword type: The file type of flow log. "JSON" + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.FlowLogFormatType + :keyword version: The version (revision) of the flow log. + :paramtype version: int + """ + super().__init__(**kwargs) + self.type = type + self.version = version + + +class FlowLogInformation(_serialization.Model): + """Information on the configuration of flow log and traffic analytics (optional) . + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The ID of the resource to configure for flow log and traffic + analytics (optional) . Required. + :vartype target_resource_id: str + :ivar flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :vartype flow_analytics_configuration: + ~azure.mgmt.network.v2023_09_01.models.TrafficAnalyticsProperties + :ivar storage_id: ID of the storage account which is used to store the flow log. Required. + :vartype storage_id: str + :ivar enabled: Flag to enable/disable flow logging. Required. + :vartype enabled: bool + :ivar retention_policy: Parameters that define the retention policy for flow log. + :vartype retention_policy: ~azure.mgmt.network.v2023_09_01.models.RetentionPolicyParameters + :ivar format: Parameters that define the flow log format. + :vartype format: ~azure.mgmt.network.v2023_09_01.models.FlowLogFormatParameters + """ + + _validation = { + "target_resource_id": {"required": True}, + "storage_id": {"required": True}, + "enabled": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + "flow_analytics_configuration": {"key": "flowAnalyticsConfiguration", "type": "TrafficAnalyticsProperties"}, + "storage_id": {"key": "properties.storageId", "type": "str"}, + "enabled": {"key": "properties.enabled", "type": "bool"}, + "retention_policy": {"key": "properties.retentionPolicy", "type": "RetentionPolicyParameters"}, + "format": {"key": "properties.format", "type": "FlowLogFormatParameters"}, + } + + def __init__( + self, + *, + target_resource_id: str, + storage_id: str, + enabled: bool, + flow_analytics_configuration: Optional["_models.TrafficAnalyticsProperties"] = None, + retention_policy: Optional["_models.RetentionPolicyParameters"] = None, + format: Optional["_models.FlowLogFormatParameters"] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_resource_id: The ID of the resource to configure for flow log and traffic + analytics (optional) . Required. + :paramtype target_resource_id: str + :keyword flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :paramtype flow_analytics_configuration: + ~azure.mgmt.network.v2023_09_01.models.TrafficAnalyticsProperties + :keyword storage_id: ID of the storage account which is used to store the flow log. Required. + :paramtype storage_id: str + :keyword enabled: Flag to enable/disable flow logging. Required. + :paramtype enabled: bool + :keyword retention_policy: Parameters that define the retention policy for flow log. + :paramtype retention_policy: ~azure.mgmt.network.v2023_09_01.models.RetentionPolicyParameters + :keyword format: Parameters that define the flow log format. + :paramtype format: ~azure.mgmt.network.v2023_09_01.models.FlowLogFormatParameters + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + self.flow_analytics_configuration = flow_analytics_configuration + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy + self.format = format + + +class FlowLogListResult(_serialization.Model): + """List of flow logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Information about flow log resource. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[FlowLog]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.FlowLog"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Information about flow log resource. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.FlowLog] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class FlowLogStatusParameters(_serialization.Model): + """Parameters that define a resource to query flow log and traffic analytics (optional) status. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The target resource where getting the flow log and traffic analytics + (optional) status. Required. + :vartype target_resource_id: str + """ + + _validation = { + "target_resource_id": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + } + + def __init__(self, *, target_resource_id: str, **kwargs: Any) -> None: + """ + :keyword target_resource_id: The target resource where getting the flow log and traffic + analytics (optional) status. Required. + :paramtype target_resource_id: str + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + + +class FrontendIPConfiguration(SubResource): # pylint: disable=too-many-instance-attributes + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of frontend IP + configurations used by the load balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :vartype zones: list[str] + :ivar inbound_nat_rules: An array of references to inbound rules that use this frontend IP. + :vartype inbound_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar inbound_nat_pools: An array of references to inbound pools that use this frontend IP. + :vartype inbound_nat_pools: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar outbound_rules: An array of references to outbound rules that use this frontend IP. + :vartype outbound_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar load_balancing_rules: An array of references to load balancing rules that use this + frontend IP. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar private_ip_address: The private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The Private IP allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar private_ip_address_version: Whether the specific ipconfiguration is IPv4 or IPv6. Default + is taken as IPv4. Known values are: "IPv4" and "IPv6". + :vartype private_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :ivar subnet: The reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar public_ip_address: The reference to the Public IP resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :ivar public_ip_prefix: The reference to the Public IP Prefix resource. + :vartype public_ip_prefix: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar gateway_load_balancer: The reference to gateway load balancer frontend IP. + :vartype gateway_load_balancer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the frontend IP configuration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "inbound_nat_rules": {"readonly": True}, + "inbound_nat_pools": {"readonly": True}, + "outbound_rules": {"readonly": True}, + "load_balancing_rules": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "inbound_nat_rules": {"key": "properties.inboundNatRules", "type": "[SubResource]"}, + "inbound_nat_pools": {"key": "properties.inboundNatPools", "type": "[SubResource]"}, + "outbound_rules": {"key": "properties.outboundRules", "type": "[SubResource]"}, + "load_balancing_rules": {"key": "properties.loadBalancingRules", "type": "[SubResource]"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "private_ip_address_version": {"key": "properties.privateIPAddressVersion", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "PublicIPAddress"}, + "public_ip_prefix": {"key": "properties.publicIPPrefix", "type": "SubResource"}, + "gateway_load_balancer": {"key": "properties.gatewayLoadBalancer", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + zones: Optional[List[str]] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + private_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + subnet: Optional["_models.Subnet"] = None, + public_ip_address: Optional["_models.PublicIPAddress"] = None, + public_ip_prefix: Optional["_models.SubResource"] = None, + gateway_load_balancer: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of frontend IP + configurations used by the load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword zones: A list of availability zones denoting the IP allocated for the resource needs + to come from. + :paramtype zones: list[str] + :keyword private_ip_address: The private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The Private IP allocation method. Known values are: + "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword private_ip_address_version: Whether the specific ipconfiguration is IPv4 or IPv6. + Default is taken as IPv4. Known values are: "IPv4" and "IPv6". + :paramtype private_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :keyword subnet: The reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword public_ip_address: The reference to the Public IP resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :keyword public_ip_prefix: The reference to the Public IP Prefix resource. + :paramtype public_ip_prefix: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword gateway_load_balancer: The reference to gateway load balancer frontend IP. + :paramtype gateway_load_balancer: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.zones = zones + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.public_ip_address = public_ip_address + self.public_ip_prefix = public_ip_prefix + self.gateway_load_balancer = gateway_load_balancer + self.provisioning_state = None + + +class GatewayCustomBgpIpAddressIpConfiguration(_serialization.Model): + """GatewayCustomBgpIpAddressIpConfiguration for a virtual network gateway connection. + + All required parameters must be populated in order to send to server. + + :ivar ip_configuration_id: The IpconfigurationId of ipconfiguration which belongs to gateway. + Required. + :vartype ip_configuration_id: str + :ivar custom_bgp_ip_address: The custom BgpPeeringAddress which belongs to IpconfigurationId. + Required. + :vartype custom_bgp_ip_address: str + """ + + _validation = { + "ip_configuration_id": {"required": True}, + "custom_bgp_ip_address": {"required": True}, + } + + _attribute_map = { + "ip_configuration_id": {"key": "ipConfigurationId", "type": "str"}, + "custom_bgp_ip_address": {"key": "customBgpIpAddress", "type": "str"}, + } + + def __init__(self, *, ip_configuration_id: str, custom_bgp_ip_address: str, **kwargs: Any) -> None: + """ + :keyword ip_configuration_id: The IpconfigurationId of ipconfiguration which belongs to + gateway. Required. + :paramtype ip_configuration_id: str + :keyword custom_bgp_ip_address: The custom BgpPeeringAddress which belongs to + IpconfigurationId. Required. + :paramtype custom_bgp_ip_address: str + """ + super().__init__(**kwargs) + self.ip_configuration_id = ip_configuration_id + self.custom_bgp_ip_address = custom_bgp_ip_address + + +class GatewayLoadBalancerTunnelInterface(_serialization.Model): + """Gateway load balancer tunnel interface of a load balancer backend address pool. + + :ivar port: Port of gateway load balancer tunnel interface. + :vartype port: int + :ivar identifier: Identifier of gateway load balancer tunnel interface. + :vartype identifier: int + :ivar protocol: Protocol of gateway load balancer tunnel interface. Known values are: "None", + "Native", and "VXLAN". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.GatewayLoadBalancerTunnelProtocol + :ivar type: Traffic type of gateway load balancer tunnel interface. Known values are: "None", + "Internal", and "External". + :vartype type: str or + ~azure.mgmt.network.v2023_09_01.models.GatewayLoadBalancerTunnelInterfaceType + """ + + _attribute_map = { + "port": {"key": "port", "type": "int"}, + "identifier": {"key": "identifier", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + port: Optional[int] = None, + identifier: Optional[int] = None, + protocol: Optional[Union[str, "_models.GatewayLoadBalancerTunnelProtocol"]] = None, + type: Optional[Union[str, "_models.GatewayLoadBalancerTunnelInterfaceType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword port: Port of gateway load balancer tunnel interface. + :paramtype port: int + :keyword identifier: Identifier of gateway load balancer tunnel interface. + :paramtype identifier: int + :keyword protocol: Protocol of gateway load balancer tunnel interface. Known values are: + "None", "Native", and "VXLAN". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.GatewayLoadBalancerTunnelProtocol + :keyword type: Traffic type of gateway load balancer tunnel interface. Known values are: + "None", "Internal", and "External". + :paramtype type: str or + ~azure.mgmt.network.v2023_09_01.models.GatewayLoadBalancerTunnelInterfaceType + """ + super().__init__(**kwargs) + self.port = port + self.identifier = identifier + self.protocol = protocol + self.type = type + + +class GatewayRoute(_serialization.Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The gateway's local address. + :vartype local_address: str + :ivar network: The route's network prefix. + :vartype network: str + :ivar next_hop: The route's next hop. + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from. + :vartype source_peer: str + :ivar origin: The source this route was learned from. + :vartype origin: str + :ivar as_path: The route's AS path sequence. + :vartype as_path: str + :ivar weight: The route's weight. + :vartype weight: int + """ + + _validation = { + "local_address": {"readonly": True}, + "network": {"readonly": True}, + "next_hop": {"readonly": True}, + "source_peer": {"readonly": True}, + "origin": {"readonly": True}, + "as_path": {"readonly": True}, + "weight": {"readonly": True}, + } + + _attribute_map = { + "local_address": {"key": "localAddress", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "next_hop": {"key": "nextHop", "type": "str"}, + "source_peer": {"key": "sourcePeer", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "as_path": {"key": "asPath", "type": "str"}, + "weight": {"key": "weight", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None + + +class GatewayRouteListResult(_serialization.Model): + """List of virtual network gateway routes. + + :ivar value: List of gateway routes. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.GatewayRoute] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[GatewayRoute]"}, + } + + def __init__(self, *, value: Optional[List["_models.GatewayRoute"]] = None, **kwargs: Any) -> None: + """ + :keyword value: List of gateway routes. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.GatewayRoute] + """ + super().__init__(**kwargs) + self.value = value + + +class GenerateExpressRoutePortsLOARequest(_serialization.Model): + """The customer name to be printed on a letter of authorization. + + All required parameters must be populated in order to send to server. + + :ivar customer_name: The customer name. Required. + :vartype customer_name: str + """ + + _validation = { + "customer_name": {"required": True}, + } + + _attribute_map = { + "customer_name": {"key": "customerName", "type": "str"}, + } + + def __init__(self, *, customer_name: str, **kwargs: Any) -> None: + """ + :keyword customer_name: The customer name. Required. + :paramtype customer_name: str + """ + super().__init__(**kwargs) + self.customer_name = customer_name + + +class GenerateExpressRoutePortsLOAResult(_serialization.Model): + """Response for GenerateExpressRoutePortsLOA API service call. + + :ivar encoded_content: The content as a base64 encoded string. + :vartype encoded_content: str + """ + + _attribute_map = { + "encoded_content": {"key": "encodedContent", "type": "str"}, + } + + def __init__(self, *, encoded_content: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword encoded_content: The content as a base64 encoded string. + :paramtype encoded_content: str + """ + super().__init__(**kwargs) + self.encoded_content = encoded_content + + +class GetInboundRoutesParameters(_serialization.Model): + """The parameters specifying the connection resource whose inbound routes are being requested. + + :ivar resource_uri: The connection resource whose inbound routes are being requested. + :vartype resource_uri: str + :ivar connection_type: The type of the specified connection resource like + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :vartype connection_type: str + """ + + _attribute_map = { + "resource_uri": {"key": "resourceUri", "type": "str"}, + "connection_type": {"key": "connectionType", "type": "str"}, + } + + def __init__( + self, *, resource_uri: Optional[str] = None, connection_type: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_uri: The connection resource whose inbound routes are being requested. + :paramtype resource_uri: str + :keyword connection_type: The type of the specified connection resource like + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :paramtype connection_type: str + """ + super().__init__(**kwargs) + self.resource_uri = resource_uri + self.connection_type = connection_type + + +class GetOutboundRoutesParameters(_serialization.Model): + """The parameters specifying the connection resource whose outbound routes are being requested. + + :ivar resource_uri: The connection resource whose outbound routes are being requested. + :vartype resource_uri: str + :ivar connection_type: The type of the specified connection resource like + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :vartype connection_type: str + """ + + _attribute_map = { + "resource_uri": {"key": "resourceUri", "type": "str"}, + "connection_type": {"key": "connectionType", "type": "str"}, + } + + def __init__( + self, *, resource_uri: Optional[str] = None, connection_type: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_uri: The connection resource whose outbound routes are being requested. + :paramtype resource_uri: str + :keyword connection_type: The type of the specified connection resource like + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :paramtype connection_type: str + """ + super().__init__(**kwargs) + self.resource_uri = resource_uri + self.connection_type = connection_type + + +class GetVpnSitesConfigurationRequest(_serialization.Model): + """List of Vpn-Sites. + + All required parameters must be populated in order to send to server. + + :ivar vpn_sites: List of resource-ids of the vpn-sites for which config is to be downloaded. + :vartype vpn_sites: list[str] + :ivar output_blob_sas_url: The sas-url to download the configurations for vpn-sites. Required. + :vartype output_blob_sas_url: str + """ + + _validation = { + "output_blob_sas_url": {"required": True}, + } + + _attribute_map = { + "vpn_sites": {"key": "vpnSites", "type": "[str]"}, + "output_blob_sas_url": {"key": "outputBlobSasUrl", "type": "str"}, + } + + def __init__(self, *, output_blob_sas_url: str, vpn_sites: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword vpn_sites: List of resource-ids of the vpn-sites for which config is to be downloaded. + :paramtype vpn_sites: list[str] + :keyword output_blob_sas_url: The sas-url to download the configurations for vpn-sites. + Required. + :paramtype output_blob_sas_url: str + """ + super().__init__(**kwargs) + self.vpn_sites = vpn_sites + self.output_blob_sas_url = output_blob_sas_url + + +class GroupByUserSession(_serialization.Model): + """Define user session identifier group by clauses. + + All required parameters must be populated in order to send to server. + + :ivar group_by_variables: List of group by clause variables. Required. + :vartype group_by_variables: list[~azure.mgmt.network.v2023_09_01.models.GroupByVariable] + """ + + _validation = { + "group_by_variables": {"required": True}, + } + + _attribute_map = { + "group_by_variables": {"key": "groupByVariables", "type": "[GroupByVariable]"}, + } + + def __init__(self, *, group_by_variables: List["_models.GroupByVariable"], **kwargs: Any) -> None: + """ + :keyword group_by_variables: List of group by clause variables. Required. + :paramtype group_by_variables: list[~azure.mgmt.network.v2023_09_01.models.GroupByVariable] + """ + super().__init__(**kwargs) + self.group_by_variables = group_by_variables + + +class GroupByVariable(_serialization.Model): + """Define user session group by clause variables. + + All required parameters must be populated in order to send to server. + + :ivar variable_name: User Session clause variable. Required. Known values are: "ClientAddr", + "GeoLocation", and "None". + :vartype variable_name: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallUserSessionVariable + """ + + _validation = { + "variable_name": {"required": True}, + } + + _attribute_map = { + "variable_name": {"key": "variableName", "type": "str"}, + } + + def __init__( + self, *, variable_name: Union[str, "_models.ApplicationGatewayFirewallUserSessionVariable"], **kwargs: Any + ) -> None: + """ + :keyword variable_name: User Session clause variable. Required. Known values are: "ClientAddr", + "GeoLocation", and "None". + :paramtype variable_name: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallUserSessionVariable + """ + super().__init__(**kwargs) + self.variable_name = variable_name + + +class HopLink(_serialization.Model): + """Hop link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar next_hop_id: The ID of the next hop. + :vartype next_hop_id: str + :ivar link_type: Link type. + :vartype link_type: str + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2023_09_01.models.ConnectivityIssue] + :ivar context: Provides additional context on links. + :vartype context: dict[str, str] + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar round_trip_time_min: Minimum roundtrip time in milliseconds. + :vartype round_trip_time_min: int + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: int + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: int + """ + + _validation = { + "next_hop_id": {"readonly": True}, + "link_type": {"readonly": True}, + "issues": {"readonly": True}, + "context": {"readonly": True}, + "resource_id": {"readonly": True}, + "round_trip_time_min": {"readonly": True, "maximum": 4294967295, "minimum": 0}, + "round_trip_time_avg": {"readonly": True, "maximum": 4294967295, "minimum": 0}, + "round_trip_time_max": {"readonly": True, "maximum": 4294967295, "minimum": 0}, + } + + _attribute_map = { + "next_hop_id": {"key": "nextHopId", "type": "str"}, + "link_type": {"key": "linkType", "type": "str"}, + "issues": {"key": "issues", "type": "[ConnectivityIssue]"}, + "context": {"key": "context", "type": "{str}"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "round_trip_time_min": {"key": "properties.roundTripTimeMin", "type": "int"}, + "round_trip_time_avg": {"key": "properties.roundTripTimeAvg", "type": "int"}, + "round_trip_time_max": {"key": "properties.roundTripTimeMax", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.next_hop_id = None + self.link_type = None + self.issues = None + self.context = None + self.resource_id = None + self.round_trip_time_min = None + self.round_trip_time_avg = None + self.round_trip_time_max = None + + +class HTTPConfiguration(_serialization.Model): + """HTTP configuration of the connectivity check. + + :ivar method: HTTP method. "Get" + :vartype method: str or ~azure.mgmt.network.v2023_09_01.models.HTTPMethod + :ivar headers: List of HTTP headers. + :vartype headers: list[~azure.mgmt.network.v2023_09_01.models.HTTPHeader] + :ivar valid_status_codes: Valid status codes. + :vartype valid_status_codes: list[int] + """ + + _attribute_map = { + "method": {"key": "method", "type": "str"}, + "headers": {"key": "headers", "type": "[HTTPHeader]"}, + "valid_status_codes": {"key": "validStatusCodes", "type": "[int]"}, + } + + def __init__( + self, + *, + method: Optional[Union[str, "_models.HTTPMethod"]] = None, + headers: Optional[List["_models.HTTPHeader"]] = None, + valid_status_codes: Optional[List[int]] = None, + **kwargs: Any + ) -> None: + """ + :keyword method: HTTP method. "Get" + :paramtype method: str or ~azure.mgmt.network.v2023_09_01.models.HTTPMethod + :keyword headers: List of HTTP headers. + :paramtype headers: list[~azure.mgmt.network.v2023_09_01.models.HTTPHeader] + :keyword valid_status_codes: Valid status codes. + :paramtype valid_status_codes: list[int] + """ + super().__init__(**kwargs) + self.method = method + self.headers = headers + self.valid_status_codes = valid_status_codes + + +class HTTPHeader(_serialization.Model): + """The HTTP header. + + :ivar name: The name in HTTP header. + :vartype name: str + :ivar value: The value in HTTP header. + :vartype value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The name in HTTP header. + :paramtype name: str + :keyword value: The value in HTTP header. + :paramtype value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + + +class Hub(_serialization.Model): + """Hub Item. + + :ivar resource_id: Resource Id. + :vartype resource_id: str + :ivar resource_type: Resource Type. + :vartype resource_type: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "resource_type": {"key": "resourceType", "type": "str"}, + } + + def __init__( + self, *, resource_id: Optional[str] = None, resource_type: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_id: Resource Id. + :paramtype resource_id: str + :keyword resource_type: Resource Type. + :paramtype resource_type: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.resource_type = resource_type + + +class HubIPAddresses(_serialization.Model): + """IP addresses associated with azure firewall. + + :ivar public_i_ps: Public IP addresses associated with azure firewall. + :vartype public_i_ps: ~azure.mgmt.network.v2023_09_01.models.HubPublicIPAddresses + :ivar private_ip_address: Private IP Address associated with azure firewall. + :vartype private_ip_address: str + """ + + _attribute_map = { + "public_i_ps": {"key": "publicIPs", "type": "HubPublicIPAddresses"}, + "private_ip_address": {"key": "privateIPAddress", "type": "str"}, + } + + def __init__( + self, + *, + public_i_ps: Optional["_models.HubPublicIPAddresses"] = None, + private_ip_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword public_i_ps: Public IP addresses associated with azure firewall. + :paramtype public_i_ps: ~azure.mgmt.network.v2023_09_01.models.HubPublicIPAddresses + :keyword private_ip_address: Private IP Address associated with azure firewall. + :paramtype private_ip_address: str + """ + super().__init__(**kwargs) + self.public_i_ps = public_i_ps + self.private_ip_address = private_ip_address + + +class HubIpConfiguration(SubResource): + """IpConfigurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the Ip Configuration. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Ipconfiguration type. + :vartype type: str + :ivar private_ip_address: The private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar subnet: The reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar public_ip_address: The reference to the public IP resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :ivar provisioning_state: The provisioning state of the IP configuration resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "PublicIPAddress"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + subnet: Optional["_models.Subnet"] = None, + public_ip_address: Optional["_models.PublicIPAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the Ip Configuration. + :paramtype name: str + :keyword private_ip_address: The private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword subnet: The reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword public_ip_address: The reference to the public IP resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + + +class HubPublicIPAddresses(_serialization.Model): + """Public IP addresses associated with azure firewall. + + :ivar addresses: The list of Public IP addresses associated with azure firewall or IP addresses + to be retained. + :vartype addresses: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallPublicIPAddress] + :ivar count: The number of Public IP addresses associated with azure firewall. + :vartype count: int + """ + + _attribute_map = { + "addresses": {"key": "addresses", "type": "[AzureFirewallPublicIPAddress]"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__( + self, + *, + addresses: Optional[List["_models.AzureFirewallPublicIPAddress"]] = None, + count: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword addresses: The list of Public IP addresses associated with azure firewall or IP + addresses to be retained. + :paramtype addresses: list[~azure.mgmt.network.v2023_09_01.models.AzureFirewallPublicIPAddress] + :keyword count: The number of Public IP addresses associated with azure firewall. + :paramtype count: int + """ + super().__init__(**kwargs) + self.addresses = addresses + self.count = count + + +class HubRoute(_serialization.Model): + """RouteTable route. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the Route that is unique within a RouteTable. This name can be used to + access this route. Required. + :vartype name: str + :ivar destination_type: The type of destinations (eg: CIDR, ResourceId, Service). Required. + :vartype destination_type: str + :ivar destinations: List of all destinations. Required. + :vartype destinations: list[str] + :ivar next_hop_type: The type of next hop (eg: ResourceId). Required. + :vartype next_hop_type: str + :ivar next_hop: NextHop resource ID. Required. + :vartype next_hop: str + """ + + _validation = { + "name": {"required": True}, + "destination_type": {"required": True}, + "destinations": {"required": True}, + "next_hop_type": {"required": True}, + "next_hop": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "destination_type": {"key": "destinationType", "type": "str"}, + "destinations": {"key": "destinations", "type": "[str]"}, + "next_hop_type": {"key": "nextHopType", "type": "str"}, + "next_hop": {"key": "nextHop", "type": "str"}, + } + + def __init__( + self, + *, + name: str, + destination_type: str, + destinations: List[str], + next_hop_type: str, + next_hop: str, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the Route that is unique within a RouteTable. This name can be used + to access this route. Required. + :paramtype name: str + :keyword destination_type: The type of destinations (eg: CIDR, ResourceId, Service). Required. + :paramtype destination_type: str + :keyword destinations: List of all destinations. Required. + :paramtype destinations: list[str] + :keyword next_hop_type: The type of next hop (eg: ResourceId). Required. + :paramtype next_hop_type: str + :keyword next_hop: NextHop resource ID. Required. + :paramtype next_hop: str + """ + super().__init__(**kwargs) + self.name = name + self.destination_type = destination_type + self.destinations = destinations + self.next_hop_type = next_hop_type + self.next_hop = next_hop + + +class HubRouteTable(SubResource): + """RouteTable resource in a virtual hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar routes: List of all routes. + :vartype routes: list[~azure.mgmt.network.v2023_09_01.models.HubRoute] + :ivar labels: List of labels associated with this route table. + :vartype labels: list[str] + :ivar associated_connections: List of all connections associated with this route table. + :vartype associated_connections: list[str] + :ivar propagating_connections: List of all connections that advertise to this route table. + :vartype propagating_connections: list[str] + :ivar provisioning_state: The provisioning state of the RouteTable resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "associated_connections": {"readonly": True}, + "propagating_connections": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "routes": {"key": "properties.routes", "type": "[HubRoute]"}, + "labels": {"key": "properties.labels", "type": "[str]"}, + "associated_connections": {"key": "properties.associatedConnections", "type": "[str]"}, + "propagating_connections": {"key": "properties.propagatingConnections", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + routes: Optional[List["_models.HubRoute"]] = None, + labels: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword routes: List of all routes. + :paramtype routes: list[~azure.mgmt.network.v2023_09_01.models.HubRoute] + :keyword labels: List of labels associated with this route table. + :paramtype labels: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.routes = routes + self.labels = labels + self.associated_connections = None + self.propagating_connections = None + self.provisioning_state = None + + +class HubVirtualNetworkConnection(SubResource): + """HubVirtualNetworkConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar remote_virtual_network: Reference to the remote virtual network. + :vartype remote_virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar allow_hub_to_remote_vnet_transit: Deprecated: VirtualHub to RemoteVnet transit to enabled + or not. + :vartype allow_hub_to_remote_vnet_transit: bool + :ivar allow_remote_vnet_to_use_hub_vnet_gateways: Deprecated: Allow RemoteVnet to use Virtual + Hub's gateways. + :vartype allow_remote_vnet_to_use_hub_vnet_gateways: bool + :ivar enable_internet_security: Enable internet security. + :vartype enable_internet_security: bool + :ivar routing_configuration: The Routing Configuration indicating the associated and propagated + route tables on this connection. + :vartype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + :ivar provisioning_state: The provisioning state of the hub virtual network connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "remote_virtual_network": {"key": "properties.remoteVirtualNetwork", "type": "SubResource"}, + "allow_hub_to_remote_vnet_transit": {"key": "properties.allowHubToRemoteVnetTransit", "type": "bool"}, + "allow_remote_vnet_to_use_hub_vnet_gateways": { + "key": "properties.allowRemoteVnetToUseHubVnetGateways", + "type": "bool", + }, + "enable_internet_security": {"key": "properties.enableInternetSecurity", "type": "bool"}, + "routing_configuration": {"key": "properties.routingConfiguration", "type": "RoutingConfiguration"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + remote_virtual_network: Optional["_models.SubResource"] = None, + allow_hub_to_remote_vnet_transit: Optional[bool] = None, + allow_remote_vnet_to_use_hub_vnet_gateways: Optional[bool] = None, + enable_internet_security: Optional[bool] = None, + routing_configuration: Optional["_models.RoutingConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword remote_virtual_network: Reference to the remote virtual network. + :paramtype remote_virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword allow_hub_to_remote_vnet_transit: Deprecated: VirtualHub to RemoteVnet transit to + enabled or not. + :paramtype allow_hub_to_remote_vnet_transit: bool + :keyword allow_remote_vnet_to_use_hub_vnet_gateways: Deprecated: Allow RemoteVnet to use + Virtual Hub's gateways. + :paramtype allow_remote_vnet_to_use_hub_vnet_gateways: bool + :keyword enable_internet_security: Enable internet security. + :paramtype enable_internet_security: bool + :keyword routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :paramtype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.remote_virtual_network = remote_virtual_network + self.allow_hub_to_remote_vnet_transit = allow_hub_to_remote_vnet_transit + self.allow_remote_vnet_to_use_hub_vnet_gateways = allow_remote_vnet_to_use_hub_vnet_gateways + self.enable_internet_security = enable_internet_security + self.routing_configuration = routing_configuration + self.provisioning_state = None + + +class IDPSQueryObject(_serialization.Model): + """Will describe the query to run against the IDPS signatures DB. + + :ivar filters: Contain all filters names and values. + :vartype filters: list[~azure.mgmt.network.v2023_09_01.models.FilterItems] + :ivar search: Search term in all columns. + :vartype search: str + :ivar order_by: Column to sort response by. + :vartype order_by: ~azure.mgmt.network.v2023_09_01.models.OrderBy + :ivar results_per_page: The number of the results to return in each page. + :vartype results_per_page: int + :ivar skip: The number of records matching the filter to skip. + :vartype skip: int + """ + + _validation = { + "results_per_page": {"maximum": 1000, "minimum": 1}, + } + + _attribute_map = { + "filters": {"key": "filters", "type": "[FilterItems]"}, + "search": {"key": "search", "type": "str"}, + "order_by": {"key": "orderBy", "type": "OrderBy"}, + "results_per_page": {"key": "resultsPerPage", "type": "int"}, + "skip": {"key": "skip", "type": "int"}, + } + + def __init__( + self, + *, + filters: Optional[List["_models.FilterItems"]] = None, + search: Optional[str] = None, + order_by: Optional["_models.OrderBy"] = None, + results_per_page: Optional[int] = None, + skip: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword filters: Contain all filters names and values. + :paramtype filters: list[~azure.mgmt.network.v2023_09_01.models.FilterItems] + :keyword search: Search term in all columns. + :paramtype search: str + :keyword order_by: Column to sort response by. + :paramtype order_by: ~azure.mgmt.network.v2023_09_01.models.OrderBy + :keyword results_per_page: The number of the results to return in each page. + :paramtype results_per_page: int + :keyword skip: The number of records matching the filter to skip. + :paramtype skip: int + """ + super().__init__(**kwargs) + self.filters = filters + self.search = search + self.order_by = order_by + self.results_per_page = results_per_page + self.skip = skip + + +class InboundNatPool(SubResource): # pylint: disable=too-many-instance-attributes + """Inbound NAT pool of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of inbound NAT pools used by + the load balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar frontend_ip_configuration: A reference to frontend IP addresses. + :vartype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar protocol: The reference to the transport protocol used by the inbound NAT pool. Known + values are: "Udp", "Tcp", and "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :ivar frontend_port_range_start: The first port number in the range of external ports that will + be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range + between 1 and 65534. + :vartype frontend_port_range_start: int + :ivar frontend_port_range_end: The last port number in the range of external ports that will be + used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range + between 1 and 65535. + :vartype frontend_port_range_end: int + :ivar backend_port: The port used for internal connections on the endpoint. Acceptable values + are between 1 and 65535. + :vartype backend_port: int + :ivar idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :vartype idle_timeout_in_minutes: int + :ivar enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :vartype enable_floating_ip: bool + :ivar enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + connection termination. This element is only used when the protocol is set to TCP. + :vartype enable_tcp_reset: bool + :ivar provisioning_state: The provisioning state of the inbound NAT pool resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "frontend_ip_configuration": {"key": "properties.frontendIPConfiguration", "type": "SubResource"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "frontend_port_range_start": {"key": "properties.frontendPortRangeStart", "type": "int"}, + "frontend_port_range_end": {"key": "properties.frontendPortRangeEnd", "type": "int"}, + "backend_port": {"key": "properties.backendPort", "type": "int"}, + "idle_timeout_in_minutes": {"key": "properties.idleTimeoutInMinutes", "type": "int"}, + "enable_floating_ip": {"key": "properties.enableFloatingIP", "type": "bool"}, + "enable_tcp_reset": {"key": "properties.enableTcpReset", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + frontend_ip_configuration: Optional["_models.SubResource"] = None, + protocol: Optional[Union[str, "_models.TransportProtocol"]] = None, + frontend_port_range_start: Optional[int] = None, + frontend_port_range_end: Optional[int] = None, + backend_port: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_floating_ip: Optional[bool] = None, + enable_tcp_reset: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of inbound NAT pools used + by the load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword frontend_ip_configuration: A reference to frontend IP addresses. + :paramtype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword protocol: The reference to the transport protocol used by the inbound NAT pool. Known + values are: "Udp", "Tcp", and "All". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :keyword frontend_port_range_start: The first port number in the range of external ports that + will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values + range between 1 and 65534. + :paramtype frontend_port_range_start: int + :keyword frontend_port_range_end: The last port number in the range of external ports that will + be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range + between 1 and 65535. + :paramtype frontend_port_range_end: int + :keyword backend_port: The port used for internal connections on the endpoint. Acceptable + values are between 1 and 65535. + :paramtype backend_port: int + :keyword idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :paramtype idle_timeout_in_minutes: int + :keyword enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :paramtype enable_floating_ip: bool + :keyword enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or + unexpected connection termination. This element is only used when the protocol is set to TCP. + :paramtype enable_tcp_reset: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset + self.provisioning_state = None + + +class InboundNatRule(SubResource): # pylint: disable=too-many-instance-attributes + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of inbound NAT rules used by + the load balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar frontend_ip_configuration: A reference to frontend IP addresses. + :vartype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address defined on a network + interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations + is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :ivar protocol: The reference to the transport protocol used by the load balancing rule. Known + values are: "Udp", "Tcp", and "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :ivar frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values range from 1 to 65534. + :vartype frontend_port: int + :ivar backend_port: The port used for the internal endpoint. Acceptable values range from 1 to + 65535. + :vartype backend_port: int + :ivar idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :vartype idle_timeout_in_minutes: int + :ivar enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :vartype enable_floating_ip: bool + :ivar enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + connection termination. This element is only used when the protocol is set to TCP. + :vartype enable_tcp_reset: bool + :ivar frontend_port_range_start: The port range start for the external endpoint. This property + is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule + port mappings will be created for each backend address from BackendAddressPool. Acceptable + values range from 1 to 65534. + :vartype frontend_port_range_start: int + :ivar frontend_port_range_end: The port range end for the external endpoint. This property is + used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule + port mappings will be created for each backend address from BackendAddressPool. Acceptable + values range from 1 to 65534. + :vartype frontend_port_range_end: int + :ivar backend_address_pool: A reference to backendAddressPool resource. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the inbound NAT rule resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "backend_ip_configuration": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "frontend_ip_configuration": {"key": "properties.frontendIPConfiguration", "type": "SubResource"}, + "backend_ip_configuration": { + "key": "properties.backendIPConfiguration", + "type": "NetworkInterfaceIPConfiguration", + }, + "protocol": {"key": "properties.protocol", "type": "str"}, + "frontend_port": {"key": "properties.frontendPort", "type": "int"}, + "backend_port": {"key": "properties.backendPort", "type": "int"}, + "idle_timeout_in_minutes": {"key": "properties.idleTimeoutInMinutes", "type": "int"}, + "enable_floating_ip": {"key": "properties.enableFloatingIP", "type": "bool"}, + "enable_tcp_reset": {"key": "properties.enableTcpReset", "type": "bool"}, + "frontend_port_range_start": {"key": "properties.frontendPortRangeStart", "type": "int"}, + "frontend_port_range_end": {"key": "properties.frontendPortRangeEnd", "type": "int"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + frontend_ip_configuration: Optional["_models.SubResource"] = None, + protocol: Optional[Union[str, "_models.TransportProtocol"]] = None, + frontend_port: Optional[int] = None, + backend_port: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_floating_ip: Optional[bool] = None, + enable_tcp_reset: Optional[bool] = None, + frontend_port_range_start: Optional[int] = None, + frontend_port_range_end: Optional[int] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of inbound NAT rules used + by the load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword frontend_ip_configuration: A reference to frontend IP addresses. + :paramtype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword protocol: The reference to the transport protocol used by the load balancing rule. + Known values are: "Udp", "Tcp", and "All". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :keyword frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values range from 1 to 65534. + :paramtype frontend_port: int + :keyword backend_port: The port used for the internal endpoint. Acceptable values range from 1 + to 65535. + :paramtype backend_port: int + :keyword idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :paramtype idle_timeout_in_minutes: int + :keyword enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :paramtype enable_floating_ip: bool + :keyword enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or + unexpected connection termination. This element is only used when the protocol is set to TCP. + :paramtype enable_tcp_reset: bool + :keyword frontend_port_range_start: The port range start for the external endpoint. This + property is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound + NAT rule port mappings will be created for each backend address from BackendAddressPool. + Acceptable values range from 1 to 65534. + :paramtype frontend_port_range_start: int + :keyword frontend_port_range_end: The port range end for the external endpoint. This property + is used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT + rule port mappings will be created for each backend address from BackendAddressPool. Acceptable + values range from 1 to 65534. + :paramtype frontend_port_range_end: int + :keyword backend_address_pool: A reference to backendAddressPool resource. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_address_pool = backend_address_pool + self.provisioning_state = None + + +class InboundNatRuleListResult(_serialization.Model): + """Response for ListInboundNatRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of inbound NAT rules in a load balancer. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[InboundNatRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.InboundNatRule"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of inbound NAT rules in a load balancer. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class InboundNatRulePortMapping(_serialization.Model): + """Individual port mappings for inbound NAT rule created for backend pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar inbound_nat_rule_name: Name of inbound NAT rule. + :vartype inbound_nat_rule_name: str + :ivar protocol: The reference to the transport protocol used by the inbound NAT rule. Known + values are: "Udp", "Tcp", and "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :ivar frontend_port: Frontend port. + :vartype frontend_port: int + :ivar backend_port: Backend port. + :vartype backend_port: int + """ + + _validation = { + "inbound_nat_rule_name": {"readonly": True}, + "protocol": {"readonly": True}, + "frontend_port": {"readonly": True}, + "backend_port": {"readonly": True}, + } + + _attribute_map = { + "inbound_nat_rule_name": {"key": "inboundNatRuleName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "frontend_port": {"key": "frontendPort", "type": "int"}, + "backend_port": {"key": "backendPort", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.inbound_nat_rule_name = None + self.protocol = None + self.frontend_port = None + self.backend_port = None + + +class InboundSecurityRule(SubResource): + """NVA Inbound Security Rule resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of security rule collection. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: NVA inbound security rule type. + :vartype type: str + :ivar rules: List of allowed rules. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRules] + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "rules": {"key": "properties.rules", "type": "[InboundSecurityRules]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + rules: Optional[List["_models.InboundSecurityRules"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of security rule collection. + :paramtype name: str + :keyword rules: List of allowed rules. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRules] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.rules = rules + self.provisioning_state = None + + +class InboundSecurityRules(_serialization.Model): + """Properties of the Inbound Security Rules resource. + + :ivar protocol: Protocol. This should be either TCP or UDP. Known values are: "TCP" and "UDP". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.InboundSecurityRulesProtocol + :ivar source_address_prefix: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are + allowed. + :vartype source_address_prefix: str + :ivar destination_port_range: NVA port ranges to be opened up. One needs to provide specific + ports. + :vartype destination_port_range: int + """ + + _validation = { + "destination_port_range": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "protocol": {"key": "protocol", "type": "str"}, + "source_address_prefix": {"key": "sourceAddressPrefix", "type": "str"}, + "destination_port_range": {"key": "destinationPortRange", "type": "int"}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "_models.InboundSecurityRulesProtocol"]] = None, + source_address_prefix: Optional[str] = None, + destination_port_range: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword protocol: Protocol. This should be either TCP or UDP. Known values are: "TCP" and + "UDP". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.InboundSecurityRulesProtocol + :keyword source_address_prefix: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges + are allowed. + :paramtype source_address_prefix: str + :keyword destination_port_range: NVA port ranges to be opened up. One needs to provide specific + ports. + :paramtype destination_port_range: int + """ + super().__init__(**kwargs) + self.protocol = protocol + self.source_address_prefix = source_address_prefix + self.destination_port_range = destination_port_range + + +class InternetIngressPublicIpsProperties(_serialization.Model): + """Resource Uri of Public Ip for Standard Load Balancer Frontend End. + + :ivar id: Resource Uri of Public Ip. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource Uri of Public Ip. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class IPAddressAvailabilityResult(_serialization.Model): + """Response for CheckIPAddressAvailability API service call. + + :ivar available: Private IP address availability. + :vartype available: bool + :ivar available_ip_addresses: Contains other available private IP addresses if the asked for + address is taken. + :vartype available_ip_addresses: list[str] + :ivar is_platform_reserved: Private IP address platform reserved. + :vartype is_platform_reserved: bool + """ + + _attribute_map = { + "available": {"key": "available", "type": "bool"}, + "available_ip_addresses": {"key": "availableIPAddresses", "type": "[str]"}, + "is_platform_reserved": {"key": "isPlatformReserved", "type": "bool"}, + } + + def __init__( + self, + *, + available: Optional[bool] = None, + available_ip_addresses: Optional[List[str]] = None, + is_platform_reserved: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword available: Private IP address availability. + :paramtype available: bool + :keyword available_ip_addresses: Contains other available private IP addresses if the asked for + address is taken. + :paramtype available_ip_addresses: list[str] + :keyword is_platform_reserved: Private IP address platform reserved. + :paramtype is_platform_reserved: bool + """ + super().__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses + self.is_platform_reserved = is_platform_reserved + + +class IpAllocation(Resource): # pylint: disable=too-many-instance-attributes + """IpAllocation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar subnet: The Subnet that using the prefix of this IpAllocation resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar type_properties_type: The type for the IpAllocation. Known values are: "Undefined" and + "Hypernet". + :vartype type_properties_type: str or ~azure.mgmt.network.v2023_09_01.models.IpAllocationType + :ivar prefix: The address prefix for the IpAllocation. + :vartype prefix: str + :ivar prefix_length: The address prefix length for the IpAllocation. + :vartype prefix_length: int + :ivar prefix_type: The address prefix Type for the IpAllocation. Known values are: "IPv4" and + "IPv6". + :vartype prefix_type: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :ivar ipam_allocation_id: The IPAM allocation ID. + :vartype ipam_allocation_id: str + :ivar allocation_tags: IpAllocation tags. + :vartype allocation_tags: dict[str, str] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "subnet": {"readonly": True}, + "virtual_network": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "virtual_network": {"key": "properties.virtualNetwork", "type": "SubResource"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "prefix": {"key": "properties.prefix", "type": "str"}, + "prefix_length": {"key": "properties.prefixLength", "type": "int"}, + "prefix_type": {"key": "properties.prefixType", "type": "str"}, + "ipam_allocation_id": {"key": "properties.ipamAllocationId", "type": "str"}, + "allocation_tags": {"key": "properties.allocationTags", "type": "{str}"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + type_properties_type: Optional[Union[str, "_models.IpAllocationType"]] = None, + prefix: Optional[str] = None, + prefix_length: int = 0, + prefix_type: Optional[Union[str, "_models.IPVersion"]] = None, + ipam_allocation_id: Optional[str] = None, + allocation_tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword type_properties_type: The type for the IpAllocation. Known values are: "Undefined" and + "Hypernet". + :paramtype type_properties_type: str or ~azure.mgmt.network.v2023_09_01.models.IpAllocationType + :keyword prefix: The address prefix for the IpAllocation. + :paramtype prefix: str + :keyword prefix_length: The address prefix length for the IpAllocation. + :paramtype prefix_length: int + :keyword prefix_type: The address prefix Type for the IpAllocation. Known values are: "IPv4" + and "IPv6". + :paramtype prefix_type: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :keyword ipam_allocation_id: The IPAM allocation ID. + :paramtype ipam_allocation_id: str + :keyword allocation_tags: IpAllocation tags. + :paramtype allocation_tags: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.subnet = None + self.virtual_network = None + self.type_properties_type = type_properties_type + self.prefix = prefix + self.prefix_length = prefix_length + self.prefix_type = prefix_type + self.ipam_allocation_id = ipam_allocation_id + self.allocation_tags = allocation_tags + + +class IpAllocationListResult(_serialization.Model): + """Response for the ListIpAllocations API service call. + + :ivar value: A list of IpAllocation resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[IpAllocation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.IpAllocation"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of IpAllocation resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IPConfiguration(SubResource): + """IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar private_ip_address: The private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar subnet: The reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar public_ip_address: The reference to the public IP resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :ivar provisioning_state: The provisioning state of the IP configuration resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "PublicIPAddress"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + subnet: Optional["_models.Subnet"] = None, + public_ip_address: Optional["_models.PublicIPAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword private_ip_address: The private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword subnet: The reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword public_ip_address: The reference to the public IP resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + + +class IPConfigurationBgpPeeringAddress(_serialization.Model): + """Properties of IPConfigurationBgpPeeringAddress. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ipconfiguration_id: The ID of IP configuration which belongs to gateway. + :vartype ipconfiguration_id: str + :ivar default_bgp_ip_addresses: The list of default BGP peering addresses which belong to IP + configuration. + :vartype default_bgp_ip_addresses: list[str] + :ivar custom_bgp_ip_addresses: The list of custom BGP peering addresses which belong to IP + configuration. + :vartype custom_bgp_ip_addresses: list[str] + :ivar tunnel_ip_addresses: The list of tunnel public IP addresses which belong to IP + configuration. + :vartype tunnel_ip_addresses: list[str] + """ + + _validation = { + "default_bgp_ip_addresses": {"readonly": True}, + "tunnel_ip_addresses": {"readonly": True}, + } + + _attribute_map = { + "ipconfiguration_id": {"key": "ipconfigurationId", "type": "str"}, + "default_bgp_ip_addresses": {"key": "defaultBgpIpAddresses", "type": "[str]"}, + "custom_bgp_ip_addresses": {"key": "customBgpIpAddresses", "type": "[str]"}, + "tunnel_ip_addresses": {"key": "tunnelIpAddresses", "type": "[str]"}, + } + + def __init__( + self, + *, + ipconfiguration_id: Optional[str] = None, + custom_bgp_ip_addresses: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword ipconfiguration_id: The ID of IP configuration which belongs to gateway. + :paramtype ipconfiguration_id: str + :keyword custom_bgp_ip_addresses: The list of custom BGP peering addresses which belong to IP + configuration. + :paramtype custom_bgp_ip_addresses: list[str] + """ + super().__init__(**kwargs) + self.ipconfiguration_id = ipconfiguration_id + self.default_bgp_ip_addresses = None + self.custom_bgp_ip_addresses = custom_bgp_ip_addresses + self.tunnel_ip_addresses = None + + +class IPConfigurationProfile(SubResource): + """IP configuration profile child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource. This name can be used to access the resource. + :vartype name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar subnet: The reference to the subnet resource to create a container network interface ip + configuration. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar provisioning_state: The provisioning state of the IP configuration profile resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + subnet: Optional["_models.Subnet"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource. This name can be used to access the resource. + :paramtype name: str + :keyword subnet: The reference to the subnet resource to create a container network interface + ip configuration. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + """ + super().__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.subnet = subnet + self.provisioning_state = None + + +class IpGroup(Resource): + """The IpGroups resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the IpGroups resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :vartype ip_addresses: list[str] + :ivar firewalls: List of references to Firewall resources that this IpGroups is associated + with. + :vartype firewalls: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar firewall_policies: List of references to Firewall Policies resources that this IpGroups + is associated with. + :vartype firewall_policies: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "firewalls": {"readonly": True}, + "firewall_policies": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "ip_addresses": {"key": "properties.ipAddresses", "type": "[str]"}, + "firewalls": {"key": "properties.firewalls", "type": "[SubResource]"}, + "firewall_policies": {"key": "properties.firewallPolicies", "type": "[SubResource]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :paramtype ip_addresses: list[str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + self.ip_addresses = ip_addresses + self.firewalls = None + self.firewall_policies = None + + +class IpGroupListResult(_serialization.Model): + """Response for the ListIpGroups API service call. + + :ivar value: The list of IpGroups information resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[IpGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.IpGroup"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list of IpGroups information resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IPPrefixesList(_serialization.Model): + """List of SNAT IP Prefixes learnt by firewall to not SNAT. + + :ivar ip_prefixes: IP Prefix value. + :vartype ip_prefixes: list[str] + """ + + _attribute_map = { + "ip_prefixes": {"key": "ipPrefixes", "type": "[str]"}, + } + + def __init__(self, *, ip_prefixes: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword ip_prefixes: IP Prefix value. + :paramtype ip_prefixes: list[str] + """ + super().__init__(**kwargs) + self.ip_prefixes = ip_prefixes + + +class IPRule(_serialization.Model): + """IPRule. + + :ivar address_prefix: Specifies the IP or IP range in CIDR format. Only IPV4 address is + allowed. + :vartype address_prefix: str + """ + + _attribute_map = { + "address_prefix": {"key": "addressPrefix", "type": "str"}, + } + + def __init__(self, *, address_prefix: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword address_prefix: Specifies the IP or IP range in CIDR format. Only IPV4 address is + allowed. + :paramtype address_prefix: str + """ + super().__init__(**kwargs) + self.address_prefix = address_prefix + + +class IpsecPolicy(_serialization.Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to server. + + :ivar sa_life_time_seconds: The IPSec Security Association (also called Quick Mode or Phase 2 + SA) lifetime in seconds for a site to site VPN tunnel. Required. + :vartype sa_life_time_seconds: int + :ivar sa_data_size_kilobytes: The IPSec Security Association (also called Quick Mode or Phase 2 + SA) payload size in KB for a site to site VPN tunnel. Required. + :vartype sa_data_size_kilobytes: int + :ivar ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). Required. Known values + are: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", and + "GCMAES256". + :vartype ipsec_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IpsecEncryption + :ivar ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). Required. Known values are: + "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", and "GCMAES256". + :vartype ipsec_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IpsecIntegrity + :ivar ike_encryption: The IKE encryption algorithm (IKE phase 2). Required. Known values are: + "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", and "GCMAES128". + :vartype ike_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IkeEncryption + :ivar ike_integrity: The IKE integrity algorithm (IKE phase 2). Required. Known values are: + "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", and "GCMAES128". + :vartype ike_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IkeIntegrity + :ivar dh_group: The DH Group used in IKE Phase 1 for initial SA. Required. Known values are: + "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", and + "DHGroup24". + :vartype dh_group: str or ~azure.mgmt.network.v2023_09_01.models.DhGroup + :ivar pfs_group: The Pfs Group used in IKE Phase 2 for new child SA. Required. Known values + are: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", and "PFSMM". + :vartype pfs_group: str or ~azure.mgmt.network.v2023_09_01.models.PfsGroup + """ + + _validation = { + "sa_life_time_seconds": {"required": True}, + "sa_data_size_kilobytes": {"required": True}, + "ipsec_encryption": {"required": True}, + "ipsec_integrity": {"required": True}, + "ike_encryption": {"required": True}, + "ike_integrity": {"required": True}, + "dh_group": {"required": True}, + "pfs_group": {"required": True}, + } + + _attribute_map = { + "sa_life_time_seconds": {"key": "saLifeTimeSeconds", "type": "int"}, + "sa_data_size_kilobytes": {"key": "saDataSizeKilobytes", "type": "int"}, + "ipsec_encryption": {"key": "ipsecEncryption", "type": "str"}, + "ipsec_integrity": {"key": "ipsecIntegrity", "type": "str"}, + "ike_encryption": {"key": "ikeEncryption", "type": "str"}, + "ike_integrity": {"key": "ikeIntegrity", "type": "str"}, + "dh_group": {"key": "dhGroup", "type": "str"}, + "pfs_group": {"key": "pfsGroup", "type": "str"}, + } + + def __init__( + self, + *, + sa_life_time_seconds: int, + sa_data_size_kilobytes: int, + ipsec_encryption: Union[str, "_models.IpsecEncryption"], + ipsec_integrity: Union[str, "_models.IpsecIntegrity"], + ike_encryption: Union[str, "_models.IkeEncryption"], + ike_integrity: Union[str, "_models.IkeIntegrity"], + dh_group: Union[str, "_models.DhGroup"], + pfs_group: Union[str, "_models.PfsGroup"], + **kwargs: Any + ) -> None: + """ + :keyword sa_life_time_seconds: The IPSec Security Association (also called Quick Mode or Phase + 2 SA) lifetime in seconds for a site to site VPN tunnel. Required. + :paramtype sa_life_time_seconds: int + :keyword sa_data_size_kilobytes: The IPSec Security Association (also called Quick Mode or + Phase 2 SA) payload size in KB for a site to site VPN tunnel. Required. + :paramtype sa_data_size_kilobytes: int + :keyword ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). Required. Known values + are: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", and + "GCMAES256". + :paramtype ipsec_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IpsecEncryption + :keyword ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). Required. Known values + are: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", and "GCMAES256". + :paramtype ipsec_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IpsecIntegrity + :keyword ike_encryption: The IKE encryption algorithm (IKE phase 2). Required. Known values + are: "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", and "GCMAES128". + :paramtype ike_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IkeEncryption + :keyword ike_integrity: The IKE integrity algorithm (IKE phase 2). Required. Known values are: + "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", and "GCMAES128". + :paramtype ike_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IkeIntegrity + :keyword dh_group: The DH Group used in IKE Phase 1 for initial SA. Required. Known values are: + "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", and + "DHGroup24". + :paramtype dh_group: str or ~azure.mgmt.network.v2023_09_01.models.DhGroup + :keyword pfs_group: The Pfs Group used in IKE Phase 2 for new child SA. Required. Known values + are: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", and "PFSMM". + :paramtype pfs_group: str or ~azure.mgmt.network.v2023_09_01.models.PfsGroup + """ + super().__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group + + +class IpTag(_serialization.Model): + """Contains the IpTag associated with the object. + + :ivar ip_tag_type: The IP tag type. Example: FirstPartyUsage. + :vartype ip_tag_type: str + :ivar tag: The value of the IP tag associated with the public IP. Example: SQL. + :vartype tag: str + """ + + _attribute_map = { + "ip_tag_type": {"key": "ipTagType", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + } + + def __init__(self, *, ip_tag_type: Optional[str] = None, tag: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_tag_type: The IP tag type. Example: FirstPartyUsage. + :paramtype ip_tag_type: str + :keyword tag: The value of the IP tag associated with the public IP. Example: SQL. + :paramtype tag: str + """ + super().__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class Ipv6CircuitConnectionConfig(_serialization.Model): + """IPv6 Circuit Connection properties for global reach. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar address_prefix: /125 IP address space to carve out customer addresses for global reach. + :vartype address_prefix: str + :ivar circuit_connection_status: Express Route Circuit connection state. Known values are: + "Connected", "Connecting", and "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.CircuitConnectionStatus + """ + + _validation = { + "circuit_connection_status": {"readonly": True}, + } + + _attribute_map = { + "address_prefix": {"key": "addressPrefix", "type": "str"}, + "circuit_connection_status": {"key": "circuitConnectionStatus", "type": "str"}, + } + + def __init__(self, *, address_prefix: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword address_prefix: /125 IP address space to carve out customer addresses for global + reach. + :paramtype address_prefix: str + """ + super().__init__(**kwargs) + self.address_prefix = address_prefix + self.circuit_connection_status = None + + +class Ipv6ExpressRouteCircuitPeeringConfig(_serialization.Model): + """Contains IPv6 peering config. + + :ivar primary_peer_address_prefix: The primary address prefix. + :vartype primary_peer_address_prefix: str + :ivar secondary_peer_address_prefix: The secondary address prefix. + :vartype secondary_peer_address_prefix: str + :ivar microsoft_peering_config: The Microsoft peering configuration. + :vartype microsoft_peering_config: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringConfig + :ivar route_filter: The reference to the RouteFilter resource. + :vartype route_filter: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar state: The state of peering. Known values are: "Disabled" and "Enabled". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + "primary_peer_address_prefix": {"key": "primaryPeerAddressPrefix", "type": "str"}, + "secondary_peer_address_prefix": {"key": "secondaryPeerAddressPrefix", "type": "str"}, + "microsoft_peering_config": {"key": "microsoftPeeringConfig", "type": "ExpressRouteCircuitPeeringConfig"}, + "route_filter": {"key": "routeFilter", "type": "SubResource"}, + "state": {"key": "state", "type": "str"}, + } + + def __init__( + self, + *, + primary_peer_address_prefix: Optional[str] = None, + secondary_peer_address_prefix: Optional[str] = None, + microsoft_peering_config: Optional["_models.ExpressRouteCircuitPeeringConfig"] = None, + route_filter: Optional["_models.SubResource"] = None, + state: Optional[Union[str, "_models.ExpressRouteCircuitPeeringState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword primary_peer_address_prefix: The primary address prefix. + :paramtype primary_peer_address_prefix: str + :keyword secondary_peer_address_prefix: The secondary address prefix. + :paramtype secondary_peer_address_prefix: str + :keyword microsoft_peering_config: The Microsoft peering configuration. + :paramtype microsoft_peering_config: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringConfig + :keyword route_filter: The reference to the RouteFilter resource. + :paramtype route_filter: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword state: The state of peering. Known values are: "Disabled" and "Enabled". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeeringState + """ + super().__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state + + +class ListHubRouteTablesResult(_serialization.Model): + """List of RouteTables and a URL nextLink to get the next set of results. + + :ivar value: List of RouteTables. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[HubRouteTable]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.HubRouteTable"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of RouteTables. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListHubVirtualNetworkConnectionsResult(_serialization.Model): + """List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + + :ivar value: List of HubVirtualNetworkConnections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[HubVirtualNetworkConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.HubVirtualNetworkConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of HubVirtualNetworkConnections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListP2SVpnGatewaysResult(_serialization.Model): + """Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL + nextLink to get the next set of results. + + :ivar value: List of P2SVpnGateways. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[P2SVpnGateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.P2SVpnGateway"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of P2SVpnGateways. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListRouteMapsResult(_serialization.Model): + """List of RouteMaps and a URL nextLink to get the next set of results. + + :ivar value: List of RouteMaps. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[RouteMap]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.RouteMap"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of RouteMaps. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListRoutingIntentResult(_serialization.Model): + """List of the routing intent result and a URL nextLink to get the next set of results. + + :ivar value: List of RoutingIntent resource. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[RoutingIntent]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.RoutingIntent"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of RoutingIntent resource. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubBgpConnectionResults(_serialization.Model): + """VirtualHubBgpConnections list. + + :ivar value: The list of VirtualHubBgpConnections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BgpConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BgpConnection"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list of VirtualHubBgpConnections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubIpConfigurationResults(_serialization.Model): + """VirtualHubIpConfigurations list. + + :ivar value: The list of VirtualHubIpConfigurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[HubIpConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.HubIpConfiguration"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of VirtualHubIpConfigurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubRouteTableV2SResult(_serialization.Model): + """List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + + :ivar value: List of VirtualHubRouteTableV2s. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualHubRouteTableV2]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualHubRouteTableV2"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of VirtualHubRouteTableV2s. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubsResult(_serialization.Model): + """Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink + to get the next set of results. + + :ivar value: List of VirtualHubs. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualHub]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VirtualHub"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of VirtualHubs. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualNetworkGatewayNatRulesResult(_serialization.Model): + """Result of the request to list all nat rules to a virtual network gateway. It contains a list of + Nat rules and a URL nextLink to get the next set of results. + + :ivar value: List of Nat Rules. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkGatewayNatRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualNetworkGatewayNatRule"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Nat Rules. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualWANsResult(_serialization.Model): + """Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink + to get the next set of results. + + :ivar value: List of VirtualWANs. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualWAN]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VirtualWAN"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of VirtualWANs. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnConnectionsResult(_serialization.Model): + """Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a + list of Vpn Connections and a URL nextLink to get the next set of results. + + :ivar value: List of Vpn Connections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VpnConnection"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of Vpn Connections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnGatewayNatRulesResult(_serialization.Model): + """Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a list of + Nat rules and a URL nextLink to get the next set of results. + + :ivar value: List of Nat Rules. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnGatewayNatRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VpnGatewayNatRule"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Nat Rules. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnGatewaysResult(_serialization.Model): + """Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink + to get the next set of results. + + :ivar value: List of VpnGateways. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnGateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VpnGateway"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of VpnGateways. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnServerConfigurationPolicyGroupsResult(_serialization.Model): # pylint: disable=name-too-long + """Result of the request to list VpnServerConfigurationPolicyGroups. It contains a list of + VpnServerConfigurationPolicyGroups and a URL nextLink to get the next set of results. + + :ivar value: List of VpnServerConfigurationPolicyGroups. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnServerConfigurationPolicyGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VpnServerConfigurationPolicyGroup"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of VpnServerConfigurationPolicyGroups. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnServerConfigurationsResult(_serialization.Model): + """Result of the request to list all VpnServerConfigurations. It contains a list of + VpnServerConfigurations and a URL nextLink to get the next set of results. + + :ivar value: List of VpnServerConfigurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnServerConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VpnServerConfiguration"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of VpnServerConfigurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnSiteLinkConnectionsResult(_serialization.Model): + """Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a + list of Vpn Connections and a URL nextLink to get the next set of results. + + :ivar value: List of VpnSiteLinkConnections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnSiteLinkConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VpnSiteLinkConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of VpnSiteLinkConnections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnSiteLinksResult(_serialization.Model): + """Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL + nextLink to get the next set of results. + + :ivar value: List of VpnSitesLinks. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLink] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnSiteLink]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VpnSiteLink"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of VpnSitesLinks. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLink] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnSitesResult(_serialization.Model): + """Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to + get the next set of results. + + :ivar value: List of VpnSites. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnSite]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VpnSite"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of VpnSites. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class LoadBalancer(Resource): # pylint: disable=too-many-instance-attributes + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the load balancer. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar sku: The load balancer SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.LoadBalancerSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar frontend_ip_configurations: Object representing the frontend IPs to be used for the load + balancer. + :vartype frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :ivar backend_address_pools: Collection of backend address pools used by a load balancer. + :vartype backend_address_pools: list[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :ivar load_balancing_rules: Object collection representing the load balancing rules Gets the + provisioning. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule] + :ivar probes: Collection of probe objects used in the load balancer. + :vartype probes: list[~azure.mgmt.network.v2023_09_01.models.Probe] + :ivar inbound_nat_rules: Collection of inbound NAT Rules used by a load balancer. Defining + inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT + pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are + associated with individual virtual machines cannot reference an Inbound NAT pool. They have to + reference individual inbound NAT rules. + :vartype inbound_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :ivar inbound_nat_pools: Defines an external port range for inbound NAT to a single backend + port on NICs associated with a load balancer. Inbound NAT rules are created automatically for + each NIC associated with the Load Balancer using an external port from this range. Defining an + Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. + Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an inbound NAT pool. They have to reference + individual inbound NAT rules. + :vartype inbound_nat_pools: list[~azure.mgmt.network.v2023_09_01.models.InboundNatPool] + :ivar outbound_rules: The outbound rules. + :vartype outbound_rules: list[~azure.mgmt.network.v2023_09_01.models.OutboundRule] + :ivar resource_guid: The resource GUID property of the load balancer resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the load balancer resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "sku": {"key": "sku", "type": "LoadBalancerSku"}, + "etag": {"key": "etag", "type": "str"}, + "frontend_ip_configurations": { + "key": "properties.frontendIPConfigurations", + "type": "[FrontendIPConfiguration]", + }, + "backend_address_pools": {"key": "properties.backendAddressPools", "type": "[BackendAddressPool]"}, + "load_balancing_rules": {"key": "properties.loadBalancingRules", "type": "[LoadBalancingRule]"}, + "probes": {"key": "properties.probes", "type": "[Probe]"}, + "inbound_nat_rules": {"key": "properties.inboundNatRules", "type": "[InboundNatRule]"}, + "inbound_nat_pools": {"key": "properties.inboundNatPools", "type": "[InboundNatPool]"}, + "outbound_rules": {"key": "properties.outboundRules", "type": "[OutboundRule]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + sku: Optional["_models.LoadBalancerSku"] = None, + frontend_ip_configurations: Optional[List["_models.FrontendIPConfiguration"]] = None, + backend_address_pools: Optional[List["_models.BackendAddressPool"]] = None, + load_balancing_rules: Optional[List["_models.LoadBalancingRule"]] = None, + probes: Optional[List["_models.Probe"]] = None, + inbound_nat_rules: Optional[List["_models.InboundNatRule"]] = None, + inbound_nat_pools: Optional[List["_models.InboundNatPool"]] = None, + outbound_rules: Optional[List["_models.OutboundRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the load balancer. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword sku: The load balancer SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.LoadBalancerSku + :keyword frontend_ip_configurations: Object representing the frontend IPs to be used for the + load balancer. + :paramtype frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :keyword backend_address_pools: Collection of backend address pools used by a load balancer. + :paramtype backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :keyword load_balancing_rules: Object collection representing the load balancing rules Gets the + provisioning. + :paramtype load_balancing_rules: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule] + :keyword probes: Collection of probe objects used in the load balancer. + :paramtype probes: list[~azure.mgmt.network.v2023_09_01.models.Probe] + :keyword inbound_nat_rules: Collection of inbound NAT Rules used by a load balancer. Defining + inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT + pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are + associated with individual virtual machines cannot reference an Inbound NAT pool. They have to + reference individual inbound NAT rules. + :paramtype inbound_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :keyword inbound_nat_pools: Defines an external port range for inbound NAT to a single backend + port on NICs associated with a load balancer. Inbound NAT rules are created automatically for + each NIC associated with the Load Balancer using an external port from this range. Defining an + Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. + Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an inbound NAT pool. They have to reference + individual inbound NAT rules. + :paramtype inbound_nat_pools: list[~azure.mgmt.network.v2023_09_01.models.InboundNatPool] + :keyword outbound_rules: The outbound rules. + :paramtype outbound_rules: list[~azure.mgmt.network.v2023_09_01.models.OutboundRule] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.sku = sku + self.etag = None + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_rules = outbound_rules + self.resource_guid = None + self.provisioning_state = None + + +class LoadBalancerBackendAddress(_serialization.Model): + """Load balancer backend addresses. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the backend address. + :vartype name: str + :ivar virtual_network: Reference to an existing virtual network. + :vartype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar subnet: Reference to an existing subnet. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar ip_address: IP Address belonging to the referenced virtual network. + :vartype ip_address: str + :ivar network_interface_ip_configuration: Reference to IP address defined in network + interfaces. + :vartype network_interface_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar load_balancer_frontend_ip_configuration: Reference to the frontend ip address + configuration defined in regional loadbalancer. + :vartype load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar inbound_nat_rules_port_mapping: Collection of inbound NAT rule port mappings. + :vartype inbound_nat_rules_port_mapping: + list[~azure.mgmt.network.v2023_09_01.models.NatRulePortMapping] + :ivar admin_state: A list of administrative states which once set can override health probe so + that Load Balancer will always forward new connections to backend, or deny new connections and + reset existing connections. Known values are: "None", "Up", and "Down". + :vartype admin_state: str or + ~azure.mgmt.network.v2023_09_01.models.LoadBalancerBackendAddressAdminState + """ + + _validation = { + "network_interface_ip_configuration": {"readonly": True}, + "inbound_nat_rules_port_mapping": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "virtual_network": {"key": "properties.virtualNetwork", "type": "SubResource"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "ip_address": {"key": "properties.ipAddress", "type": "str"}, + "network_interface_ip_configuration": { + "key": "properties.networkInterfaceIPConfiguration", + "type": "SubResource", + }, + "load_balancer_frontend_ip_configuration": { + "key": "properties.loadBalancerFrontendIPConfiguration", + "type": "SubResource", + }, + "inbound_nat_rules_port_mapping": { + "key": "properties.inboundNatRulesPortMapping", + "type": "[NatRulePortMapping]", + }, + "admin_state": {"key": "properties.adminState", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + virtual_network: Optional["_models.SubResource"] = None, + subnet: Optional["_models.SubResource"] = None, + ip_address: Optional[str] = None, + load_balancer_frontend_ip_configuration: Optional["_models.SubResource"] = None, + admin_state: Optional[Union[str, "_models.LoadBalancerBackendAddressAdminState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the backend address. + :paramtype name: str + :keyword virtual_network: Reference to an existing virtual network. + :paramtype virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword subnet: Reference to an existing subnet. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword ip_address: IP Address belonging to the referenced virtual network. + :paramtype ip_address: str + :keyword load_balancer_frontend_ip_configuration: Reference to the frontend ip address + configuration defined in regional loadbalancer. + :paramtype load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword admin_state: A list of administrative states which once set can override health probe + so that Load Balancer will always forward new connections to backend, or deny new connections + and reset existing connections. Known values are: "None", "Up", and "Down". + :paramtype admin_state: str or + ~azure.mgmt.network.v2023_09_01.models.LoadBalancerBackendAddressAdminState + """ + super().__init__(**kwargs) + self.name = name + self.virtual_network = virtual_network + self.subnet = subnet + self.ip_address = ip_address + self.network_interface_ip_configuration = None + self.load_balancer_frontend_ip_configuration = load_balancer_frontend_ip_configuration + self.inbound_nat_rules_port_mapping = None + self.admin_state = admin_state + + +class LoadBalancerBackendAddressPoolListResult(_serialization.Model): + """Response for ListBackendAddressPool API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of backend address pools in a load balancer. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[BackendAddressPool]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.BackendAddressPool"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of backend address pools in a load balancer. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerFrontendIPConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListFrontendIPConfiguration API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of frontend IP configurations in a load balancer. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[FrontendIPConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.FrontendIPConfiguration"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of frontend IP configurations in a load balancer. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerListResult(_serialization.Model): + """Response for ListLoadBalancers API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of load balancers in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[LoadBalancer]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.LoadBalancer"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of load balancers in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerLoadBalancingRuleListResult(_serialization.Model): + """Response for ListLoadBalancingRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of load balancing rules in a load balancer. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[LoadBalancingRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.LoadBalancingRule"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of load balancing rules in a load balancer. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerOutboundRuleListResult(_serialization.Model): + """Response for ListOutboundRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of outbound rules in a load balancer. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.OutboundRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OutboundRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.OutboundRule"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of outbound rules in a load balancer. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.OutboundRule] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerProbeListResult(_serialization.Model): + """Response for ListProbe API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of probes in a load balancer. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.Probe] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Probe]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.Probe"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of probes in a load balancer. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.Probe] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerSku(_serialization.Model): + """SKU of a load balancer. + + :ivar name: Name of a load balancer SKU. Known values are: "Basic", "Standard", and "Gateway". + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.LoadBalancerSkuName + :ivar tier: Tier of a load balancer SKU. Known values are: "Regional" and "Global". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.LoadBalancerSkuTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.LoadBalancerSkuName"]] = None, + tier: Optional[Union[str, "_models.LoadBalancerSkuTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of a load balancer SKU. Known values are: "Basic", "Standard", and + "Gateway". + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.LoadBalancerSkuName + :keyword tier: Tier of a load balancer SKU. Known values are: "Regional" and "Global". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.LoadBalancerSkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class LoadBalancerVipSwapRequest(_serialization.Model): + """The request for a VIP swap. + + :ivar frontend_ip_configurations: A list of frontend IP configuration resources that should + swap VIPs. + :vartype frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.LoadBalancerVipSwapRequestFrontendIPConfiguration] + """ + + _attribute_map = { + "frontend_ip_configurations": { + "key": "frontendIPConfigurations", + "type": "[LoadBalancerVipSwapRequestFrontendIPConfiguration]", + }, + } + + def __init__( + self, + *, + frontend_ip_configurations: Optional[List["_models.LoadBalancerVipSwapRequestFrontendIPConfiguration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword frontend_ip_configurations: A list of frontend IP configuration resources that should + swap VIPs. + :paramtype frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.LoadBalancerVipSwapRequestFrontendIPConfiguration] + """ + super().__init__(**kwargs) + self.frontend_ip_configurations = frontend_ip_configurations + + +class LoadBalancerVipSwapRequestFrontendIPConfiguration(_serialization.Model): # pylint: disable=name-too-long + """VIP swap request's frontend IP configuration object. + + :ivar id: The ID of frontend IP configuration resource. + :vartype id: str + :ivar public_ip_address: A reference to public IP address resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "SubResource"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + public_ip_address: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of frontend IP configuration resource. + :paramtype id: str + :keyword public_ip_address: A reference to public IP address resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.id = id + self.public_ip_address = public_ip_address + + +class LoadBalancingRule(SubResource): # pylint: disable=too-many-instance-attributes + """A load balancing rule for a load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of load balancing rules used + by the load balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar frontend_ip_configuration: A reference to frontend IP addresses. + :vartype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_address_pool: A reference to a pool of DIPs. Inbound traffic is randomly load + balanced across IPs in the backend IPs. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar backend_address_pools: An array of references to pool of DIPs. + :vartype backend_address_pools: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar probe: The reference to the load balancer probe used by the load balancing rule. + :vartype probe: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar protocol: The reference to the transport protocol used by the load balancing rule. Known + values are: "Udp", "Tcp", and "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :ivar load_distribution: The load distribution policy for this rule. Known values are: + "Default", "SourceIP", and "SourceIPProtocol". + :vartype load_distribution: str or ~azure.mgmt.network.v2023_09_01.models.LoadDistribution + :ivar frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 + enables "Any Port". + :vartype frontend_port: int + :ivar backend_port: The port used for internal connections on the endpoint. Acceptable values + are between 0 and 65535. Note that value 0 enables "Any Port". + :vartype backend_port: int + :ivar idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :vartype idle_timeout_in_minutes: int + :ivar enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :vartype enable_floating_ip: bool + :ivar enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + connection termination. This element is only used when the protocol is set to TCP. + :vartype enable_tcp_reset: bool + :ivar disable_outbound_snat: Configures SNAT for the VMs in the backend pool to use the + publicIP address specified in the frontend of the load balancing rule. + :vartype disable_outbound_snat: bool + :ivar provisioning_state: The provisioning state of the load balancing rule resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "frontend_ip_configuration": {"key": "properties.frontendIPConfiguration", "type": "SubResource"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + "backend_address_pools": {"key": "properties.backendAddressPools", "type": "[SubResource]"}, + "probe": {"key": "properties.probe", "type": "SubResource"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "load_distribution": {"key": "properties.loadDistribution", "type": "str"}, + "frontend_port": {"key": "properties.frontendPort", "type": "int"}, + "backend_port": {"key": "properties.backendPort", "type": "int"}, + "idle_timeout_in_minutes": {"key": "properties.idleTimeoutInMinutes", "type": "int"}, + "enable_floating_ip": {"key": "properties.enableFloatingIP", "type": "bool"}, + "enable_tcp_reset": {"key": "properties.enableTcpReset", "type": "bool"}, + "disable_outbound_snat": {"key": "properties.disableOutboundSnat", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + frontend_ip_configuration: Optional["_models.SubResource"] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + backend_address_pools: Optional[List["_models.SubResource"]] = None, + probe: Optional["_models.SubResource"] = None, + protocol: Optional[Union[str, "_models.TransportProtocol"]] = None, + load_distribution: Optional[Union[str, "_models.LoadDistribution"]] = None, + frontend_port: Optional[int] = None, + backend_port: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_floating_ip: Optional[bool] = None, + enable_tcp_reset: Optional[bool] = None, + disable_outbound_snat: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of load balancing rules + used by the load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword frontend_ip_configuration: A reference to frontend IP addresses. + :paramtype frontend_ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword backend_address_pool: A reference to a pool of DIPs. Inbound traffic is randomly load + balanced across IPs in the backend IPs. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword backend_address_pools: An array of references to pool of DIPs. + :paramtype backend_address_pools: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword probe: The reference to the load balancer probe used by the load balancing rule. + :paramtype probe: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword protocol: The reference to the transport protocol used by the load balancing rule. + Known values are: "Udp", "Tcp", and "All". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.TransportProtocol + :keyword load_distribution: The load distribution policy for this rule. Known values are: + "Default", "SourceIP", and "SourceIPProtocol". + :paramtype load_distribution: str or ~azure.mgmt.network.v2023_09_01.models.LoadDistribution + :keyword frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 + enables "Any Port". + :paramtype frontend_port: int + :keyword backend_port: The port used for internal connections on the endpoint. Acceptable + values are between 0 and 65535. Note that value 0 enables "Any Port". + :paramtype backend_port: int + :keyword idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :paramtype idle_timeout_in_minutes: int + :keyword enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :paramtype enable_floating_ip: bool + :keyword enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or + unexpected connection termination. This element is only used when the protocol is set to TCP. + :paramtype enable_tcp_reset: bool + :keyword disable_outbound_snat: Configures SNAT for the VMs in the backend pool to use the + publicIP address specified in the frontend of the load balancing rule. + :paramtype disable_outbound_snat: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.backend_address_pools = backend_address_pools + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = None + + +class LocalNetworkGateway(Resource): # pylint: disable=too-many-instance-attributes + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar local_network_address_space: Local network site address space. + :vartype local_network_address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar gateway_ip_address: IP address of local network gateway. + :vartype gateway_ip_address: str + :ivar fqdn: FQDN of local network gateway. + :vartype fqdn: str + :ivar bgp_settings: Local network gateway's BGP speaker settings. + :vartype bgp_settings: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :ivar resource_guid: The resource GUID property of the local network gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the local network gateway resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "local_network_address_space": {"key": "properties.localNetworkAddressSpace", "type": "AddressSpace"}, + "gateway_ip_address": {"key": "properties.gatewayIpAddress", "type": "str"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "bgp_settings": {"key": "properties.bgpSettings", "type": "BgpSettings"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + local_network_address_space: Optional["_models.AddressSpace"] = None, + gateway_ip_address: Optional[str] = None, + fqdn: Optional[str] = None, + bgp_settings: Optional["_models.BgpSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword local_network_address_space: Local network site address space. + :paramtype local_network_address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword gateway_ip_address: IP address of local network gateway. + :paramtype gateway_ip_address: str + :keyword fqdn: FQDN of local network gateway. + :paramtype fqdn: str + :keyword bgp_settings: Local network gateway's BGP speaker settings. + :paramtype bgp_settings: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.fqdn = fqdn + self.bgp_settings = bgp_settings + self.resource_guid = None + self.provisioning_state = None + + +class LocalNetworkGatewayListResult(_serialization.Model): + """Response for ListLocalNetworkGateways API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of local network gateways that exists in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[LocalNetworkGateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.LocalNetworkGateway"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of local network gateways that exists in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class LogSpecification(_serialization.Model): + """Description of logging specification. + + :ivar name: The name of the specification. + :vartype name: str + :ivar display_name: The display name of the specification. + :vartype display_name: str + :ivar blob_duration: Duration of the blob. + :vartype blob_duration: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "blob_duration": {"key": "blobDuration", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the specification. + :paramtype name: str + :keyword display_name: The display name of the specification. + :paramtype display_name: str + :keyword blob_duration: Duration of the blob. + :paramtype blob_duration: str + """ + super().__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class ManagedRuleGroupOverride(_serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to server. + + :ivar rule_group_name: The managed rule group to override. Required. + :vartype rule_group_name: str + :ivar rules: List of rules that will be disabled. If none specified, all rules in the group + will be disabled. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.ManagedRuleOverride] + """ + + _validation = { + "rule_group_name": {"required": True}, + } + + _attribute_map = { + "rule_group_name": {"key": "ruleGroupName", "type": "str"}, + "rules": {"key": "rules", "type": "[ManagedRuleOverride]"}, + } + + def __init__( + self, *, rule_group_name: str, rules: Optional[List["_models.ManagedRuleOverride"]] = None, **kwargs: Any + ) -> None: + """ + :keyword rule_group_name: The managed rule group to override. Required. + :paramtype rule_group_name: str + :keyword rules: List of rules that will be disabled. If none specified, all rules in the group + will be disabled. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.ManagedRuleOverride] + """ + super().__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules + + +class ManagedRuleOverride(_serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to server. + + :ivar rule_id: Identifier for the managed rule. Required. + :vartype rule_id: str + :ivar state: The state of the managed rule. Defaults to Disabled if not specified. Known values + are: "Disabled" and "Enabled". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.ManagedRuleEnabledState + :ivar action: Describes the override action to be applied when rule matches. Known values are: + "AnomalyScoring", "Allow", "Block", "Log", and "JSChallenge". + :vartype action: str or ~azure.mgmt.network.v2023_09_01.models.ActionType + """ + + _validation = { + "rule_id": {"required": True}, + } + + _attribute_map = { + "rule_id": {"key": "ruleId", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "action": {"key": "action", "type": "str"}, + } + + def __init__( + self, + *, + rule_id: str, + state: Optional[Union[str, "_models.ManagedRuleEnabledState"]] = None, + action: Optional[Union[str, "_models.ActionType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword rule_id: Identifier for the managed rule. Required. + :paramtype rule_id: str + :keyword state: The state of the managed rule. Defaults to Disabled if not specified. Known + values are: "Disabled" and "Enabled". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.ManagedRuleEnabledState + :keyword action: Describes the override action to be applied when rule matches. Known values + are: "AnomalyScoring", "Allow", "Block", "Log", and "JSChallenge". + :paramtype action: str or ~azure.mgmt.network.v2023_09_01.models.ActionType + """ + super().__init__(**kwargs) + self.rule_id = rule_id + self.state = state + self.action = action + + +class ManagedRulesDefinition(_serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to server. + + :ivar exclusions: The Exclusions that are applied on the policy. + :vartype exclusions: list[~azure.mgmt.network.v2023_09_01.models.OwaspCrsExclusionEntry] + :ivar managed_rule_sets: The managed rule sets that are associated with the policy. Required. + :vartype managed_rule_sets: list[~azure.mgmt.network.v2023_09_01.models.ManagedRuleSet] + """ + + _validation = { + "managed_rule_sets": {"required": True}, + } + + _attribute_map = { + "exclusions": {"key": "exclusions", "type": "[OwaspCrsExclusionEntry]"}, + "managed_rule_sets": {"key": "managedRuleSets", "type": "[ManagedRuleSet]"}, + } + + def __init__( + self, + *, + managed_rule_sets: List["_models.ManagedRuleSet"], + exclusions: Optional[List["_models.OwaspCrsExclusionEntry"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword exclusions: The Exclusions that are applied on the policy. + :paramtype exclusions: list[~azure.mgmt.network.v2023_09_01.models.OwaspCrsExclusionEntry] + :keyword managed_rule_sets: The managed rule sets that are associated with the policy. + Required. + :paramtype managed_rule_sets: list[~azure.mgmt.network.v2023_09_01.models.ManagedRuleSet] + """ + super().__init__(**kwargs) + self.exclusions = exclusions + self.managed_rule_sets = managed_rule_sets + + +class ManagedRuleSet(_serialization.Model): + """Defines a managed rule set. + + All required parameters must be populated in order to send to server. + + :ivar rule_set_type: Defines the rule set type to use. Required. + :vartype rule_set_type: str + :ivar rule_set_version: Defines the version of the rule set to use. Required. + :vartype rule_set_version: str + :ivar rule_group_overrides: Defines the rule group overrides to apply to the rule set. + :vartype rule_group_overrides: + list[~azure.mgmt.network.v2023_09_01.models.ManagedRuleGroupOverride] + """ + + _validation = { + "rule_set_type": {"required": True}, + "rule_set_version": {"required": True}, + } + + _attribute_map = { + "rule_set_type": {"key": "ruleSetType", "type": "str"}, + "rule_set_version": {"key": "ruleSetVersion", "type": "str"}, + "rule_group_overrides": {"key": "ruleGroupOverrides", "type": "[ManagedRuleGroupOverride]"}, + } + + def __init__( + self, + *, + rule_set_type: str, + rule_set_version: str, + rule_group_overrides: Optional[List["_models.ManagedRuleGroupOverride"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword rule_set_type: Defines the rule set type to use. Required. + :paramtype rule_set_type: str + :keyword rule_set_version: Defines the version of the rule set to use. Required. + :paramtype rule_set_version: str + :keyword rule_group_overrides: Defines the rule group overrides to apply to the rule set. + :paramtype rule_group_overrides: + list[~azure.mgmt.network.v2023_09_01.models.ManagedRuleGroupOverride] + """ + super().__init__(**kwargs) + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_group_overrides = rule_group_overrides + + +class ManagedServiceIdentity(_serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity. This property will only + be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + includes both an implicitly created identity and a set of user assigned identities. The type + 'None' will remove any identities from the virtual machine. Known values are: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", and "None". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.ResourceIdentityType + :ivar user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.network.v2023_09_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] # pylint: disable=line-too-long + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}", + }, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[ + Dict[ + str, + "_models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", + ] + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: The type of identity used for the resource. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the virtual machine. Known values + are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None". + :paramtype type: str or ~azure.mgmt.network.v2023_09_01.models.ResourceIdentityType + :keyword user_assigned_identities: The list of user identities associated with resource. The + user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.network.v2023_09_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class MatchCondition(_serialization.Model): + """Define match conditions. + + All required parameters must be populated in order to send to server. + + :ivar match_variables: List of match variables. Required. + :vartype match_variables: list[~azure.mgmt.network.v2023_09_01.models.MatchVariable] + :ivar operator: The operator to be matched. Required. Known values are: "IPMatch", "Equal", + "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", "GreaterThanOrEqual", "BeginsWith", + "EndsWith", "Regex", "GeoMatch", and "Any". + :vartype operator: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallOperator + :ivar negation_conditon: Whether this is negate condition or not. + :vartype negation_conditon: bool + :ivar match_values: Match value. Required. + :vartype match_values: list[str] + :ivar transforms: List of transforms. + :vartype transforms: list[str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallTransform] + """ + + _validation = { + "match_variables": {"required": True}, + "operator": {"required": True}, + "match_values": {"required": True}, + } + + _attribute_map = { + "match_variables": {"key": "matchVariables", "type": "[MatchVariable]"}, + "operator": {"key": "operator", "type": "str"}, + "negation_conditon": {"key": "negationConditon", "type": "bool"}, + "match_values": {"key": "matchValues", "type": "[str]"}, + "transforms": {"key": "transforms", "type": "[str]"}, + } + + def __init__( + self, + *, + match_variables: List["_models.MatchVariable"], + operator: Union[str, "_models.WebApplicationFirewallOperator"], + match_values: List[str], + negation_conditon: Optional[bool] = None, + transforms: Optional[List[Union[str, "_models.WebApplicationFirewallTransform"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword match_variables: List of match variables. Required. + :paramtype match_variables: list[~azure.mgmt.network.v2023_09_01.models.MatchVariable] + :keyword operator: The operator to be matched. Required. Known values are: "IPMatch", "Equal", + "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", "GreaterThanOrEqual", "BeginsWith", + "EndsWith", "Regex", "GeoMatch", and "Any". + :paramtype operator: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallOperator + :keyword negation_conditon: Whether this is negate condition or not. + :paramtype negation_conditon: bool + :keyword match_values: Match value. Required. + :paramtype match_values: list[str] + :keyword transforms: List of transforms. + :paramtype transforms: list[str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallTransform] + """ + super().__init__(**kwargs) + self.match_variables = match_variables + self.operator = operator + self.negation_conditon = negation_conditon + self.match_values = match_values + self.transforms = transforms + + +class MatchedRule(_serialization.Model): + """Matched rule. + + :ivar rule_name: Name of the matched network security rule. + :vartype rule_name: str + :ivar action: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + :vartype action: str + """ + + _attribute_map = { + "rule_name": {"key": "ruleName", "type": "str"}, + "action": {"key": "action", "type": "str"}, + } + + def __init__(self, *, rule_name: Optional[str] = None, action: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword rule_name: Name of the matched network security rule. + :paramtype rule_name: str + :keyword action: The network traffic is allowed or denied. Possible values are 'Allow' and + 'Deny'. + :paramtype action: str + """ + super().__init__(**kwargs) + self.rule_name = rule_name + self.action = action + + +class MatchVariable(_serialization.Model): + """Define match variables. + + All required parameters must be populated in order to send to server. + + :ivar variable_name: Match Variable. Required. Known values are: "RemoteAddr", "RequestMethod", + "QueryString", "PostArgs", "RequestUri", "RequestHeaders", "RequestBody", and "RequestCookies". + :vartype variable_name: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallMatchVariable + :ivar selector: The selector of match variable. + :vartype selector: str + """ + + _validation = { + "variable_name": {"required": True}, + } + + _attribute_map = { + "variable_name": {"key": "variableName", "type": "str"}, + "selector": {"key": "selector", "type": "str"}, + } + + def __init__( + self, + *, + variable_name: Union[str, "_models.WebApplicationFirewallMatchVariable"], + selector: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword variable_name: Match Variable. Required. Known values are: "RemoteAddr", + "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeaders", "RequestBody", and + "RequestCookies". + :paramtype variable_name: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallMatchVariable + :keyword selector: The selector of match variable. + :paramtype selector: str + """ + super().__init__(**kwargs) + self.variable_name = variable_name + self.selector = selector + + +class MetricSpecification(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Description of metrics specification. + + :ivar name: The name of the metric. + :vartype name: str + :ivar display_name: The display name of the metric. + :vartype display_name: str + :ivar display_description: The description of the metric. + :vartype display_description: str + :ivar unit: Units the metric to be displayed in. + :vartype unit: str + :ivar aggregation_type: The aggregation type. + :vartype aggregation_type: str + :ivar availabilities: List of availability. + :vartype availabilities: list[~azure.mgmt.network.v2023_09_01.models.Availability] + :ivar enable_regional_mdm_account: Whether regional MDM account enabled. + :vartype enable_regional_mdm_account: bool + :ivar fill_gap_with_zero: Whether gaps would be filled with zeros. + :vartype fill_gap_with_zero: bool + :ivar metric_filter_pattern: Pattern for the filter of the metric. + :vartype metric_filter_pattern: str + :ivar dimensions: List of dimensions. + :vartype dimensions: list[~azure.mgmt.network.v2023_09_01.models.Dimension] + :ivar is_internal: Whether the metric is internal. + :vartype is_internal: bool + :ivar source_mdm_account: The source MDM account. + :vartype source_mdm_account: str + :ivar source_mdm_namespace: The source MDM namespace. + :vartype source_mdm_namespace: str + :ivar resource_id_dimension_name_override: The resource Id dimension name override. + :vartype resource_id_dimension_name_override: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "display_description": {"key": "displayDescription", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "aggregation_type": {"key": "aggregationType", "type": "str"}, + "availabilities": {"key": "availabilities", "type": "[Availability]"}, + "enable_regional_mdm_account": {"key": "enableRegionalMdmAccount", "type": "bool"}, + "fill_gap_with_zero": {"key": "fillGapWithZero", "type": "bool"}, + "metric_filter_pattern": {"key": "metricFilterPattern", "type": "str"}, + "dimensions": {"key": "dimensions", "type": "[Dimension]"}, + "is_internal": {"key": "isInternal", "type": "bool"}, + "source_mdm_account": {"key": "sourceMdmAccount", "type": "str"}, + "source_mdm_namespace": {"key": "sourceMdmNamespace", "type": "str"}, + "resource_id_dimension_name_override": {"key": "resourceIdDimensionNameOverride", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + availabilities: Optional[List["_models.Availability"]] = None, + enable_regional_mdm_account: Optional[bool] = None, + fill_gap_with_zero: Optional[bool] = None, + metric_filter_pattern: Optional[str] = None, + dimensions: Optional[List["_models.Dimension"]] = None, + is_internal: Optional[bool] = None, + source_mdm_account: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the metric. + :paramtype name: str + :keyword display_name: The display name of the metric. + :paramtype display_name: str + :keyword display_description: The description of the metric. + :paramtype display_description: str + :keyword unit: Units the metric to be displayed in. + :paramtype unit: str + :keyword aggregation_type: The aggregation type. + :paramtype aggregation_type: str + :keyword availabilities: List of availability. + :paramtype availabilities: list[~azure.mgmt.network.v2023_09_01.models.Availability] + :keyword enable_regional_mdm_account: Whether regional MDM account enabled. + :paramtype enable_regional_mdm_account: bool + :keyword fill_gap_with_zero: Whether gaps would be filled with zeros. + :paramtype fill_gap_with_zero: bool + :keyword metric_filter_pattern: Pattern for the filter of the metric. + :paramtype metric_filter_pattern: str + :keyword dimensions: List of dimensions. + :paramtype dimensions: list[~azure.mgmt.network.v2023_09_01.models.Dimension] + :keyword is_internal: Whether the metric is internal. + :paramtype is_internal: bool + :keyword source_mdm_account: The source MDM account. + :paramtype source_mdm_account: str + :keyword source_mdm_namespace: The source MDM namespace. + :paramtype source_mdm_namespace: str + :keyword resource_id_dimension_name_override: The resource Id dimension name override. + :paramtype resource_id_dimension_name_override: str + """ + super().__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.enable_regional_mdm_account = enable_regional_mdm_account + self.fill_gap_with_zero = fill_gap_with_zero + self.metric_filter_pattern = metric_filter_pattern + self.dimensions = dimensions + self.is_internal = is_internal + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class MigratedPools(_serialization.Model): + """The response for a migrateToIpBased API. + + :ivar migrated_pools: A list of pools migrated from Nic based to IP based pool. + :vartype migrated_pools: list[str] + """ + + _attribute_map = { + "migrated_pools": {"key": "migratedPools", "type": "[str]"}, + } + + def __init__(self, *, migrated_pools: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword migrated_pools: A list of pools migrated from Nic based to IP based pool. + :paramtype migrated_pools: list[str] + """ + super().__init__(**kwargs) + self.migrated_pools = migrated_pools + + +class MigrateLoadBalancerToIpBasedRequest(_serialization.Model): + """The request for a migrateToIpBased API. + + :ivar pools: A list of pool names that should be migrated from Nic based to IP based pool. + :vartype pools: list[str] + """ + + _attribute_map = { + "pools": {"key": "pools", "type": "[str]"}, + } + + def __init__(self, *, pools: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword pools: A list of pool names that should be migrated from Nic based to IP based pool. + :paramtype pools: list[str] + """ + super().__init__(**kwargs) + self.pools = pools + + +class NatGateway(Resource): # pylint: disable=too-many-instance-attributes + """Nat Gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The nat gateway SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.NatGatewaySku + :ivar zones: A list of availability zones denoting the zone in which Nat Gateway should be + deployed. + :vartype zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar idle_timeout_in_minutes: The idle timeout of the nat gateway. + :vartype idle_timeout_in_minutes: int + :ivar public_ip_addresses: An array of public ip addresses associated with the nat gateway + resource. + :vartype public_ip_addresses: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar public_ip_prefixes: An array of public ip prefixes associated with the nat gateway + resource. + :vartype public_ip_prefixes: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar resource_guid: The resource GUID property of the NAT gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the NAT gateway resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "subnets": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "NatGatewaySku"}, + "zones": {"key": "zones", "type": "[str]"}, + "etag": {"key": "etag", "type": "str"}, + "idle_timeout_in_minutes": {"key": "properties.idleTimeoutInMinutes", "type": "int"}, + "public_ip_addresses": {"key": "properties.publicIpAddresses", "type": "[SubResource]"}, + "public_ip_prefixes": {"key": "properties.publicIpPrefixes", "type": "[SubResource]"}, + "subnets": {"key": "properties.subnets", "type": "[SubResource]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["_models.NatGatewaySku"] = None, + zones: Optional[List[str]] = None, + idle_timeout_in_minutes: Optional[int] = None, + public_ip_addresses: Optional[List["_models.SubResource"]] = None, + public_ip_prefixes: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The nat gateway SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.NatGatewaySku + :keyword zones: A list of availability zones denoting the zone in which Nat Gateway should be + deployed. + :paramtype zones: list[str] + :keyword idle_timeout_in_minutes: The idle timeout of the nat gateway. + :paramtype idle_timeout_in_minutes: int + :keyword public_ip_addresses: An array of public ip addresses associated with the nat gateway + resource. + :paramtype public_ip_addresses: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword public_ip_prefixes: An array of public ip prefixes associated with the nat gateway + resource. + :paramtype public_ip_prefixes: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.zones = zones + self.etag = None + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.public_ip_addresses = public_ip_addresses + self.public_ip_prefixes = public_ip_prefixes + self.subnets = None + self.resource_guid = None + self.provisioning_state = None + + +class NatGatewayListResult(_serialization.Model): + """Response for ListNatGateways API service call. + + :ivar value: A list of Nat Gateways that exists in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NatGateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.NatGateway"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of Nat Gateways that exists in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NatGatewaySku(_serialization.Model): + """SKU of nat gateway. + + :ivar name: Name of Nat Gateway SKU. "Standard" + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.NatGatewaySkuName + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: Optional[Union[str, "_models.NatGatewaySkuName"]] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of Nat Gateway SKU. "Standard" + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.NatGatewaySkuName + """ + super().__init__(**kwargs) + self.name = name + + +class NatRule(FirewallPolicyRule): # pylint: disable=too-many-instance-attributes + """Rule of type nat. + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar rule_type: Rule Type. Required. Known values are: "ApplicationRule", "NetworkRule", and + "NatRule". + :vartype rule_type: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleType + :ivar ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :vartype ip_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleNetworkProtocol] + :ivar source_addresses: List of source IP addresses for this rule. + :vartype source_addresses: list[str] + :ivar destination_addresses: List of destination IP addresses or Service Tags. + :vartype destination_addresses: list[str] + :ivar destination_ports: List of destination ports. + :vartype destination_ports: list[str] + :ivar translated_address: The translated address for this NAT rule. + :vartype translated_address: str + :ivar translated_port: The translated port for this NAT rule. + :vartype translated_port: str + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + :ivar translated_fqdn: The translated FQDN for this NAT rule. + :vartype translated_fqdn: str + """ + + _validation = { + "rule_type": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "rule_type": {"key": "ruleType", "type": "str"}, + "ip_protocols": {"key": "ipProtocols", "type": "[str]"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "destination_addresses": {"key": "destinationAddresses", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + "translated_address": {"key": "translatedAddress", "type": "str"}, + "translated_port": {"key": "translatedPort", "type": "str"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + "translated_fqdn": {"key": "translatedFqdn", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + ip_protocols: Optional[List[Union[str, "_models.FirewallPolicyRuleNetworkProtocol"]]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + translated_address: Optional[str] = None, + translated_port: Optional[str] = None, + source_ip_groups: Optional[List[str]] = None, + translated_fqdn: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + :keyword ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :paramtype ip_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleNetworkProtocol] + :keyword source_addresses: List of source IP addresses for this rule. + :paramtype source_addresses: list[str] + :keyword destination_addresses: List of destination IP addresses or Service Tags. + :paramtype destination_addresses: list[str] + :keyword destination_ports: List of destination ports. + :paramtype destination_ports: list[str] + :keyword translated_address: The translated address for this NAT rule. + :paramtype translated_address: str + :keyword translated_port: The translated port for this NAT rule. + :paramtype translated_port: str + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + :keyword translated_fqdn: The translated FQDN for this NAT rule. + :paramtype translated_fqdn: str + """ + super().__init__(name=name, description=description, **kwargs) + self.rule_type: str = "NatRule" + self.ip_protocols = ip_protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.translated_address = translated_address + self.translated_port = translated_port + self.source_ip_groups = source_ip_groups + self.translated_fqdn = translated_fqdn + + +class NatRulePortMapping(_serialization.Model): + """Individual port mappings for inbound NAT rule created for backend pool. + + :ivar inbound_nat_rule_name: Name of inbound NAT rule. + :vartype inbound_nat_rule_name: str + :ivar frontend_port: Frontend port. + :vartype frontend_port: int + :ivar backend_port: Backend port. + :vartype backend_port: int + """ + + _attribute_map = { + "inbound_nat_rule_name": {"key": "inboundNatRuleName", "type": "str"}, + "frontend_port": {"key": "frontendPort", "type": "int"}, + "backend_port": {"key": "backendPort", "type": "int"}, + } + + def __init__( + self, + *, + inbound_nat_rule_name: Optional[str] = None, + frontend_port: Optional[int] = None, + backend_port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword inbound_nat_rule_name: Name of inbound NAT rule. + :paramtype inbound_nat_rule_name: str + :keyword frontend_port: Frontend port. + :paramtype frontend_port: int + :keyword backend_port: Backend port. + :paramtype backend_port: int + """ + super().__init__(**kwargs) + self.inbound_nat_rule_name = inbound_nat_rule_name + self.frontend_port = frontend_port + self.backend_port = backend_port + + +class NetworkConfigurationDiagnosticParameters(_serialization.Model): + """Parameters to get network configuration diagnostic. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The ID of the target resource to perform network configuration + diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application + Gateway. Required. + :vartype target_resource_id: str + :ivar verbosity_level: Verbosity level. Known values are: "Normal", "Minimum", and "Full". + :vartype verbosity_level: str or ~azure.mgmt.network.v2023_09_01.models.VerbosityLevel + :ivar profiles: List of network configuration diagnostic profiles. Required. + :vartype profiles: + list[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticProfile] + """ + + _validation = { + "target_resource_id": {"required": True}, + "profiles": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + "verbosity_level": {"key": "verbosityLevel", "type": "str"}, + "profiles": {"key": "profiles", "type": "[NetworkConfigurationDiagnosticProfile]"}, + } + + def __init__( + self, + *, + target_resource_id: str, + profiles: List["_models.NetworkConfigurationDiagnosticProfile"], + verbosity_level: Optional[Union[str, "_models.VerbosityLevel"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_resource_id: The ID of the target resource to perform network configuration + diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application + Gateway. Required. + :paramtype target_resource_id: str + :keyword verbosity_level: Verbosity level. Known values are: "Normal", "Minimum", and "Full". + :paramtype verbosity_level: str or ~azure.mgmt.network.v2023_09_01.models.VerbosityLevel + :keyword profiles: List of network configuration diagnostic profiles. Required. + :paramtype profiles: + list[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticProfile] + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + self.verbosity_level = verbosity_level + self.profiles = profiles + + +class NetworkConfigurationDiagnosticProfile(_serialization.Model): + """Parameters to compare with network configuration. + + All required parameters must be populated in order to send to server. + + :ivar direction: The direction of the traffic. Required. Known values are: "Inbound" and + "Outbound". + :vartype direction: str or ~azure.mgmt.network.v2023_09_01.models.Direction + :ivar protocol: Protocol to be verified on. Accepted values are '*', TCP, UDP. Required. + :vartype protocol: str + :ivar source: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. Required. + :vartype source: str + :ivar destination: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + Required. + :vartype destination: str + :ivar destination_port: Traffic destination port. Accepted values are '*' and a single port in + the range (0 - 65535). Required. + :vartype destination_port: str + """ + + _validation = { + "direction": {"required": True}, + "protocol": {"required": True}, + "source": {"required": True}, + "destination": {"required": True}, + "destination_port": {"required": True}, + } + + _attribute_map = { + "direction": {"key": "direction", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "source": {"key": "source", "type": "str"}, + "destination": {"key": "destination", "type": "str"}, + "destination_port": {"key": "destinationPort", "type": "str"}, + } + + def __init__( + self, + *, + direction: Union[str, "_models.Direction"], + protocol: str, + source: str, + destination: str, + destination_port: str, + **kwargs: Any + ) -> None: + """ + :keyword direction: The direction of the traffic. Required. Known values are: "Inbound" and + "Outbound". + :paramtype direction: str or ~azure.mgmt.network.v2023_09_01.models.Direction + :keyword protocol: Protocol to be verified on. Accepted values are '*', TCP, UDP. Required. + :paramtype protocol: str + :keyword source: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + Required. + :paramtype source: str + :keyword destination: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + Tag. Required. + :paramtype destination: str + :keyword destination_port: Traffic destination port. Accepted values are '*' and a single port + in the range (0 - 65535). Required. + :paramtype destination_port: str + """ + super().__init__(**kwargs) + self.direction = direction + self.protocol = protocol + self.source = source + self.destination = destination + self.destination_port = destination_port + + +class NetworkConfigurationDiagnosticResponse(_serialization.Model): + """Results of network configuration diagnostic on the target resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: List of network configuration diagnostic results. + :vartype results: + list[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResult] + """ + + _validation = { + "results": {"readonly": True}, + } + + _attribute_map = { + "results": {"key": "results", "type": "[NetworkConfigurationDiagnosticResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.results = None + + +class NetworkConfigurationDiagnosticResult(_serialization.Model): + """Network configuration diagnostic result corresponded to provided traffic query. + + :ivar profile: Network configuration diagnostic profile. + :vartype profile: ~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticProfile + :ivar network_security_group_result: Network security group result. + :vartype network_security_group_result: + ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroupResult + """ + + _attribute_map = { + "profile": {"key": "profile", "type": "NetworkConfigurationDiagnosticProfile"}, + "network_security_group_result": {"key": "networkSecurityGroupResult", "type": "NetworkSecurityGroupResult"}, + } + + def __init__( + self, + *, + profile: Optional["_models.NetworkConfigurationDiagnosticProfile"] = None, + network_security_group_result: Optional["_models.NetworkSecurityGroupResult"] = None, + **kwargs: Any + ) -> None: + """ + :keyword profile: Network configuration diagnostic profile. + :paramtype profile: + ~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticProfile + :keyword network_security_group_result: Network security group result. + :paramtype network_security_group_result: + ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroupResult + """ + super().__init__(**kwargs) + self.profile = profile + self.network_security_group_result = network_security_group_result + + +class NetworkGroup(ChildResource): + """The network group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description of the network group. + :vartype description: str + :ivar provisioning_state: The provisioning state of the scope assignment resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__(self, *, description: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword description: A description of the network group. + :paramtype description: str + """ + super().__init__(**kwargs) + self.system_data = None + self.description = description + self.provisioning_state = None + self.resource_guid = None + + +class NetworkGroupListResult(_serialization.Model): + """Result of the request to list NetworkGroup. It contains a list of groups and a URL link to get + the next set of results. + + :ivar value: Gets a page of NetworkGroup. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkGroup] + :ivar next_link: Gets the URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.NetworkGroup"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of NetworkGroup. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkGroup] + :keyword next_link: Gets the URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkIntentPolicy(Resource): + """Network Intent Policy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + + +class NetworkIntentPolicyConfiguration(_serialization.Model): + """Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. + + :ivar network_intent_policy_name: The name of the Network Intent Policy for storing in target + subscription. + :vartype network_intent_policy_name: str + :ivar source_network_intent_policy: Source network intent policy. + :vartype source_network_intent_policy: + ~azure.mgmt.network.v2023_09_01.models.NetworkIntentPolicy + """ + + _attribute_map = { + "network_intent_policy_name": {"key": "networkIntentPolicyName", "type": "str"}, + "source_network_intent_policy": {"key": "sourceNetworkIntentPolicy", "type": "NetworkIntentPolicy"}, + } + + def __init__( + self, + *, + network_intent_policy_name: Optional[str] = None, + source_network_intent_policy: Optional["_models.NetworkIntentPolicy"] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_intent_policy_name: The name of the Network Intent Policy for storing in + target subscription. + :paramtype network_intent_policy_name: str + :keyword source_network_intent_policy: Source network intent policy. + :paramtype source_network_intent_policy: + ~azure.mgmt.network.v2023_09_01.models.NetworkIntentPolicy + """ + super().__init__(**kwargs) + self.network_intent_policy_name = network_intent_policy_name + self.source_network_intent_policy = source_network_intent_policy + + +class NetworkInterface(Resource): # pylint: disable=too-many-instance-attributes + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the network interface. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_machine: The reference to a virtual machine. + :vartype virtual_machine: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar network_security_group: The reference to the NetworkSecurityGroup resource. + :vartype network_security_group: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :ivar private_endpoint: A reference to the private endpoint to which the network interface is + linked. + :vartype private_endpoint: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :ivar ip_configurations: A list of IPConfigurations of the network interface. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :ivar dns_settings: The DNS settings in network interface. + :vartype dns_settings: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceDnsSettings + :ivar mac_address: The MAC address of the network interface. + :vartype mac_address: str + :ivar primary: Whether this is a primary network interface on a virtual machine. + :vartype primary: bool + :ivar vnet_encryption_supported: Whether the virtual machine this nic is attached to supports + encryption. + :vartype vnet_encryption_supported: bool + :ivar enable_accelerated_networking: If the network interface is configured for accelerated + networking. Not applicable to VM sizes which require accelerated networking. + :vartype enable_accelerated_networking: bool + :ivar disable_tcp_state_tracking: Indicates whether to disable tcp state tracking. + :vartype disable_tcp_state_tracking: bool + :ivar enable_ip_forwarding: Indicates whether IP forwarding is enabled on this network + interface. + :vartype enable_ip_forwarding: bool + :ivar hosted_workloads: A list of references to linked BareMetal resources. + :vartype hosted_workloads: list[str] + :ivar dscp_configuration: A reference to the dscp configuration to which the network interface + is linked. + :vartype dscp_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar resource_guid: The resource GUID property of the network interface resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network interface resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar workload_type: WorkloadType of the NetworkInterface for BareMetal resources. + :vartype workload_type: str + :ivar nic_type: Type of Network Interface resource. Known values are: "Standard" and "Elastic". + :vartype nic_type: str or ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceNicType + :ivar private_link_service: Privatelinkservice of the network interface resource. + :vartype private_link_service: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService + :ivar migration_phase: Migration phase of Network Interface resource. Known values are: "None", + "Prepare", "Commit", "Abort", and "Committed". + :vartype migration_phase: str or + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceMigrationPhase + :ivar auxiliary_mode: Auxiliary mode of Network Interface resource. Known values are: "None", + "MaxConnections", "Floating", and "AcceleratedConnections". + :vartype auxiliary_mode: str or + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceAuxiliaryMode + :ivar auxiliary_sku: Auxiliary sku of Network Interface resource. Known values are: "None", + "A1", "A2", "A4", and "A8". + :vartype auxiliary_sku: str or + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceAuxiliarySku + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "virtual_machine": {"readonly": True}, + "private_endpoint": {"readonly": True}, + "tap_configurations": {"readonly": True}, + "mac_address": {"readonly": True}, + "primary": {"readonly": True}, + "vnet_encryption_supported": {"readonly": True}, + "hosted_workloads": {"readonly": True}, + "dscp_configuration": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "etag": {"key": "etag", "type": "str"}, + "virtual_machine": {"key": "properties.virtualMachine", "type": "SubResource"}, + "network_security_group": {"key": "properties.networkSecurityGroup", "type": "NetworkSecurityGroup"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[NetworkInterfaceIPConfiguration]"}, + "tap_configurations": {"key": "properties.tapConfigurations", "type": "[NetworkInterfaceTapConfiguration]"}, + "dns_settings": {"key": "properties.dnsSettings", "type": "NetworkInterfaceDnsSettings"}, + "mac_address": {"key": "properties.macAddress", "type": "str"}, + "primary": {"key": "properties.primary", "type": "bool"}, + "vnet_encryption_supported": {"key": "properties.vnetEncryptionSupported", "type": "bool"}, + "enable_accelerated_networking": {"key": "properties.enableAcceleratedNetworking", "type": "bool"}, + "disable_tcp_state_tracking": {"key": "properties.disableTcpStateTracking", "type": "bool"}, + "enable_ip_forwarding": {"key": "properties.enableIPForwarding", "type": "bool"}, + "hosted_workloads": {"key": "properties.hostedWorkloads", "type": "[str]"}, + "dscp_configuration": {"key": "properties.dscpConfiguration", "type": "SubResource"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "workload_type": {"key": "properties.workloadType", "type": "str"}, + "nic_type": {"key": "properties.nicType", "type": "str"}, + "private_link_service": {"key": "properties.privateLinkService", "type": "PrivateLinkService"}, + "migration_phase": {"key": "properties.migrationPhase", "type": "str"}, + "auxiliary_mode": {"key": "properties.auxiliaryMode", "type": "str"}, + "auxiliary_sku": {"key": "properties.auxiliarySku", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + network_security_group: Optional["_models.NetworkSecurityGroup"] = None, + ip_configurations: Optional[List["_models.NetworkInterfaceIPConfiguration"]] = None, + dns_settings: Optional["_models.NetworkInterfaceDnsSettings"] = None, + enable_accelerated_networking: Optional[bool] = None, + disable_tcp_state_tracking: Optional[bool] = None, + enable_ip_forwarding: Optional[bool] = None, + workload_type: Optional[str] = None, + nic_type: Optional[Union[str, "_models.NetworkInterfaceNicType"]] = None, + private_link_service: Optional["_models.PrivateLinkService"] = None, + migration_phase: Optional[Union[str, "_models.NetworkInterfaceMigrationPhase"]] = None, + auxiliary_mode: Optional[Union[str, "_models.NetworkInterfaceAuxiliaryMode"]] = None, + auxiliary_sku: Optional[Union[str, "_models.NetworkInterfaceAuxiliarySku"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the network interface. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword network_security_group: The reference to the NetworkSecurityGroup resource. + :paramtype network_security_group: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :keyword ip_configurations: A list of IPConfigurations of the network interface. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :keyword dns_settings: The DNS settings in network interface. + :paramtype dns_settings: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceDnsSettings + :keyword enable_accelerated_networking: If the network interface is configured for accelerated + networking. Not applicable to VM sizes which require accelerated networking. + :paramtype enable_accelerated_networking: bool + :keyword disable_tcp_state_tracking: Indicates whether to disable tcp state tracking. + :paramtype disable_tcp_state_tracking: bool + :keyword enable_ip_forwarding: Indicates whether IP forwarding is enabled on this network + interface. + :paramtype enable_ip_forwarding: bool + :keyword workload_type: WorkloadType of the NetworkInterface for BareMetal resources. + :paramtype workload_type: str + :keyword nic_type: Type of Network Interface resource. Known values are: "Standard" and + "Elastic". + :paramtype nic_type: str or ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceNicType + :keyword private_link_service: Privatelinkservice of the network interface resource. + :paramtype private_link_service: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService + :keyword migration_phase: Migration phase of Network Interface resource. Known values are: + "None", "Prepare", "Commit", "Abort", and "Committed". + :paramtype migration_phase: str or + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceMigrationPhase + :keyword auxiliary_mode: Auxiliary mode of Network Interface resource. Known values are: + "None", "MaxConnections", "Floating", and "AcceleratedConnections". + :paramtype auxiliary_mode: str or + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceAuxiliaryMode + :keyword auxiliary_sku: Auxiliary sku of Network Interface resource. Known values are: "None", + "A1", "A2", "A4", and "A8". + :paramtype auxiliary_sku: str or + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceAuxiliarySku + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.virtual_machine = None + self.network_security_group = network_security_group + self.private_endpoint = None + self.ip_configurations = ip_configurations + self.tap_configurations = None + self.dns_settings = dns_settings + self.mac_address = None + self.primary = None + self.vnet_encryption_supported = None + self.enable_accelerated_networking = enable_accelerated_networking + self.disable_tcp_state_tracking = disable_tcp_state_tracking + self.enable_ip_forwarding = enable_ip_forwarding + self.hosted_workloads = None + self.dscp_configuration = None + self.resource_guid = None + self.provisioning_state = None + self.workload_type = workload_type + self.nic_type = nic_type + self.private_link_service = private_link_service + self.migration_phase = migration_phase + self.auxiliary_mode = auxiliary_mode + self.auxiliary_sku = auxiliary_sku + + +class NetworkInterfaceAssociation(_serialization.Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :ivar security_rules: Collection of custom security rules. + :vartype security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "security_rules": {"key": "securityRules", "type": "[SecurityRule]"}, + } + + def __init__(self, *, security_rules: Optional[List["_models.SecurityRule"]] = None, **kwargs: Any) -> None: + """ + :keyword security_rules: Collection of custom security rules. + :paramtype security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + """ + super().__init__(**kwargs) + self.id = None + self.security_rules = security_rules + + +class NetworkInterfaceDnsSettings(_serialization.Model): + """DNS settings of a network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar dns_servers: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure + provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be + the only value in dnsServers collection. + :vartype dns_servers: list[str] + :ivar applied_dns_servers: If the VM that uses this NIC is part of an Availability Set, then + this list will have the union of all DNS servers from all NICs that are part of the + Availability Set. This property is what is configured on each of those VMs. + :vartype applied_dns_servers: list[str] + :ivar internal_dns_name_label: Relative DNS name for this NIC used for internal communications + between VMs in the same virtual network. + :vartype internal_dns_name_label: str + :ivar internal_fqdn: Fully qualified DNS name supporting internal communications between VMs in + the same virtual network. + :vartype internal_fqdn: str + :ivar internal_domain_name_suffix: Even if internalDnsNameLabel is not specified, a DNS entry + is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the + VM name with the value of internalDomainNameSuffix. + :vartype internal_domain_name_suffix: str + """ + + _validation = { + "applied_dns_servers": {"readonly": True}, + "internal_fqdn": {"readonly": True}, + "internal_domain_name_suffix": {"readonly": True}, + } + + _attribute_map = { + "dns_servers": {"key": "dnsServers", "type": "[str]"}, + "applied_dns_servers": {"key": "appliedDnsServers", "type": "[str]"}, + "internal_dns_name_label": {"key": "internalDnsNameLabel", "type": "str"}, + "internal_fqdn": {"key": "internalFqdn", "type": "str"}, + "internal_domain_name_suffix": {"key": "internalDomainNameSuffix", "type": "str"}, + } + + def __init__( + self, *, dns_servers: Optional[List[str]] = None, internal_dns_name_label: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword dns_servers: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + must be the only value in dnsServers collection. + :paramtype dns_servers: list[str] + :keyword internal_dns_name_label: Relative DNS name for this NIC used for internal + communications between VMs in the same virtual network. + :paramtype internal_dns_name_label: str + """ + super().__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = None + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = None + self.internal_domain_name_suffix = None + + +class NetworkInterfaceIPConfiguration(SubResource): # pylint: disable=too-many-instance-attributes + """IPConfiguration in a network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar gateway_load_balancer: The reference to gateway load balancer frontend IP. + :vartype gateway_load_balancer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar virtual_network_taps: The reference to Virtual Network Taps. + :vartype virtual_network_taps: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :ivar application_gateway_backend_address_pools: The reference to + ApplicationGatewayBackendAddressPool resource. + :vartype application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool] + :ivar load_balancer_backend_address_pools: The reference to LoadBalancerBackendAddressPool + resource. + :vartype load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :ivar load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules. + :vartype load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :ivar private_ip_address: Private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Known values are: "IPv4" and "IPv6". + :vartype private_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :ivar subnet: Subnet bound to the IP configuration. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar primary: Whether this is a primary customer address on the network interface. + :vartype primary: bool + :ivar public_ip_address: Public IP address bound to the IP configuration. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :ivar application_security_groups: Application security groups in which the IP configuration is + included. + :vartype application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :ivar provisioning_state: The provisioning state of the network interface IP configuration. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "private_link_connection_properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "gateway_load_balancer": {"key": "properties.gatewayLoadBalancer", "type": "SubResource"}, + "virtual_network_taps": {"key": "properties.virtualNetworkTaps", "type": "[VirtualNetworkTap]"}, + "application_gateway_backend_address_pools": { + "key": "properties.applicationGatewayBackendAddressPools", + "type": "[ApplicationGatewayBackendAddressPool]", + }, + "load_balancer_backend_address_pools": { + "key": "properties.loadBalancerBackendAddressPools", + "type": "[BackendAddressPool]", + }, + "load_balancer_inbound_nat_rules": { + "key": "properties.loadBalancerInboundNatRules", + "type": "[InboundNatRule]", + }, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "private_ip_address_version": {"key": "properties.privateIPAddressVersion", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "primary": {"key": "properties.primary", "type": "bool"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "PublicIPAddress"}, + "application_security_groups": { + "key": "properties.applicationSecurityGroups", + "type": "[ApplicationSecurityGroup]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_link_connection_properties": { + "key": "properties.privateLinkConnectionProperties", + "type": "NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties", + }, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + gateway_load_balancer: Optional["_models.SubResource"] = None, + virtual_network_taps: Optional[List["_models.VirtualNetworkTap"]] = None, + application_gateway_backend_address_pools: Optional[ + List["_models.ApplicationGatewayBackendAddressPool"] + ] = None, + load_balancer_backend_address_pools: Optional[List["_models.BackendAddressPool"]] = None, + load_balancer_inbound_nat_rules: Optional[List["_models.InboundNatRule"]] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + private_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + subnet: Optional["_models.Subnet"] = None, + primary: Optional[bool] = None, + public_ip_address: Optional["_models.PublicIPAddress"] = None, + application_security_groups: Optional[List["_models.ApplicationSecurityGroup"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type: Resource type. + :paramtype type: str + :keyword gateway_load_balancer: The reference to gateway load balancer frontend IP. + :paramtype gateway_load_balancer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword virtual_network_taps: The reference to Virtual Network Taps. + :paramtype virtual_network_taps: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :keyword application_gateway_backend_address_pools: The reference to + ApplicationGatewayBackendAddressPool resource. + :paramtype application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendAddressPool] + :keyword load_balancer_backend_address_pools: The reference to LoadBalancerBackendAddressPool + resource. + :paramtype load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :keyword load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules. + :paramtype load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :keyword private_ip_address: Private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Known values are: "IPv4" and "IPv6". + :paramtype private_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :keyword subnet: Subnet bound to the IP configuration. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword primary: Whether this is a primary customer address on the network interface. + :paramtype primary: bool + :keyword public_ip_address: Public IP address bound to the IP configuration. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :keyword application_security_groups: Application security groups in which the IP configuration + is included. + :paramtype application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.gateway_load_balancer = gateway_load_balancer + self.virtual_network_taps = virtual_network_taps + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.application_security_groups = application_security_groups + self.provisioning_state = None + self.private_link_connection_properties = None + + +class NetworkInterfaceIPConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for list ip configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of ip configurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkInterfaceIPConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.NetworkInterfaceIPConfiguration"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of ip configurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties( + _serialization.Model +): # pylint: disable=name-too-long + """PrivateLinkConnection properties for the network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: The group ID for current private link connection. + :vartype group_id: str + :ivar required_member_name: The required member name for current private link connection. + :vartype required_member_name: str + :ivar fqdns: List of FQDNs for current private link connection. + :vartype fqdns: list[str] + """ + + _validation = { + "group_id": {"readonly": True}, + "required_member_name": {"readonly": True}, + "fqdns": {"readonly": True}, + } + + _attribute_map = { + "group_id": {"key": "groupId", "type": "str"}, + "required_member_name": {"key": "requiredMemberName", "type": "str"}, + "fqdns": {"key": "fqdns", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.group_id = None + self.required_member_name = None + self.fqdns = None + + +class NetworkInterfaceListResult(_serialization.Model): + """Response for the ListNetworkInterface API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network interfaces in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkInterface]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.NetworkInterface"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of network interfaces in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkInterfaceLoadBalancerListResult(_serialization.Model): + """Response for list ip configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of load balancers. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[LoadBalancer]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.LoadBalancer"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of load balancers. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkInterfaceTapConfiguration(SubResource): + """Tap configuration in a Network Interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar virtual_network_tap: The reference to the Virtual Network Tap resource. + :vartype virtual_network_tap: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :ivar provisioning_state: The provisioning state of the network interface tap configuration + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "virtual_network_tap": {"key": "properties.virtualNetworkTap", "type": "VirtualNetworkTap"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + virtual_network_tap: Optional["_models.VirtualNetworkTap"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword virtual_network_tap: The reference to the Virtual Network Tap resource. + :paramtype virtual_network_tap: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.virtual_network_tap = virtual_network_tap + self.provisioning_state = None + + +class NetworkInterfaceTapConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for list tap configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of tap configurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkInterfaceTapConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.NetworkInterfaceTapConfiguration"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of tap configurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkManager(Resource): # pylint: disable=too-many-instance-attributes + """The Managed Network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description of the network manager. + :vartype description: str + :ivar network_manager_scopes: Scope of Network Manager. + :vartype network_manager_scopes: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerPropertiesNetworkManagerScopes + :ivar network_manager_scope_accesses: Scope Access. + :vartype network_manager_scope_accesses: list[str or + ~azure.mgmt.network.v2023_09_01.models.ConfigurationType] + :ivar provisioning_state: The provisioning state of the network manager resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "network_manager_scopes": { + "key": "properties.networkManagerScopes", + "type": "NetworkManagerPropertiesNetworkManagerScopes", + }, + "network_manager_scope_accesses": {"key": "properties.networkManagerScopeAccesses", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + network_manager_scopes: Optional["_models.NetworkManagerPropertiesNetworkManagerScopes"] = None, + network_manager_scope_accesses: Optional[List[Union[str, "_models.ConfigurationType"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword description: A description of the network manager. + :paramtype description: str + :keyword network_manager_scopes: Scope of Network Manager. + :paramtype network_manager_scopes: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerPropertiesNetworkManagerScopes + :keyword network_manager_scope_accesses: Scope Access. + :paramtype network_manager_scope_accesses: list[str or + ~azure.mgmt.network.v2023_09_01.models.ConfigurationType] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.system_data = None + self.description = description + self.network_manager_scopes = network_manager_scopes + self.network_manager_scope_accesses = network_manager_scope_accesses + self.provisioning_state = None + self.resource_guid = None + + +class NetworkManagerCommit(_serialization.Model): + """Network Manager Commit. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar commit_id: Commit Id. + :vartype commit_id: str + :ivar target_locations: List of target locations. Required. + :vartype target_locations: list[str] + :ivar configuration_ids: List of configuration ids. + :vartype configuration_ids: list[str] + :ivar commit_type: Commit Type. Required. Known values are: "SecurityAdmin" and "Connectivity". + :vartype commit_type: str or ~azure.mgmt.network.v2023_09_01.models.ConfigurationType + """ + + _validation = { + "commit_id": {"readonly": True}, + "target_locations": {"required": True}, + "commit_type": {"required": True}, + } + + _attribute_map = { + "commit_id": {"key": "commitId", "type": "str"}, + "target_locations": {"key": "targetLocations", "type": "[str]"}, + "configuration_ids": {"key": "configurationIds", "type": "[str]"}, + "commit_type": {"key": "commitType", "type": "str"}, + } + + def __init__( + self, + *, + target_locations: List[str], + commit_type: Union[str, "_models.ConfigurationType"], + configuration_ids: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_locations: List of target locations. Required. + :paramtype target_locations: list[str] + :keyword configuration_ids: List of configuration ids. + :paramtype configuration_ids: list[str] + :keyword commit_type: Commit Type. Required. Known values are: "SecurityAdmin" and + "Connectivity". + :paramtype commit_type: str or ~azure.mgmt.network.v2023_09_01.models.ConfigurationType + """ + super().__init__(**kwargs) + self.commit_id = None + self.target_locations = target_locations + self.configuration_ids = configuration_ids + self.commit_type = commit_type + + +class NetworkManagerConnection(ChildResource): + """The Network Manager Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar network_manager_id: Network Manager Id. + :vartype network_manager_id: str + :ivar connection_state: Connection state. Known values are: "Connected", "Pending", "Conflict", + "Revoked", and "Rejected". + :vartype connection_state: str or ~azure.mgmt.network.v2023_09_01.models.ScopeConnectionState + :ivar description: A description of the network manager connection. + :vartype description: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "connection_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "network_manager_id": {"key": "properties.networkManagerId", "type": "str"}, + "connection_state": {"key": "properties.connectionState", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + } + + def __init__( + self, *, network_manager_id: Optional[str] = None, description: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword network_manager_id: Network Manager Id. + :paramtype network_manager_id: str + :keyword description: A description of the network manager connection. + :paramtype description: str + """ + super().__init__(**kwargs) + self.system_data = None + self.network_manager_id = network_manager_id + self.connection_state = None + self.description = description + + +class NetworkManagerConnectionListResult(_serialization.Model): + """List of network manager connections. + + :ivar value: List of network manager connections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection] + :ivar next_link: Gets the URL to get the next page of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkManagerConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkManagerConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of network manager connections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection] + :keyword next_link: Gets the URL to get the next page of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkManagerDeploymentStatus(_serialization.Model): + """Network Manager Deployment Status. + + :ivar commit_time: Commit Time. + :vartype commit_time: ~datetime.datetime + :ivar region: Region Name. + :vartype region: str + :ivar deployment_status: Deployment Status. Known values are: "NotStarted", "Deploying", + "Deployed", and "Failed". + :vartype deployment_status: str or ~azure.mgmt.network.v2023_09_01.models.DeploymentStatus + :ivar configuration_ids: List of configuration ids. + :vartype configuration_ids: list[str] + :ivar deployment_type: Configuration Deployment Type. Known values are: "SecurityAdmin" and + "Connectivity". + :vartype deployment_type: str or ~azure.mgmt.network.v2023_09_01.models.ConfigurationType + :ivar error_message: Error Message. + :vartype error_message: str + """ + + _attribute_map = { + "commit_time": {"key": "commitTime", "type": "iso-8601"}, + "region": {"key": "region", "type": "str"}, + "deployment_status": {"key": "deploymentStatus", "type": "str"}, + "configuration_ids": {"key": "configurationIds", "type": "[str]"}, + "deployment_type": {"key": "deploymentType", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + } + + def __init__( + self, + *, + commit_time: Optional[datetime.datetime] = None, + region: Optional[str] = None, + deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = None, + configuration_ids: Optional[List[str]] = None, + deployment_type: Optional[Union[str, "_models.ConfigurationType"]] = None, + error_message: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword commit_time: Commit Time. + :paramtype commit_time: ~datetime.datetime + :keyword region: Region Name. + :paramtype region: str + :keyword deployment_status: Deployment Status. Known values are: "NotStarted", "Deploying", + "Deployed", and "Failed". + :paramtype deployment_status: str or ~azure.mgmt.network.v2023_09_01.models.DeploymentStatus + :keyword configuration_ids: List of configuration ids. + :paramtype configuration_ids: list[str] + :keyword deployment_type: Configuration Deployment Type. Known values are: "SecurityAdmin" and + "Connectivity". + :paramtype deployment_type: str or ~azure.mgmt.network.v2023_09_01.models.ConfigurationType + :keyword error_message: Error Message. + :paramtype error_message: str + """ + super().__init__(**kwargs) + self.commit_time = commit_time + self.region = region + self.deployment_status = deployment_status + self.configuration_ids = configuration_ids + self.deployment_type = deployment_type + self.error_message = error_message + + +class NetworkManagerDeploymentStatusListResult(_serialization.Model): + """A list of Network Manager Deployment Status. + + :ivar value: Gets a page of Network Manager Deployment Status. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatus] + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkManagerDeploymentStatus]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkManagerDeploymentStatus"]] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of Network Manager Deployment Status. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatus] + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.value = value + self.skip_token = skip_token + + +class NetworkManagerDeploymentStatusParameter(_serialization.Model): + """Network Manager Deployment Status Parameter. + + :ivar regions: List of locations. + :vartype regions: list[str] + :ivar deployment_types: List of deployment types. + :vartype deployment_types: list[str or + ~azure.mgmt.network.v2023_09_01.models.ConfigurationType] + :ivar skip_token: Continuation token for pagination, capturing the next page size and offset, + as well as the context of the query. + :vartype skip_token: str + """ + + _attribute_map = { + "regions": {"key": "regions", "type": "[str]"}, + "deployment_types": {"key": "deploymentTypes", "type": "[str]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + deployment_types: Optional[List[Union[str, "_models.ConfigurationType"]]] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword regions: List of locations. + :paramtype regions: list[str] + :keyword deployment_types: List of deployment types. + :paramtype deployment_types: list[str or + ~azure.mgmt.network.v2023_09_01.models.ConfigurationType] + :keyword skip_token: Continuation token for pagination, capturing the next page size and + offset, as well as the context of the query. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.regions = regions + self.deployment_types = deployment_types + self.skip_token = skip_token + + +class NetworkManagerEffectiveConnectivityConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long + """Result of the request to list networkManagerEffectiveConnectivityConfiguration. It contains a + list of groups and a skiptoken to get the next set of results. + + :ivar value: Gets a page of NetworkManagerEffectiveConnectivityConfiguration. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveConnectivityConfiguration] + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[EffectiveConnectivityConfiguration]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.EffectiveConnectivityConfiguration"]] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of NetworkManagerEffectiveConnectivityConfiguration. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.EffectiveConnectivityConfiguration] + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.value = value + self.skip_token = skip_token + + +class NetworkManagerEffectiveSecurityAdminRulesListResult(_serialization.Model): # pylint: disable=name-too-long + """Result of the request to list networkManagerEffectiveSecurityAdminRules. It contains a list of + groups and a skiptoken to get the next set of results. + + :ivar value: Gets a page of NetworkManagerEffectiveSecurityAdminRules. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveBaseSecurityAdminRule] + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[EffectiveBaseSecurityAdminRule]"}, + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.EffectiveBaseSecurityAdminRule"]] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of NetworkManagerEffectiveSecurityAdminRules. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.EffectiveBaseSecurityAdminRule] + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.value = value + self.skip_token = skip_token + + +class NetworkManagerListResult(_serialization.Model): + """Result of the request to list NetworkManager. It contains a list of network managers and a URL + link to get the next set of results. + + :ivar value: Gets a page of NetworkManager. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkManager] + :ivar next_link: Gets the URL to get the next page of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkManager]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.NetworkManager"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of NetworkManager. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkManager] + :keyword next_link: Gets the URL to get the next page of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkManagerPropertiesNetworkManagerScopes(_serialization.Model): # pylint: disable=name-too-long + """Scope of Network Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar management_groups: List of management groups. + :vartype management_groups: list[str] + :ivar subscriptions: List of subscriptions. + :vartype subscriptions: list[str] + :ivar cross_tenant_scopes: List of cross tenant scopes. + :vartype cross_tenant_scopes: list[~azure.mgmt.network.v2023_09_01.models.CrossTenantScopes] + """ + + _validation = { + "cross_tenant_scopes": {"readonly": True}, + } + + _attribute_map = { + "management_groups": {"key": "managementGroups", "type": "[str]"}, + "subscriptions": {"key": "subscriptions", "type": "[str]"}, + "cross_tenant_scopes": {"key": "crossTenantScopes", "type": "[CrossTenantScopes]"}, + } + + def __init__( + self, *, management_groups: Optional[List[str]] = None, subscriptions: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword management_groups: List of management groups. + :paramtype management_groups: list[str] + :keyword subscriptions: List of subscriptions. + :paramtype subscriptions: list[str] + """ + super().__init__(**kwargs) + self.management_groups = management_groups + self.subscriptions = subscriptions + self.cross_tenant_scopes = None + + +class NetworkManagerSecurityGroupItem(_serialization.Model): + """Network manager security group item. + + All required parameters must be populated in order to send to server. + + :ivar network_group_id: Network manager group Id. Required. + :vartype network_group_id: str + """ + + _validation = { + "network_group_id": {"required": True}, + } + + _attribute_map = { + "network_group_id": {"key": "networkGroupId", "type": "str"}, + } + + def __init__(self, *, network_group_id: str, **kwargs: Any) -> None: + """ + :keyword network_group_id: Network manager group Id. Required. + :paramtype network_group_id: str + """ + super().__init__(**kwargs) + self.network_group_id = network_group_id + + +class NetworkProfile(Resource): + """Network profile resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar container_network_interfaces: List of child container network interfaces. + :vartype container_network_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.ContainerNetworkInterface] + :ivar container_network_interface_configurations: List of chid container network interface + configurations. + :vartype container_network_interface_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ContainerNetworkInterfaceConfiguration] + :ivar resource_guid: The resource GUID property of the network profile resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network profile resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "container_network_interfaces": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "container_network_interfaces": { + "key": "properties.containerNetworkInterfaces", + "type": "[ContainerNetworkInterface]", + }, + "container_network_interface_configurations": { + "key": "properties.containerNetworkInterfaceConfigurations", + "type": "[ContainerNetworkInterfaceConfiguration]", + }, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + container_network_interface_configurations: Optional[ + List["_models.ContainerNetworkInterfaceConfiguration"] + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword container_network_interface_configurations: List of chid container network interface + configurations. + :paramtype container_network_interface_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ContainerNetworkInterfaceConfiguration] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.container_network_interfaces = None + self.container_network_interface_configurations = container_network_interface_configurations + self.resource_guid = None + self.provisioning_state = None + + +class NetworkProfileListResult(_serialization.Model): + """Response for ListNetworkProfiles API service call. + + :ivar value: A list of network profiles that exist in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkProfile] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.NetworkProfile"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of network profiles that exist in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkProfile] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkRule(FirewallPolicyRule): + """Rule of type network. + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the rule. + :vartype name: str + :ivar description: Description of the rule. + :vartype description: str + :ivar rule_type: Rule Type. Required. Known values are: "ApplicationRule", "NetworkRule", and + "NatRule". + :vartype rule_type: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleType + :ivar ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :vartype ip_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleNetworkProtocol] + :ivar source_addresses: List of source IP addresses for this rule. + :vartype source_addresses: list[str] + :ivar destination_addresses: List of destination IP addresses or Service Tags. + :vartype destination_addresses: list[str] + :ivar destination_ports: List of destination ports. + :vartype destination_ports: list[str] + :ivar source_ip_groups: List of source IpGroups for this rule. + :vartype source_ip_groups: list[str] + :ivar destination_ip_groups: List of destination IpGroups for this rule. + :vartype destination_ip_groups: list[str] + :ivar destination_fqdns: List of destination FQDNs. + :vartype destination_fqdns: list[str] + """ + + _validation = { + "rule_type": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "rule_type": {"key": "ruleType", "type": "str"}, + "ip_protocols": {"key": "ipProtocols", "type": "[str]"}, + "source_addresses": {"key": "sourceAddresses", "type": "[str]"}, + "destination_addresses": {"key": "destinationAddresses", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + "source_ip_groups": {"key": "sourceIpGroups", "type": "[str]"}, + "destination_ip_groups": {"key": "destinationIpGroups", "type": "[str]"}, + "destination_fqdns": {"key": "destinationFqdns", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + ip_protocols: Optional[List[Union[str, "_models.FirewallPolicyRuleNetworkProtocol"]]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + destination_ip_groups: Optional[List[str]] = None, + destination_fqdns: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the rule. + :paramtype name: str + :keyword description: Description of the rule. + :paramtype description: str + :keyword ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :paramtype ip_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleNetworkProtocol] + :keyword source_addresses: List of source IP addresses for this rule. + :paramtype source_addresses: list[str] + :keyword destination_addresses: List of destination IP addresses or Service Tags. + :paramtype destination_addresses: list[str] + :keyword destination_ports: List of destination ports. + :paramtype destination_ports: list[str] + :keyword source_ip_groups: List of source IpGroups for this rule. + :paramtype source_ip_groups: list[str] + :keyword destination_ip_groups: List of destination IpGroups for this rule. + :paramtype destination_ip_groups: list[str] + :keyword destination_fqdns: List of destination FQDNs. + :paramtype destination_fqdns: list[str] + """ + super().__init__(name=name, description=description, **kwargs) + self.rule_type: str = "NetworkRule" + self.ip_protocols = ip_protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.source_ip_groups = source_ip_groups + self.destination_ip_groups = destination_ip_groups + self.destination_fqdns = destination_fqdns + + +class NetworkSecurityGroup(Resource): # pylint: disable=too-many-instance-attributes + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar flush_connection: When enabled, flows created from Network Security Group connections + will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + :vartype flush_connection: bool + :ivar security_rules: A collection of security rules of the network security group. + :vartype security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :ivar resource_guid: The resource GUID property of the network security group resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network security group resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "default_security_rules": {"readonly": True}, + "network_interfaces": {"readonly": True}, + "subnets": {"readonly": True}, + "flow_logs": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "flush_connection": {"key": "properties.flushConnection", "type": "bool"}, + "security_rules": {"key": "properties.securityRules", "type": "[SecurityRule]"}, + "default_security_rules": {"key": "properties.defaultSecurityRules", "type": "[SecurityRule]"}, + "network_interfaces": {"key": "properties.networkInterfaces", "type": "[NetworkInterface]"}, + "subnets": {"key": "properties.subnets", "type": "[Subnet]"}, + "flow_logs": {"key": "properties.flowLogs", "type": "[FlowLog]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + flush_connection: Optional[bool] = None, + security_rules: Optional[List["_models.SecurityRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword flush_connection: When enabled, flows created from Network Security Group connections + will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + :paramtype flush_connection: bool + :keyword security_rules: A collection of security rules of the network security group. + :paramtype security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.flush_connection = flush_connection + self.security_rules = security_rules + self.default_security_rules = None + self.network_interfaces = None + self.subnets = None + self.flow_logs = None + self.resource_guid = None + self.provisioning_state = None + + +class NetworkSecurityGroupListResult(_serialization.Model): + """Response for ListNetworkSecurityGroups API service call. + + :ivar value: A list of NetworkSecurityGroup resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkSecurityGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkSecurityGroup"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of NetworkSecurityGroup resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkSecurityGroupResult(_serialization.Model): + """Network configuration diagnostic result corresponded provided traffic query. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar security_rule_access_result: The network traffic is allowed or denied. Known values are: + "Allow" and "Deny". + :vartype security_rule_access_result: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAccess + :ivar evaluated_network_security_groups: List of results network security groups diagnostic. + :vartype evaluated_network_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.EvaluatedNetworkSecurityGroup] + """ + + _validation = { + "evaluated_network_security_groups": {"readonly": True}, + } + + _attribute_map = { + "security_rule_access_result": {"key": "securityRuleAccessResult", "type": "str"}, + "evaluated_network_security_groups": { + "key": "evaluatedNetworkSecurityGroups", + "type": "[EvaluatedNetworkSecurityGroup]", + }, + } + + def __init__( + self, *, security_rule_access_result: Optional[Union[str, "_models.SecurityRuleAccess"]] = None, **kwargs: Any + ) -> None: + """ + :keyword security_rule_access_result: The network traffic is allowed or denied. Known values + are: "Allow" and "Deny". + :paramtype security_rule_access_result: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAccess + """ + super().__init__(**kwargs) + self.security_rule_access_result = security_rule_access_result + self.evaluated_network_security_groups = None + + +class NetworkSecurityRulesEvaluationResult(_serialization.Model): + """Network security rules evaluation result. + + :ivar name: Name of the network security rule. + :vartype name: str + :ivar protocol_matched: Value indicating whether protocol is matched. + :vartype protocol_matched: bool + :ivar source_matched: Value indicating whether source is matched. + :vartype source_matched: bool + :ivar source_port_matched: Value indicating whether source port is matched. + :vartype source_port_matched: bool + :ivar destination_matched: Value indicating whether destination is matched. + :vartype destination_matched: bool + :ivar destination_port_matched: Value indicating whether destination port is matched. + :vartype destination_port_matched: bool + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "protocol_matched": {"key": "protocolMatched", "type": "bool"}, + "source_matched": {"key": "sourceMatched", "type": "bool"}, + "source_port_matched": {"key": "sourcePortMatched", "type": "bool"}, + "destination_matched": {"key": "destinationMatched", "type": "bool"}, + "destination_port_matched": {"key": "destinationPortMatched", "type": "bool"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + protocol_matched: Optional[bool] = None, + source_matched: Optional[bool] = None, + source_port_matched: Optional[bool] = None, + destination_matched: Optional[bool] = None, + destination_port_matched: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the network security rule. + :paramtype name: str + :keyword protocol_matched: Value indicating whether protocol is matched. + :paramtype protocol_matched: bool + :keyword source_matched: Value indicating whether source is matched. + :paramtype source_matched: bool + :keyword source_port_matched: Value indicating whether source port is matched. + :paramtype source_port_matched: bool + :keyword destination_matched: Value indicating whether destination is matched. + :paramtype destination_matched: bool + :keyword destination_port_matched: Value indicating whether destination port is matched. + :paramtype destination_port_matched: bool + """ + super().__init__(**kwargs) + self.name = name + self.protocol_matched = protocol_matched + self.source_matched = source_matched + self.source_port_matched = source_port_matched + self.destination_matched = destination_matched + self.destination_port_matched = destination_port_matched + + +class NetworkVirtualAppliance(Resource): # pylint: disable=too-many-instance-attributes + """NetworkVirtualAppliance Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The service principal that has read access to cloud-init and config blob. + :vartype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar nva_sku: Network Virtual Appliance SKU. + :vartype nva_sku: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSkuProperties + :ivar address_prefix: Address Prefix. + :vartype address_prefix: str + :ivar boot_strap_configuration_blobs: BootStrapConfigurationBlobs storage URLs. + :vartype boot_strap_configuration_blobs: list[str] + :ivar virtual_hub: The Virtual Hub where Network Virtual Appliance is being deployed. + :vartype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar cloud_init_configuration_blobs: CloudInitConfigurationBlob storage URLs. + :vartype cloud_init_configuration_blobs: list[str] + :ivar cloud_init_configuration: CloudInitConfiguration string in plain text. + :vartype cloud_init_configuration: str + :ivar virtual_appliance_asn: VirtualAppliance ASN. Microsoft private, public and IANA reserved + ASN are not supported. + :vartype virtual_appliance_asn: int + :ivar ssh_public_key: Public key for SSH login. + :vartype ssh_public_key: str + :ivar virtual_appliance_nics: List of Virtual Appliance Network Interfaces. + :vartype virtual_appliance_nics: + list[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceNicProperties] + :ivar additional_nics: Details required for Additional Network Interface. + :vartype additional_nics: + list[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceAdditionalNicProperties] + :ivar internet_ingress_public_ips: List of Resource Uri of Public IPs for Internet Ingress + Scenario. + :vartype internet_ingress_public_ips: + list[~azure.mgmt.network.v2023_09_01.models.InternetIngressPublicIpsProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar virtual_appliance_connections: List of references to VirtualApplianceConnections. + :vartype virtual_appliance_connections: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar inbound_security_rules: List of references to InboundSecurityRules. + :vartype inbound_security_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar deployment_type: The deployment type. PartnerManaged for the SaaS NVA. + :vartype deployment_type: str + :ivar delegation: The delegation for the Virtual Appliance. + :vartype delegation: ~azure.mgmt.network.v2023_09_01.models.DelegationProperties + :ivar partner_managed_resource: The delegation for the Virtual Appliance. + :vartype partner_managed_resource: + ~azure.mgmt.network.v2023_09_01.models.PartnerManagedResourceProperties + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "address_prefix": {"readonly": True}, + "virtual_appliance_asn": {"maximum": 4294967295, "minimum": 0}, + "virtual_appliance_nics": {"readonly": True}, + "virtual_appliance_sites": {"readonly": True}, + "virtual_appliance_connections": {"readonly": True}, + "inbound_security_rules": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "deployment_type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "etag": {"key": "etag", "type": "str"}, + "nva_sku": {"key": "properties.nvaSku", "type": "VirtualApplianceSkuProperties"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "boot_strap_configuration_blobs": {"key": "properties.bootStrapConfigurationBlobs", "type": "[str]"}, + "virtual_hub": {"key": "properties.virtualHub", "type": "SubResource"}, + "cloud_init_configuration_blobs": {"key": "properties.cloudInitConfigurationBlobs", "type": "[str]"}, + "cloud_init_configuration": {"key": "properties.cloudInitConfiguration", "type": "str"}, + "virtual_appliance_asn": {"key": "properties.virtualApplianceAsn", "type": "int"}, + "ssh_public_key": {"key": "properties.sshPublicKey", "type": "str"}, + "virtual_appliance_nics": {"key": "properties.virtualApplianceNics", "type": "[VirtualApplianceNicProperties]"}, + "additional_nics": {"key": "properties.additionalNics", "type": "[VirtualApplianceAdditionalNicProperties]"}, + "internet_ingress_public_ips": { + "key": "properties.internetIngressPublicIps", + "type": "[InternetIngressPublicIpsProperties]", + }, + "virtual_appliance_sites": {"key": "properties.virtualApplianceSites", "type": "[SubResource]"}, + "virtual_appliance_connections": {"key": "properties.virtualApplianceConnections", "type": "[SubResource]"}, + "inbound_security_rules": {"key": "properties.inboundSecurityRules", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "deployment_type": {"key": "properties.deploymentType", "type": "str"}, + "delegation": {"key": "properties.delegation", "type": "DelegationProperties"}, + "partner_managed_resource": { + "key": "properties.partnerManagedResource", + "type": "PartnerManagedResourceProperties", + }, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + nva_sku: Optional["_models.VirtualApplianceSkuProperties"] = None, + boot_strap_configuration_blobs: Optional[List[str]] = None, + virtual_hub: Optional["_models.SubResource"] = None, + cloud_init_configuration_blobs: Optional[List[str]] = None, + cloud_init_configuration: Optional[str] = None, + virtual_appliance_asn: Optional[int] = None, + ssh_public_key: Optional[str] = None, + additional_nics: Optional[List["_models.VirtualApplianceAdditionalNicProperties"]] = None, + internet_ingress_public_ips: Optional[List["_models.InternetIngressPublicIpsProperties"]] = None, + delegation: Optional["_models.DelegationProperties"] = None, + partner_managed_resource: Optional["_models.PartnerManagedResourceProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The service principal that has read access to cloud-init and config blob. + :paramtype identity: ~azure.mgmt.network.v2023_09_01.models.ManagedServiceIdentity + :keyword nva_sku: Network Virtual Appliance SKU. + :paramtype nva_sku: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSkuProperties + :keyword boot_strap_configuration_blobs: BootStrapConfigurationBlobs storage URLs. + :paramtype boot_strap_configuration_blobs: list[str] + :keyword virtual_hub: The Virtual Hub where Network Virtual Appliance is being deployed. + :paramtype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword cloud_init_configuration_blobs: CloudInitConfigurationBlob storage URLs. + :paramtype cloud_init_configuration_blobs: list[str] + :keyword cloud_init_configuration: CloudInitConfiguration string in plain text. + :paramtype cloud_init_configuration: str + :keyword virtual_appliance_asn: VirtualAppliance ASN. Microsoft private, public and IANA + reserved ASN are not supported. + :paramtype virtual_appliance_asn: int + :keyword ssh_public_key: Public key for SSH login. + :paramtype ssh_public_key: str + :keyword additional_nics: Details required for Additional Network Interface. + :paramtype additional_nics: + list[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceAdditionalNicProperties] + :keyword internet_ingress_public_ips: List of Resource Uri of Public IPs for Internet Ingress + Scenario. + :paramtype internet_ingress_public_ips: + list[~azure.mgmt.network.v2023_09_01.models.InternetIngressPublicIpsProperties] + :keyword delegation: The delegation for the Virtual Appliance. + :paramtype delegation: ~azure.mgmt.network.v2023_09_01.models.DelegationProperties + :keyword partner_managed_resource: The delegation for the Virtual Appliance. + :paramtype partner_managed_resource: + ~azure.mgmt.network.v2023_09_01.models.PartnerManagedResourceProperties + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.identity = identity + self.etag = None + self.nva_sku = nva_sku + self.address_prefix = None + self.boot_strap_configuration_blobs = boot_strap_configuration_blobs + self.virtual_hub = virtual_hub + self.cloud_init_configuration_blobs = cloud_init_configuration_blobs + self.cloud_init_configuration = cloud_init_configuration + self.virtual_appliance_asn = virtual_appliance_asn + self.ssh_public_key = ssh_public_key + self.virtual_appliance_nics = None + self.additional_nics = additional_nics + self.internet_ingress_public_ips = internet_ingress_public_ips + self.virtual_appliance_sites = None + self.virtual_appliance_connections = None + self.inbound_security_rules = None + self.provisioning_state = None + self.deployment_type = None + self.delegation = delegation + self.partner_managed_resource = partner_managed_resource + + +class NetworkVirtualApplianceConnection(SubResource): + """NetworkVirtualApplianceConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar name_properties_name: The name of the resource. + :vartype name_properties_name: str + :ivar provisioning_state: The provisioning state of the NetworkVirtualApplianceConnection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar asn: Network Virtual Appliance ASN. + :vartype asn: int + :ivar tunnel_identifier: Unique identifier for the connection. + :vartype tunnel_identifier: int + :ivar bgp_peer_address: List of bgpPeerAddresses for the NVA instances. + :vartype bgp_peer_address: list[str] + :ivar enable_internet_security: Enable internet security. + :vartype enable_internet_security: bool + :ivar routing_configuration: The Routing Configuration indicating the associated and propagated + route tables on this connection. + :vartype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "asn": {"maximum": 4294967295, "minimum": 0}, + "tunnel_identifier": {"maximum": 4294967295, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "name_properties_name": {"key": "properties.name", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "asn": {"key": "properties.asn", "type": "int"}, + "tunnel_identifier": {"key": "properties.tunnelIdentifier", "type": "int"}, + "bgp_peer_address": {"key": "properties.bgpPeerAddress", "type": "[str]"}, + "enable_internet_security": {"key": "properties.enableInternetSecurity", "type": "bool"}, + "routing_configuration": {"key": "properties.routingConfiguration", "type": "RoutingConfiguration"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + name_properties_name: Optional[str] = None, + asn: Optional[int] = None, + tunnel_identifier: Optional[int] = None, + bgp_peer_address: Optional[List[str]] = None, + enable_internet_security: Optional[bool] = None, + routing_configuration: Optional["_models.RoutingConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource. + :paramtype name: str + :keyword name_properties_name: The name of the resource. + :paramtype name_properties_name: str + :keyword asn: Network Virtual Appliance ASN. + :paramtype asn: int + :keyword tunnel_identifier: Unique identifier for the connection. + :paramtype tunnel_identifier: int + :keyword bgp_peer_address: List of bgpPeerAddresses for the NVA instances. + :paramtype bgp_peer_address: list[str] + :keyword enable_internet_security: Enable internet security. + :paramtype enable_internet_security: bool + :keyword routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :paramtype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + super().__init__(id=id, **kwargs) + self.name = name + self.name_properties_name = name_properties_name + self.provisioning_state = None + self.asn = asn + self.tunnel_identifier = tunnel_identifier + self.bgp_peer_address = bgp_peer_address + self.enable_internet_security = enable_internet_security + self.routing_configuration = routing_configuration + + +class NetworkVirtualApplianceConnectionList(_serialization.Model): + """NetworkVirtualApplianceConnection list. + + :ivar value: The list of NetworkVirtualAppliance connections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkVirtualApplianceConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkVirtualApplianceConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of NetworkVirtualAppliance connections. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkVirtualApplianceListResult(_serialization.Model): + """Response for ListNetworkVirtualAppliances API service call. + + :ivar value: List of Network Virtual Appliances. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkVirtualAppliance]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkVirtualAppliance"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Network Virtual Appliances. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkVirtualApplianceSiteListResult(_serialization.Model): + """Response for ListNetworkVirtualApplianceSites API service call. + + :ivar value: List of Network Virtual Appliance sites. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualApplianceSite]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualApplianceSite"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Network Virtual Appliance sites. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkVirtualApplianceSku(Resource): + """Definition of the NetworkVirtualApplianceSkus resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar vendor: Network Virtual Appliance Sku vendor. + :vartype vendor: str + :ivar available_versions: Available Network Virtual Appliance versions. + :vartype available_versions: list[str] + :ivar available_scale_units: The list of scale units available. + :vartype available_scale_units: + list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSkuInstances] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "vendor": {"readonly": True}, + "available_versions": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "vendor": {"key": "properties.vendor", "type": "str"}, + "available_versions": {"key": "properties.availableVersions", "type": "[str]"}, + "available_scale_units": { + "key": "properties.availableScaleUnits", + "type": "[NetworkVirtualApplianceSkuInstances]", + }, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + available_scale_units: Optional[List["_models.NetworkVirtualApplianceSkuInstances"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword available_scale_units: The list of scale units available. + :paramtype available_scale_units: + list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSkuInstances] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.vendor = None + self.available_versions = None + self.available_scale_units = available_scale_units + + +class NetworkVirtualApplianceSkuInstances(_serialization.Model): + """List of available Sku and instances. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar scale_unit: Scale Unit. + :vartype scale_unit: str + :ivar instance_count: Instance Count. + :vartype instance_count: int + """ + + _validation = { + "scale_unit": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "scale_unit": {"key": "scaleUnit", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.scale_unit = None + self.instance_count = None + + +class NetworkVirtualApplianceSkuListResult(_serialization.Model): + """Response for ListNetworkVirtualApplianceSkus API service call. + + :ivar value: List of Network Virtual Appliance Skus that are available. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSku] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkVirtualApplianceSku]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkVirtualApplianceSku"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Network Virtual Appliance Skus that are available. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSku] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the network watcher resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + + +class NetworkWatcherListResult(_serialization.Model): + """Response for ListNetworkWatchers API service call. + + :ivar value: List of network watcher resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkWatcher] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkWatcher]"}, + } + + def __init__(self, *, value: Optional[List["_models.NetworkWatcher"]] = None, **kwargs: Any) -> None: + """ + :keyword value: List of network watcher resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.NetworkWatcher] + """ + super().__init__(**kwargs) + self.value = value + + +class NextHopParameters(_serialization.Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The resource identifier of the target resource against which the + action is to be performed. Required. + :vartype target_resource_id: str + :ivar source_ip_address: The source IP address. Required. + :vartype source_ip_address: str + :ivar destination_ip_address: The destination IP address. Required. + :vartype destination_ip_address: str + :ivar target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled + on any of the nics, then this parameter must be specified. Otherwise optional). + :vartype target_nic_resource_id: str + """ + + _validation = { + "target_resource_id": {"required": True}, + "source_ip_address": {"required": True}, + "destination_ip_address": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + "source_ip_address": {"key": "sourceIPAddress", "type": "str"}, + "destination_ip_address": {"key": "destinationIPAddress", "type": "str"}, + "target_nic_resource_id": {"key": "targetNicResourceId", "type": "str"}, + } + + def __init__( + self, + *, + target_resource_id: str, + source_ip_address: str, + destination_ip_address: str, + target_nic_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_resource_id: The resource identifier of the target resource against which the + action is to be performed. Required. + :paramtype target_resource_id: str + :keyword source_ip_address: The source IP address. Required. + :paramtype source_ip_address: str + :keyword destination_ip_address: The destination IP address. Required. + :paramtype destination_ip_address: str + :keyword target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is + enabled on any of the nics, then this parameter must be specified. Otherwise optional). + :paramtype target_nic_resource_id: str + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id + + +class NextHopResult(_serialization.Model): + """The information about next hop from the specified VM. + + :ivar next_hop_type: Next hop type. Known values are: "Internet", "VirtualAppliance", + "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", and "None". + :vartype next_hop_type: str or ~azure.mgmt.network.v2023_09_01.models.NextHopType + :ivar next_hop_ip_address: Next hop IP Address. + :vartype next_hop_ip_address: str + :ivar route_table_id: The resource identifier for the route table associated with the route + being returned. If the route being returned does not correspond to any user created routes then + this field will be the string 'System Route'. + :vartype route_table_id: str + """ + + _attribute_map = { + "next_hop_type": {"key": "nextHopType", "type": "str"}, + "next_hop_ip_address": {"key": "nextHopIpAddress", "type": "str"}, + "route_table_id": {"key": "routeTableId", "type": "str"}, + } + + def __init__( + self, + *, + next_hop_type: Optional[Union[str, "_models.NextHopType"]] = None, + next_hop_ip_address: Optional[str] = None, + route_table_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword next_hop_type: Next hop type. Known values are: "Internet", "VirtualAppliance", + "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", and "None". + :paramtype next_hop_type: str or ~azure.mgmt.network.v2023_09_01.models.NextHopType + :keyword next_hop_ip_address: Next hop IP Address. + :paramtype next_hop_ip_address: str + :keyword route_table_id: The resource identifier for the route table associated with the route + being returned. If the route being returned does not correspond to any user created routes then + this field will be the string 'System Route'. + :paramtype route_table_id: str + """ + super().__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id + + +class O365BreakOutCategoryPolicies(_serialization.Model): + """Office365 breakout categories. + + :ivar allow: Flag to control allow category. + :vartype allow: bool + :ivar optimize: Flag to control optimize category. + :vartype optimize: bool + :ivar default: Flag to control default category. + :vartype default: bool + """ + + _attribute_map = { + "allow": {"key": "allow", "type": "bool"}, + "optimize": {"key": "optimize", "type": "bool"}, + "default": {"key": "default", "type": "bool"}, + } + + def __init__( + self, + *, + allow: Optional[bool] = None, + optimize: Optional[bool] = None, + default: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword allow: Flag to control allow category. + :paramtype allow: bool + :keyword optimize: Flag to control optimize category. + :paramtype optimize: bool + :keyword default: Flag to control default category. + :paramtype default: bool + """ + super().__init__(**kwargs) + self.allow = allow + self.optimize = optimize + self.default = default + + +class O365PolicyProperties(_serialization.Model): + """The Office365 breakout policy. + + :ivar break_out_categories: Office365 breakout categories. + :vartype break_out_categories: + ~azure.mgmt.network.v2023_09_01.models.O365BreakOutCategoryPolicies + """ + + _attribute_map = { + "break_out_categories": {"key": "breakOutCategories", "type": "O365BreakOutCategoryPolicies"}, + } + + def __init__( + self, *, break_out_categories: Optional["_models.O365BreakOutCategoryPolicies"] = None, **kwargs: Any + ) -> None: + """ + :keyword break_out_categories: Office365 breakout categories. + :paramtype break_out_categories: + ~azure.mgmt.network.v2023_09_01.models.O365BreakOutCategoryPolicies + """ + super().__init__(**kwargs) + self.break_out_categories = break_out_categories + + +class Office365PolicyProperties(_serialization.Model): + """Network Virtual Appliance Sku Properties. + + :ivar break_out_categories: Office 365 breakout categories. + :vartype break_out_categories: ~azure.mgmt.network.v2023_09_01.models.BreakOutCategoryPolicies + """ + + _attribute_map = { + "break_out_categories": {"key": "breakOutCategories", "type": "BreakOutCategoryPolicies"}, + } + + def __init__( + self, *, break_out_categories: Optional["_models.BreakOutCategoryPolicies"] = None, **kwargs: Any + ) -> None: + """ + :keyword break_out_categories: Office 365 breakout categories. + :paramtype break_out_categories: + ~azure.mgmt.network.v2023_09_01.models.BreakOutCategoryPolicies + """ + super().__init__(**kwargs) + self.break_out_categories = break_out_categories + + +class Operation(_serialization.Model): + """Network REST API operation definition. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: Display metadata associated with the operation. + :vartype display: ~azure.mgmt.network.v2023_09_01.models.OperationDisplay + :ivar origin: Origin of the operation. + :vartype origin: str + :ivar service_specification: Specification of the service. + :vartype service_specification: + ~azure.mgmt.network.v2023_09_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "service_specification": { + "key": "properties.serviceSpecification", + "type": "OperationPropertiesFormatServiceSpecification", + }, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["_models.OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["_models.OperationPropertiesFormatServiceSpecification"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Operation name: {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: Display metadata associated with the operation. + :paramtype display: ~azure.mgmt.network.v2023_09_01.models.OperationDisplay + :keyword origin: Origin of the operation. + :paramtype origin: str + :keyword service_specification: Specification of the service. + :paramtype service_specification: + ~azure.mgmt.network.v2023_09_01.models.OperationPropertiesFormatServiceSpecification + """ + super().__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(_serialization.Model): + """Display metadata associated with the operation. + + :ivar provider: Service provider: Microsoft Network. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Type of the operation: get, read, delete, etc. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _attribute_map = { + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword provider: Service provider: Microsoft Network. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed. + :paramtype resource: str + :keyword operation: Type of the operation: get, read, delete, etc. + :paramtype operation: str + :keyword description: Description of the operation. + :paramtype description: str + """ + super().__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(_serialization.Model): + """Result of the request to list Network operations. It contains a list of operations and a URL + link to get the next set of results. + + :ivar value: List of Network operations supported by the Network resource provider. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of Network operations supported by the Network resource provider. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.Operation] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationPropertiesFormatServiceSpecification(_serialization.Model): # pylint: disable=name-too-long + """Specification of the service. + + :ivar metric_specifications: Operation service specification. + :vartype metric_specifications: + list[~azure.mgmt.network.v2023_09_01.models.MetricSpecification] + :ivar log_specifications: Operation log specification. + :vartype log_specifications: list[~azure.mgmt.network.v2023_09_01.models.LogSpecification] + """ + + _attribute_map = { + "metric_specifications": {"key": "metricSpecifications", "type": "[MetricSpecification]"}, + "log_specifications": {"key": "logSpecifications", "type": "[LogSpecification]"}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["_models.MetricSpecification"]] = None, + log_specifications: Optional[List["_models.LogSpecification"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword metric_specifications: Operation service specification. + :paramtype metric_specifications: + list[~azure.mgmt.network.v2023_09_01.models.MetricSpecification] + :keyword log_specifications: Operation log specification. + :paramtype log_specifications: list[~azure.mgmt.network.v2023_09_01.models.LogSpecification] + """ + super().__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications + + +class OrderBy(_serialization.Model): + """Describes a column to sort. + + :ivar field: Describes the actual column name to sort by. + :vartype field: str + :ivar order: Describes if results should be in ascending/descending order. Known values are: + "Ascending" and "Descending". + :vartype order: str or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSQuerySortOrder + """ + + _attribute_map = { + "field": {"key": "field", "type": "str"}, + "order": {"key": "order", "type": "str"}, + } + + def __init__( + self, + *, + field: Optional[str] = None, + order: Optional[Union[str, "_models.FirewallPolicyIDPSQuerySortOrder"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword field: Describes the actual column name to sort by. + :paramtype field: str + :keyword order: Describes if results should be in ascending/descending order. Known values are: + "Ascending" and "Descending". + :paramtype order: str or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSQuerySortOrder + """ + super().__init__(**kwargs) + self.field = field + self.order = order + + +class OutboundRule(SubResource): # pylint: disable=too-many-instance-attributes + """Outbound rule of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of outbound rules used by + the load balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar allocated_outbound_ports: The number of outbound ports to be used for NAT. + :vartype allocated_outbound_ports: int + :ivar frontend_ip_configurations: The Frontend IP addresses of the load balancer. + :vartype frontend_ip_configurations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar backend_address_pool: A reference to a pool of DIPs. Outbound traffic is randomly load + balanced across IPs in the backend IPs. + :vartype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the outbound rule resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar protocol: The protocol for the outbound rule in load balancer. Known values are: "Tcp", + "Udp", and "All". + :vartype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.LoadBalancerOutboundRuleProtocol + :ivar enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + connection termination. This element is only used when the protocol is set to TCP. + :vartype enable_tcp_reset: bool + :ivar idle_timeout_in_minutes: The timeout for the TCP idle connection. + :vartype idle_timeout_in_minutes: int + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "allocated_outbound_ports": {"key": "properties.allocatedOutboundPorts", "type": "int"}, + "frontend_ip_configurations": {"key": "properties.frontendIPConfigurations", "type": "[SubResource]"}, + "backend_address_pool": {"key": "properties.backendAddressPool", "type": "SubResource"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "enable_tcp_reset": {"key": "properties.enableTcpReset", "type": "bool"}, + "idle_timeout_in_minutes": {"key": "properties.idleTimeoutInMinutes", "type": "int"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + allocated_outbound_ports: Optional[int] = None, + frontend_ip_configurations: Optional[List["_models.SubResource"]] = None, + backend_address_pool: Optional["_models.SubResource"] = None, + protocol: Optional[Union[str, "_models.LoadBalancerOutboundRuleProtocol"]] = None, + enable_tcp_reset: Optional[bool] = None, + idle_timeout_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of outbound rules used by + the load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword allocated_outbound_ports: The number of outbound ports to be used for NAT. + :paramtype allocated_outbound_ports: int + :keyword frontend_ip_configurations: The Frontend IP addresses of the load balancer. + :paramtype frontend_ip_configurations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword backend_address_pool: A reference to a pool of DIPs. Outbound traffic is randomly load + balanced across IPs in the backend IPs. + :paramtype backend_address_pool: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword protocol: The protocol for the outbound rule in load balancer. Known values are: + "Tcp", "Udp", and "All". + :paramtype protocol: str or + ~azure.mgmt.network.v2023_09_01.models.LoadBalancerOutboundRuleProtocol + :keyword enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle timeout or + unexpected connection termination. This element is only used when the protocol is set to TCP. + :paramtype enable_tcp_reset: bool + :keyword idle_timeout_in_minutes: The timeout for the TCP idle connection. + :paramtype idle_timeout_in_minutes: int + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = None + self.protocol = protocol + self.enable_tcp_reset = enable_tcp_reset + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class OwaspCrsExclusionEntry(_serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to server. + + :ivar match_variable: The variable to be excluded. Required. Known values are: + "RequestHeaderNames", "RequestCookieNames", "RequestArgNames", "RequestHeaderKeys", + "RequestHeaderValues", "RequestCookieKeys", "RequestCookieValues", "RequestArgKeys", and + "RequestArgValues". + :vartype match_variable: str or + ~azure.mgmt.network.v2023_09_01.models.OwaspCrsExclusionEntryMatchVariable + :ivar selector_match_operator: When matchVariable is a collection, operate on the selector to + specify which elements in the collection this exclusion applies to. Required. Known values are: + "Equals", "Contains", "StartsWith", "EndsWith", and "EqualsAny". + :vartype selector_match_operator: str or + ~azure.mgmt.network.v2023_09_01.models.OwaspCrsExclusionEntrySelectorMatchOperator + :ivar selector: When matchVariable is a collection, operator used to specify which elements in + the collection this exclusion applies to. Required. + :vartype selector: str + :ivar exclusion_managed_rule_sets: The managed rule sets that are associated with the + exclusion. + :vartype exclusion_managed_rule_sets: + list[~azure.mgmt.network.v2023_09_01.models.ExclusionManagedRuleSet] + """ + + _validation = { + "match_variable": {"required": True}, + "selector_match_operator": {"required": True}, + "selector": {"required": True}, + } + + _attribute_map = { + "match_variable": {"key": "matchVariable", "type": "str"}, + "selector_match_operator": {"key": "selectorMatchOperator", "type": "str"}, + "selector": {"key": "selector", "type": "str"}, + "exclusion_managed_rule_sets": {"key": "exclusionManagedRuleSets", "type": "[ExclusionManagedRuleSet]"}, + } + + def __init__( + self, + *, + match_variable: Union[str, "_models.OwaspCrsExclusionEntryMatchVariable"], + selector_match_operator: Union[str, "_models.OwaspCrsExclusionEntrySelectorMatchOperator"], + selector: str, + exclusion_managed_rule_sets: Optional[List["_models.ExclusionManagedRuleSet"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword match_variable: The variable to be excluded. Required. Known values are: + "RequestHeaderNames", "RequestCookieNames", "RequestArgNames", "RequestHeaderKeys", + "RequestHeaderValues", "RequestCookieKeys", "RequestCookieValues", "RequestArgKeys", and + "RequestArgValues". + :paramtype match_variable: str or + ~azure.mgmt.network.v2023_09_01.models.OwaspCrsExclusionEntryMatchVariable + :keyword selector_match_operator: When matchVariable is a collection, operate on the selector + to specify which elements in the collection this exclusion applies to. Required. Known values + are: "Equals", "Contains", "StartsWith", "EndsWith", and "EqualsAny". + :paramtype selector_match_operator: str or + ~azure.mgmt.network.v2023_09_01.models.OwaspCrsExclusionEntrySelectorMatchOperator + :keyword selector: When matchVariable is a collection, operator used to specify which elements + in the collection this exclusion applies to. Required. + :paramtype selector: str + :keyword exclusion_managed_rule_sets: The managed rule sets that are associated with the + exclusion. + :paramtype exclusion_managed_rule_sets: + list[~azure.mgmt.network.v2023_09_01.models.ExclusionManagedRuleSet] + """ + super().__init__(**kwargs) + self.match_variable = match_variable + self.selector_match_operator = selector_match_operator + self.selector = selector + self.exclusion_managed_rule_sets = exclusion_managed_rule_sets + + +class P2SConnectionConfiguration(SubResource): + """P2SConnectionConfiguration Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :vartype vpn_client_address_pool: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar routing_configuration: The Routing Configuration indicating the associated and propagated + route tables on this connection. + :vartype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + :ivar enable_internet_security: Flag indicating whether the enable internet security flag is + turned on for the P2S Connections or not. + :vartype enable_internet_security: bool + :ivar configuration_policy_group_associations: List of Configuration Policy Groups that this + P2SConnectionConfiguration is attached to. + :vartype configuration_policy_group_associations: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar previous_configuration_policy_group_associations: List of previous Configuration Policy + Groups that this P2SConnectionConfiguration was attached to. + :vartype previous_configuration_policy_group_associations: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :ivar provisioning_state: The provisioning state of the P2SConnectionConfiguration resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "configuration_policy_group_associations": {"readonly": True}, + "previous_configuration_policy_group_associations": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "vpn_client_address_pool": {"key": "properties.vpnClientAddressPool", "type": "AddressSpace"}, + "routing_configuration": {"key": "properties.routingConfiguration", "type": "RoutingConfiguration"}, + "enable_internet_security": {"key": "properties.enableInternetSecurity", "type": "bool"}, + "configuration_policy_group_associations": { + "key": "properties.configurationPolicyGroupAssociations", + "type": "[SubResource]", + }, + "previous_configuration_policy_group_associations": { + "key": "properties.previousConfigurationPolicyGroupAssociations", + "type": "[VpnServerConfigurationPolicyGroup]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + vpn_client_address_pool: Optional["_models.AddressSpace"] = None, + routing_configuration: Optional["_models.RoutingConfiguration"] = None, + enable_internet_security: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :paramtype vpn_client_address_pool: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :paramtype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + :keyword enable_internet_security: Flag indicating whether the enable internet security flag is + turned on for the P2S Connections or not. + :paramtype enable_internet_security: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.vpn_client_address_pool = vpn_client_address_pool + self.routing_configuration = routing_configuration + self.enable_internet_security = enable_internet_security + self.configuration_policy_group_associations = None + self.previous_configuration_policy_group_associations = None + self.provisioning_state = None + + +class P2SVpnConnectionHealth(_serialization.Model): + """P2S Vpn connection detailed health written to sas url. + + :ivar sas_url: Returned sas url of the blob to which the p2s vpn connection detailed health + will be written. + :vartype sas_url: str + """ + + _attribute_map = { + "sas_url": {"key": "sasUrl", "type": "str"}, + } + + def __init__(self, *, sas_url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword sas_url: Returned sas url of the blob to which the p2s vpn connection detailed health + will be written. + :paramtype sas_url: str + """ + super().__init__(**kwargs) + self.sas_url = sas_url + + +class P2SVpnConnectionHealthRequest(_serialization.Model): + """List of P2S Vpn connection health request. + + :ivar vpn_user_names_filter: The list of p2s vpn user names whose p2s vpn connection detailed + health to retrieve for. + :vartype vpn_user_names_filter: list[str] + :ivar output_blob_sas_url: The sas-url to download the P2S Vpn connection health detail. + :vartype output_blob_sas_url: str + """ + + _attribute_map = { + "vpn_user_names_filter": {"key": "vpnUserNamesFilter", "type": "[str]"}, + "output_blob_sas_url": {"key": "outputBlobSasUrl", "type": "str"}, + } + + def __init__( + self, + *, + vpn_user_names_filter: Optional[List[str]] = None, + output_blob_sas_url: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword vpn_user_names_filter: The list of p2s vpn user names whose p2s vpn connection + detailed health to retrieve for. + :paramtype vpn_user_names_filter: list[str] + :keyword output_blob_sas_url: The sas-url to download the P2S Vpn connection health detail. + :paramtype output_blob_sas_url: str + """ + super().__init__(**kwargs) + self.vpn_user_names_filter = vpn_user_names_filter + self.output_blob_sas_url = output_blob_sas_url + + +class P2SVpnConnectionRequest(_serialization.Model): + """List of p2s vpn connections to be disconnected. + + :ivar vpn_connection_ids: List of p2s vpn connection Ids. + :vartype vpn_connection_ids: list[str] + """ + + _attribute_map = { + "vpn_connection_ids": {"key": "vpnConnectionIds", "type": "[str]"}, + } + + def __init__(self, *, vpn_connection_ids: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword vpn_connection_ids: List of p2s vpn connection Ids. + :paramtype vpn_connection_ids: list[str] + """ + super().__init__(**kwargs) + self.vpn_connection_ids = vpn_connection_ids + + +class P2SVpnGateway(Resource): # pylint: disable=too-many-instance-attributes + """P2SVpnGateway Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_hub: The VirtualHub to which the gateway belongs. + :vartype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar p2_s_connection_configurations: List of all p2s connection configurations of the gateway. + :vartype p2_s_connection_configurations: + list[~azure.mgmt.network.v2023_09_01.models.P2SConnectionConfiguration] + :ivar provisioning_state: The provisioning state of the P2S VPN gateway resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar vpn_gateway_scale_unit: The scale unit for this p2s vpn gateway. + :vartype vpn_gateway_scale_unit: int + :ivar vpn_server_configuration: The VpnServerConfiguration to which the p2sVpnGateway is + attached to. + :vartype vpn_server_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2023_09_01.models.VpnClientConnectionHealth + :ivar custom_dns_servers: List of all customer specified DNS servers IP addresses. + :vartype custom_dns_servers: list[str] + :ivar is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the P2SVpnGateway. + :vartype is_routing_preference_internet: bool + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "vpn_client_connection_health": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "virtual_hub": {"key": "properties.virtualHub", "type": "SubResource"}, + "p2_s_connection_configurations": { + "key": "properties.p2SConnectionConfigurations", + "type": "[P2SConnectionConfiguration]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "vpn_gateway_scale_unit": {"key": "properties.vpnGatewayScaleUnit", "type": "int"}, + "vpn_server_configuration": {"key": "properties.vpnServerConfiguration", "type": "SubResource"}, + "vpn_client_connection_health": { + "key": "properties.vpnClientConnectionHealth", + "type": "VpnClientConnectionHealth", + }, + "custom_dns_servers": {"key": "properties.customDnsServers", "type": "[str]"}, + "is_routing_preference_internet": {"key": "properties.isRoutingPreferenceInternet", "type": "bool"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_hub: Optional["_models.SubResource"] = None, + p2_s_connection_configurations: Optional[List["_models.P2SConnectionConfiguration"]] = None, + vpn_gateway_scale_unit: Optional[int] = None, + vpn_server_configuration: Optional["_models.SubResource"] = None, + custom_dns_servers: Optional[List[str]] = None, + is_routing_preference_internet: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword virtual_hub: The VirtualHub to which the gateway belongs. + :paramtype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword p2_s_connection_configurations: List of all p2s connection configurations of the + gateway. + :paramtype p2_s_connection_configurations: + list[~azure.mgmt.network.v2023_09_01.models.P2SConnectionConfiguration] + :keyword vpn_gateway_scale_unit: The scale unit for this p2s vpn gateway. + :paramtype vpn_gateway_scale_unit: int + :keyword vpn_server_configuration: The VpnServerConfiguration to which the p2sVpnGateway is + attached to. + :paramtype vpn_server_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword custom_dns_servers: List of all customer specified DNS servers IP addresses. + :paramtype custom_dns_servers: list[str] + :keyword is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the P2SVpnGateway. + :paramtype is_routing_preference_internet: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_hub = virtual_hub + self.p2_s_connection_configurations = p2_s_connection_configurations + self.provisioning_state = None + self.vpn_gateway_scale_unit = vpn_gateway_scale_unit + self.vpn_server_configuration = vpn_server_configuration + self.vpn_client_connection_health = None + self.custom_dns_servers = custom_dns_servers + self.is_routing_preference_internet = is_routing_preference_internet + + +class P2SVpnProfileParameters(_serialization.Model): + """Vpn Client Parameters for package generation. + + :ivar authentication_method: VPN client authentication method. Known values are: "EAPTLS" and + "EAPMSCHAPv2". + :vartype authentication_method: str or + ~azure.mgmt.network.v2023_09_01.models.AuthenticationMethod + """ + + _attribute_map = { + "authentication_method": {"key": "authenticationMethod", "type": "str"}, + } + + def __init__( + self, *, authentication_method: Optional[Union[str, "_models.AuthenticationMethod"]] = None, **kwargs: Any + ) -> None: + """ + :keyword authentication_method: VPN client authentication method. Known values are: "EAPTLS" + and "EAPMSCHAPv2". + :paramtype authentication_method: str or + ~azure.mgmt.network.v2023_09_01.models.AuthenticationMethod + """ + super().__init__(**kwargs) + self.authentication_method = authentication_method + + +class PacketCapture(_serialization.Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to server. + + :ivar target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. Required. + :vartype target: str + :ivar scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :vartype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :ivar target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :vartype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :ivar bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are + truncated. + :vartype bytes_to_capture_per_packet: int + :ivar total_bytes_per_session: Maximum size of the capture output. + :vartype total_bytes_per_session: int + :ivar time_limit_in_seconds: Maximum duration of the capture session in seconds. + :vartype time_limit_in_seconds: int + :ivar storage_location: The storage location for a packet capture session. Required. + :vartype storage_location: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :ivar filters: A list of packet capture filters. + :vartype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + """ + + _validation = { + "target": {"required": True}, + "bytes_to_capture_per_packet": {"maximum": 4294967295, "minimum": 0}, + "total_bytes_per_session": {"maximum": 4294967295, "minimum": 0}, + "time_limit_in_seconds": {"maximum": 18000, "minimum": 0}, + "storage_location": {"required": True}, + } + + _attribute_map = { + "target": {"key": "properties.target", "type": "str"}, + "scope": {"key": "properties.scope", "type": "PacketCaptureMachineScope"}, + "target_type": {"key": "properties.targetType", "type": "str"}, + "bytes_to_capture_per_packet": {"key": "properties.bytesToCapturePerPacket", "type": "int"}, + "total_bytes_per_session": {"key": "properties.totalBytesPerSession", "type": "int"}, + "time_limit_in_seconds": {"key": "properties.timeLimitInSeconds", "type": "int"}, + "storage_location": {"key": "properties.storageLocation", "type": "PacketCaptureStorageLocation"}, + "filters": {"key": "properties.filters", "type": "[PacketCaptureFilter]"}, + } + + def __init__( + self, + *, + target: str, + storage_location: "_models.PacketCaptureStorageLocation", + scope: Optional["_models.PacketCaptureMachineScope"] = None, + target_type: Optional[Union[str, "_models.PacketCaptureTargetType"]] = None, + bytes_to_capture_per_packet: int = 0, + total_bytes_per_session: int = 1073741824, + time_limit_in_seconds: int = 18000, + filters: Optional[List["_models.PacketCaptureFilter"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. Required. + :paramtype target: str + :keyword scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :paramtype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :keyword target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :paramtype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :keyword bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :paramtype bytes_to_capture_per_packet: int + :keyword total_bytes_per_session: Maximum size of the capture output. + :paramtype total_bytes_per_session: int + :keyword time_limit_in_seconds: Maximum duration of the capture session in seconds. + :paramtype time_limit_in_seconds: int + :keyword storage_location: The storage location for a packet capture session. Required. + :paramtype storage_location: + ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :keyword filters: A list of packet capture filters. + :paramtype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + """ + super().__init__(**kwargs) + self.target = target + self.scope = scope + self.target_type = target_type + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + + +class PacketCaptureFilter(_serialization.Model): + """Filter that is applied to packet capture request. Multiple filters can be applied. + + :ivar protocol: Protocol to be filtered on. Known values are: "TCP", "UDP", and "Any". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.PcProtocol + :ivar local_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :vartype local_ip_address: str + :ivar remote_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :vartype remote_ip_address: str + :ivar local_port: Local port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :vartype local_port: str + :ivar remote_port: Remote port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :vartype remote_port: str + """ + + _attribute_map = { + "protocol": {"key": "protocol", "type": "str"}, + "local_ip_address": {"key": "localIPAddress", "type": "str"}, + "remote_ip_address": {"key": "remoteIPAddress", "type": "str"}, + "local_port": {"key": "localPort", "type": "str"}, + "remote_port": {"key": "remotePort", "type": "str"}, + } + + def __init__( + self, + *, + protocol: Union[str, "_models.PcProtocol"] = "Any", + local_ip_address: Optional[str] = None, + remote_ip_address: Optional[str] = None, + local_port: Optional[str] = None, + remote_port: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword protocol: Protocol to be filtered on. Known values are: "TCP", "UDP", and "Any". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.PcProtocol + :keyword local_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :paramtype local_ip_address: str + :keyword remote_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for + single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple + entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :paramtype remote_ip_address: str + :keyword local_port: Local port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :paramtype local_port: str + :keyword remote_port: Remote port to be filtered on. Notation: "80" for single port + entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. Default = null. + :paramtype remote_port: str + """ + super().__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port + + +class PacketCaptureListResult(_serialization.Model): + """List of packet capture sessions. + + :ivar value: Information about packet capture sessions. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PacketCaptureResult]"}, + } + + def __init__(self, *, value: Optional[List["_models.PacketCaptureResult"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Information about packet capture sessions. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + """ + super().__init__(**kwargs) + self.value = value + + +class PacketCaptureMachineScope(_serialization.Model): + """A list of AzureVMSS instances which can be included or excluded to run packet capture. If both + included and excluded are empty, then the packet capture will run on all instances of + AzureVMSS. + + :ivar include: List of AzureVMSS instances to run packet capture on. + :vartype include: list[str] + :ivar exclude: List of AzureVMSS instances which has to be excluded from the AzureVMSS from + running packet capture. + :vartype exclude: list[str] + """ + + _attribute_map = { + "include": {"key": "include", "type": "[str]"}, + "exclude": {"key": "exclude", "type": "[str]"}, + } + + def __init__( + self, *, include: Optional[List[str]] = None, exclude: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword include: List of AzureVMSS instances to run packet capture on. + :paramtype include: list[str] + :keyword exclude: List of AzureVMSS instances which has to be excluded from the AzureVMSS from + running packet capture. + :paramtype exclude: list[str] + """ + super().__init__(**kwargs) + self.include = include + self.exclude = exclude + + +class PacketCaptureParameters(_serialization.Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to server. + + :ivar target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. Required. + :vartype target: str + :ivar scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :vartype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :ivar target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :vartype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :ivar bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are + truncated. + :vartype bytes_to_capture_per_packet: int + :ivar total_bytes_per_session: Maximum size of the capture output. + :vartype total_bytes_per_session: int + :ivar time_limit_in_seconds: Maximum duration of the capture session in seconds. + :vartype time_limit_in_seconds: int + :ivar storage_location: The storage location for a packet capture session. Required. + :vartype storage_location: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :ivar filters: A list of packet capture filters. + :vartype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + """ + + _validation = { + "target": {"required": True}, + "bytes_to_capture_per_packet": {"maximum": 4294967295, "minimum": 0}, + "total_bytes_per_session": {"maximum": 4294967295, "minimum": 0}, + "time_limit_in_seconds": {"maximum": 18000, "minimum": 0}, + "storage_location": {"required": True}, + } + + _attribute_map = { + "target": {"key": "target", "type": "str"}, + "scope": {"key": "scope", "type": "PacketCaptureMachineScope"}, + "target_type": {"key": "targetType", "type": "str"}, + "bytes_to_capture_per_packet": {"key": "bytesToCapturePerPacket", "type": "int"}, + "total_bytes_per_session": {"key": "totalBytesPerSession", "type": "int"}, + "time_limit_in_seconds": {"key": "timeLimitInSeconds", "type": "int"}, + "storage_location": {"key": "storageLocation", "type": "PacketCaptureStorageLocation"}, + "filters": {"key": "filters", "type": "[PacketCaptureFilter]"}, + } + + def __init__( + self, + *, + target: str, + storage_location: "_models.PacketCaptureStorageLocation", + scope: Optional["_models.PacketCaptureMachineScope"] = None, + target_type: Optional[Union[str, "_models.PacketCaptureTargetType"]] = None, + bytes_to_capture_per_packet: int = 0, + total_bytes_per_session: int = 1073741824, + time_limit_in_seconds: int = 18000, + filters: Optional[List["_models.PacketCaptureFilter"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. Required. + :paramtype target: str + :keyword scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :paramtype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :keyword target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :paramtype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :keyword bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :paramtype bytes_to_capture_per_packet: int + :keyword total_bytes_per_session: Maximum size of the capture output. + :paramtype total_bytes_per_session: int + :keyword time_limit_in_seconds: Maximum duration of the capture session in seconds. + :paramtype time_limit_in_seconds: int + :keyword storage_location: The storage location for a packet capture session. Required. + :paramtype storage_location: + ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :keyword filters: A list of packet capture filters. + :paramtype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + """ + super().__init__(**kwargs) + self.target = target + self.scope = scope + self.target_type = target_type + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + + +class PacketCaptureQueryStatusResult(_serialization.Model): + """Status of packet capture session. + + :ivar name: The name of the packet capture resource. + :vartype name: str + :ivar id: The ID of the packet capture resource. + :vartype id: str + :ivar capture_start_time: The start time of the packet capture session. + :vartype capture_start_time: ~datetime.datetime + :ivar packet_capture_status: The status of the packet capture session. Known values are: + "NotStarted", "Running", "Stopped", "Error", and "Unknown". + :vartype packet_capture_status: str or ~azure.mgmt.network.v2023_09_01.models.PcStatus + :ivar stop_reason: The reason the current packet capture session was stopped. + :vartype stop_reason: str + :ivar packet_capture_error: List of errors of packet capture session. + :vartype packet_capture_error: list[str or ~azure.mgmt.network.v2023_09_01.models.PcError] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "capture_start_time": {"key": "captureStartTime", "type": "iso-8601"}, + "packet_capture_status": {"key": "packetCaptureStatus", "type": "str"}, + "stop_reason": {"key": "stopReason", "type": "str"}, + "packet_capture_error": {"key": "packetCaptureError", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + capture_start_time: Optional[datetime.datetime] = None, + packet_capture_status: Optional[Union[str, "_models.PcStatus"]] = None, + stop_reason: Optional[str] = None, + packet_capture_error: Optional[List[Union[str, "_models.PcError"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the packet capture resource. + :paramtype name: str + :keyword id: The ID of the packet capture resource. + :paramtype id: str + :keyword capture_start_time: The start time of the packet capture session. + :paramtype capture_start_time: ~datetime.datetime + :keyword packet_capture_status: The status of the packet capture session. Known values are: + "NotStarted", "Running", "Stopped", "Error", and "Unknown". + :paramtype packet_capture_status: str or ~azure.mgmt.network.v2023_09_01.models.PcStatus + :keyword stop_reason: The reason the current packet capture session was stopped. + :paramtype stop_reason: str + :keyword packet_capture_error: List of errors of packet capture session. + :paramtype packet_capture_error: list[str or ~azure.mgmt.network.v2023_09_01.models.PcError] + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error + + +class PacketCaptureResult(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. + :vartype target: str + :ivar scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :vartype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :ivar target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :vartype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :ivar bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are + truncated. + :vartype bytes_to_capture_per_packet: int + :ivar total_bytes_per_session: Maximum size of the capture output. + :vartype total_bytes_per_session: int + :ivar time_limit_in_seconds: Maximum duration of the capture session in seconds. + :vartype time_limit_in_seconds: int + :ivar storage_location: The storage location for a packet capture session. + :vartype storage_location: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :ivar filters: A list of packet capture filters. + :vartype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + :ivar provisioning_state: The provisioning state of the packet capture session. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "id": {"readonly": True}, + "etag": {"readonly": True}, + "bytes_to_capture_per_packet": {"maximum": 4294967295, "minimum": 0}, + "total_bytes_per_session": {"maximum": 4294967295, "minimum": 0}, + "time_limit_in_seconds": {"maximum": 18000, "minimum": 0}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "target": {"key": "properties.target", "type": "str"}, + "scope": {"key": "properties.scope", "type": "PacketCaptureMachineScope"}, + "target_type": {"key": "properties.targetType", "type": "str"}, + "bytes_to_capture_per_packet": {"key": "properties.bytesToCapturePerPacket", "type": "int"}, + "total_bytes_per_session": {"key": "properties.totalBytesPerSession", "type": "int"}, + "time_limit_in_seconds": {"key": "properties.timeLimitInSeconds", "type": "int"}, + "storage_location": {"key": "properties.storageLocation", "type": "PacketCaptureStorageLocation"}, + "filters": {"key": "properties.filters", "type": "[PacketCaptureFilter]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + target: Optional[str] = None, + scope: Optional["_models.PacketCaptureMachineScope"] = None, + target_type: Optional[Union[str, "_models.PacketCaptureTargetType"]] = None, + bytes_to_capture_per_packet: int = 0, + total_bytes_per_session: int = 1073741824, + time_limit_in_seconds: int = 18000, + storage_location: Optional["_models.PacketCaptureStorageLocation"] = None, + filters: Optional[List["_models.PacketCaptureFilter"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. + :paramtype target: str + :keyword scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :paramtype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :keyword target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :paramtype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :keyword bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :paramtype bytes_to_capture_per_packet: int + :keyword total_bytes_per_session: Maximum size of the capture output. + :paramtype total_bytes_per_session: int + :keyword time_limit_in_seconds: Maximum duration of the capture session in seconds. + :paramtype time_limit_in_seconds: int + :keyword storage_location: The storage location for a packet capture session. + :paramtype storage_location: + ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :keyword filters: A list of packet capture filters. + :paramtype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + """ + super().__init__(**kwargs) + self.name = None + self.id = None + self.etag = None + self.target = target + self.scope = scope + self.target_type = target_type + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = None + + +class PacketCaptureResultProperties(PacketCaptureParameters): + """The properties of a packet capture session. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. Required. + :vartype target: str + :ivar scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :vartype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :ivar target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :vartype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :ivar bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are + truncated. + :vartype bytes_to_capture_per_packet: int + :ivar total_bytes_per_session: Maximum size of the capture output. + :vartype total_bytes_per_session: int + :ivar time_limit_in_seconds: Maximum duration of the capture session in seconds. + :vartype time_limit_in_seconds: int + :ivar storage_location: The storage location for a packet capture session. Required. + :vartype storage_location: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :ivar filters: A list of packet capture filters. + :vartype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + :ivar provisioning_state: The provisioning state of the packet capture session. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "target": {"required": True}, + "bytes_to_capture_per_packet": {"maximum": 4294967295, "minimum": 0}, + "total_bytes_per_session": {"maximum": 4294967295, "minimum": 0}, + "time_limit_in_seconds": {"maximum": 18000, "minimum": 0}, + "storage_location": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "target": {"key": "target", "type": "str"}, + "scope": {"key": "scope", "type": "PacketCaptureMachineScope"}, + "target_type": {"key": "targetType", "type": "str"}, + "bytes_to_capture_per_packet": {"key": "bytesToCapturePerPacket", "type": "int"}, + "total_bytes_per_session": {"key": "totalBytesPerSession", "type": "int"}, + "time_limit_in_seconds": {"key": "timeLimitInSeconds", "type": "int"}, + "storage_location": {"key": "storageLocation", "type": "PacketCaptureStorageLocation"}, + "filters": {"key": "filters", "type": "[PacketCaptureFilter]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + target: str, + storage_location: "_models.PacketCaptureStorageLocation", + scope: Optional["_models.PacketCaptureMachineScope"] = None, + target_type: Optional[Union[str, "_models.PacketCaptureTargetType"]] = None, + bytes_to_capture_per_packet: int = 0, + total_bytes_per_session: int = 1073741824, + time_limit_in_seconds: int = 18000, + filters: Optional[List["_models.PacketCaptureFilter"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword target: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + currently supported. Required. + :paramtype target: str + :keyword scope: A list of AzureVMSS instances which can be included or excluded to run packet + capture. If both included and excluded are empty, then the packet capture will run on all + instances of AzureVMSS. + :paramtype scope: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureMachineScope + :keyword target_type: Target type of the resource provided. Known values are: "AzureVM" and + "AzureVMSS". + :paramtype target_type: str or ~azure.mgmt.network.v2023_09_01.models.PacketCaptureTargetType + :keyword bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :paramtype bytes_to_capture_per_packet: int + :keyword total_bytes_per_session: Maximum size of the capture output. + :paramtype total_bytes_per_session: int + :keyword time_limit_in_seconds: Maximum duration of the capture session in seconds. + :paramtype time_limit_in_seconds: int + :keyword storage_location: The storage location for a packet capture session. Required. + :paramtype storage_location: + ~azure.mgmt.network.v2023_09_01.models.PacketCaptureStorageLocation + :keyword filters: A list of packet capture filters. + :paramtype filters: list[~azure.mgmt.network.v2023_09_01.models.PacketCaptureFilter] + """ + super().__init__( + target=target, + scope=scope, + target_type=target_type, + bytes_to_capture_per_packet=bytes_to_capture_per_packet, + total_bytes_per_session=total_bytes_per_session, + time_limit_in_seconds=time_limit_in_seconds, + storage_location=storage_location, + filters=filters, + **kwargs + ) + self.provisioning_state = None + + +class PacketCaptureStorageLocation(_serialization.Model): + """The storage location for a packet capture session. + + :ivar storage_id: The ID of the storage account to save the packet capture session. Required if + no local file path is provided. + :vartype storage_id: str + :ivar storage_path: The URI of the storage path to save the packet capture. Must be a + well-formed URI describing the location to save the packet capture. + :vartype storage_path: str + :ivar file_path: A valid local path on the targeting VM. Must include the name of the capture + file (*.cap). For linux virtual machine it must start with /var/captures. Required if no + storage ID is provided, otherwise optional. + :vartype file_path: str + """ + + _attribute_map = { + "storage_id": {"key": "storageId", "type": "str"}, + "storage_path": {"key": "storagePath", "type": "str"}, + "file_path": {"key": "filePath", "type": "str"}, + } + + def __init__( + self, + *, + storage_id: Optional[str] = None, + storage_path: Optional[str] = None, + file_path: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword storage_id: The ID of the storage account to save the packet capture session. Required + if no local file path is provided. + :paramtype storage_id: str + :keyword storage_path: The URI of the storage path to save the packet capture. Must be a + well-formed URI describing the location to save the packet capture. + :paramtype storage_path: str + :keyword file_path: A valid local path on the targeting VM. Must include the name of the + capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if + no storage ID is provided, otherwise optional. + :paramtype file_path: str + """ + super().__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path + + +class Parameter(_serialization.Model): + """Parameters for an Action. + + :ivar route_prefix: List of route prefixes. + :vartype route_prefix: list[str] + :ivar community: List of BGP communities. + :vartype community: list[str] + :ivar as_path: List of AS paths. + :vartype as_path: list[str] + """ + + _attribute_map = { + "route_prefix": {"key": "routePrefix", "type": "[str]"}, + "community": {"key": "community", "type": "[str]"}, + "as_path": {"key": "asPath", "type": "[str]"}, + } + + def __init__( + self, + *, + route_prefix: Optional[List[str]] = None, + community: Optional[List[str]] = None, + as_path: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword route_prefix: List of route prefixes. + :paramtype route_prefix: list[str] + :keyword community: List of BGP communities. + :paramtype community: list[str] + :keyword as_path: List of AS paths. + :paramtype as_path: list[str] + """ + super().__init__(**kwargs) + self.route_prefix = route_prefix + self.community = community + self.as_path = as_path + + +class PartnerManagedResourceProperties(_serialization.Model): + """Properties of the partner managed resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The partner managed resource id. + :vartype id: str + :ivar internal_load_balancer_id: The partner managed ILB resource id. + :vartype internal_load_balancer_id: str + :ivar standard_load_balancer_id: The partner managed SLB resource id. + :vartype standard_load_balancer_id: str + """ + + _validation = { + "id": {"readonly": True}, + "internal_load_balancer_id": {"readonly": True}, + "standard_load_balancer_id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "internal_load_balancer_id": {"key": "internalLoadBalancerId", "type": "str"}, + "standard_load_balancer_id": {"key": "standardLoadBalancerId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.internal_load_balancer_id = None + self.standard_load_balancer_id = None + + +class PatchObject(_serialization.Model): + """Object for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar rules: Collection of RouteFilterRules contained within a route filter. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the route filter resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "etag": {"readonly": True}, + "type": {"readonly": True}, + "peerings": {"readonly": True}, + "ipv6_peerings": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "rules": {"key": "properties.rules", "type": "[RouteFilterRule]"}, + "peerings": {"key": "properties.peerings", "type": "[ExpressRouteCircuitPeering]"}, + "ipv6_peerings": {"key": "properties.ipv6Peerings", "type": "[ExpressRouteCircuitPeering]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + tags: Optional[Dict[str, str]] = None, + rules: Optional[List["_models.RouteFilterRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword rules: Collection of RouteFilterRules contained within a route filter. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + """ + super().__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.type = None + self.tags = tags + self.rules = rules + self.peerings = None + self.ipv6_peerings = None + self.provisioning_state = None + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar access: The access type of the rule. Known values are: "Allow" and "Deny". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. "Community" + :vartype route_filter_rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.RouteFilterRuleType + :ivar communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :vartype communities: list[str] + :ivar provisioning_state: The provisioning state of the route filter rule resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "access": {"key": "properties.access", "type": "str"}, + "route_filter_rule_type": {"key": "properties.routeFilterRuleType", "type": "str"}, + "communities": {"key": "properties.communities", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + access: Optional[Union[str, "_models.Access"]] = None, + route_filter_rule_type: Optional[Union[str, "_models.RouteFilterRuleType"]] = None, + communities: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword access: The access type of the rule. Known values are: "Allow" and "Deny". + :paramtype access: str or ~azure.mgmt.network.v2023_09_01.models.Access + :keyword route_filter_rule_type: The rule type of the rule. "Community" + :paramtype route_filter_rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.RouteFilterRuleType + :keyword communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :paramtype communities: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.access = access + self.route_filter_rule_type = route_filter_rule_type + self.communities = communities + self.provisioning_state = None + + +class PeerExpressRouteCircuitConnection(SubResource): # pylint: disable=too-many-instance-attributes + """Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit. + :vartype express_route_circuit_peering: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :vartype peer_express_route_circuit_peering: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :vartype address_prefix: str + :ivar circuit_connection_status: Express Route Circuit connection state. Known values are: + "Connected", "Connecting", and "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.CircuitConnectionStatus + :ivar connection_name: The name of the express route circuit connection resource. + :vartype connection_name: str + :ivar auth_resource_guid: The resource guid of the authorization used for the express route + circuit connection. + :vartype auth_resource_guid: str + :ivar provisioning_state: The provisioning state of the peer express route circuit connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "circuit_connection_status": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "express_route_circuit_peering": {"key": "properties.expressRouteCircuitPeering", "type": "SubResource"}, + "peer_express_route_circuit_peering": { + "key": "properties.peerExpressRouteCircuitPeering", + "type": "SubResource", + }, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "circuit_connection_status": {"key": "properties.circuitConnectionStatus", "type": "str"}, + "connection_name": {"key": "properties.connectionName", "type": "str"}, + "auth_resource_guid": {"key": "properties.authResourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + express_route_circuit_peering: Optional["_models.SubResource"] = None, + peer_express_route_circuit_peering: Optional["_models.SubResource"] = None, + address_prefix: Optional[str] = None, + connection_name: Optional[str] = None, + auth_resource_guid: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit. + :paramtype express_route_circuit_peering: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :paramtype peer_express_route_circuit_peering: + ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :paramtype address_prefix: str + :keyword connection_name: The name of the express route circuit connection resource. + :paramtype connection_name: str + :keyword auth_resource_guid: The resource guid of the authorization used for the express route + circuit connection. + :paramtype auth_resource_guid: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.express_route_circuit_peering = express_route_circuit_peering + self.peer_express_route_circuit_peering = peer_express_route_circuit_peering + self.address_prefix = address_prefix + self.circuit_connection_status = None + self.connection_name = connection_name + self.auth_resource_guid = auth_resource_guid + self.provisioning_state = None + + +class PeerExpressRouteCircuitConnectionListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListPeeredConnections API service call retrieves all global reach peer circuit + connections that belongs to a Private Peering for an ExpressRouteCircuit. + + :ivar value: The global reach peer circuit connection associated with Private Peering in an + ExpressRoute Circuit. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PeerExpressRouteCircuitConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.PeerExpressRouteCircuitConnection"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The global reach peer circuit connection associated with Private Peering in an + ExpressRoute Circuit. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PeerRoute(_serialization.Model): + """Peer routing details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The peer's local address. + :vartype local_address: str + :ivar network: The route's network prefix. + :vartype network: str + :ivar next_hop: The route's next hop. + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from. + :vartype source_peer: str + :ivar origin: The source this route was learned from. + :vartype origin: str + :ivar as_path: The route's AS path sequence. + :vartype as_path: str + :ivar weight: The route's weight. + :vartype weight: int + """ + + _validation = { + "local_address": {"readonly": True}, + "network": {"readonly": True}, + "next_hop": {"readonly": True}, + "source_peer": {"readonly": True}, + "origin": {"readonly": True}, + "as_path": {"readonly": True}, + "weight": {"readonly": True}, + } + + _attribute_map = { + "local_address": {"key": "localAddress", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "next_hop": {"key": "nextHop", "type": "str"}, + "source_peer": {"key": "sourcePeer", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "as_path": {"key": "asPath", "type": "str"}, + "weight": {"key": "weight", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None + + +class PolicySettings(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Defines contents of a web application firewall global configuration. + + :ivar state: The state of the policy. Known values are: "Disabled" and "Enabled". + :vartype state: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallEnabledState + :ivar mode: The mode of the policy. Known values are: "Prevention" and "Detection". + :vartype mode: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallMode + :ivar request_body_check: Whether to allow WAF to check request Body. + :vartype request_body_check: bool + :ivar request_body_inspect_limit_in_kb: Max inspection limit in KB for request body inspection + for WAF. + :vartype request_body_inspect_limit_in_kb: int + :ivar request_body_enforcement: Whether allow WAF to enforce request body limits. + :vartype request_body_enforcement: bool + :ivar max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :vartype max_request_body_size_in_kb: int + :ivar file_upload_enforcement: Whether allow WAF to enforce file upload limits. + :vartype file_upload_enforcement: bool + :ivar file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :vartype file_upload_limit_in_mb: int + :ivar custom_block_response_status_code: If the action type is block, customer can override the + response status code. + :vartype custom_block_response_status_code: int + :ivar custom_block_response_body: If the action type is block, customer can override the + response body. The body must be specified in base64 encoding. + :vartype custom_block_response_body: str + :ivar log_scrubbing: To scrub sensitive log fields. + :vartype log_scrubbing: ~azure.mgmt.network.v2023_09_01.models.PolicySettingsLogScrubbing + """ + + _validation = { + "max_request_body_size_in_kb": {"minimum": 8}, + "file_upload_limit_in_mb": {"minimum": 0}, + "custom_block_response_status_code": {"minimum": 0}, + "custom_block_response_body": { + "max_length": 32768, + "pattern": r"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", + }, + } + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "request_body_check": {"key": "requestBodyCheck", "type": "bool"}, + "request_body_inspect_limit_in_kb": {"key": "requestBodyInspectLimitInKB", "type": "int"}, + "request_body_enforcement": {"key": "requestBodyEnforcement", "type": "bool"}, + "max_request_body_size_in_kb": {"key": "maxRequestBodySizeInKb", "type": "int"}, + "file_upload_enforcement": {"key": "fileUploadEnforcement", "type": "bool"}, + "file_upload_limit_in_mb": {"key": "fileUploadLimitInMb", "type": "int"}, + "custom_block_response_status_code": {"key": "customBlockResponseStatusCode", "type": "int"}, + "custom_block_response_body": {"key": "customBlockResponseBody", "type": "str"}, + "log_scrubbing": {"key": "logScrubbing", "type": "PolicySettingsLogScrubbing"}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "_models.WebApplicationFirewallEnabledState"]] = None, + mode: Optional[Union[str, "_models.WebApplicationFirewallMode"]] = None, + request_body_check: Optional[bool] = None, + request_body_inspect_limit_in_kb: Optional[int] = None, + request_body_enforcement: bool = True, + max_request_body_size_in_kb: Optional[int] = None, + file_upload_enforcement: bool = True, + file_upload_limit_in_mb: Optional[int] = None, + custom_block_response_status_code: Optional[int] = None, + custom_block_response_body: Optional[str] = None, + log_scrubbing: Optional["_models.PolicySettingsLogScrubbing"] = None, + **kwargs: Any + ) -> None: + """ + :keyword state: The state of the policy. Known values are: "Disabled" and "Enabled". + :paramtype state: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallEnabledState + :keyword mode: The mode of the policy. Known values are: "Prevention" and "Detection". + :paramtype mode: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallMode + :keyword request_body_check: Whether to allow WAF to check request Body. + :paramtype request_body_check: bool + :keyword request_body_inspect_limit_in_kb: Max inspection limit in KB for request body + inspection for WAF. + :paramtype request_body_inspect_limit_in_kb: int + :keyword request_body_enforcement: Whether allow WAF to enforce request body limits. + :paramtype request_body_enforcement: bool + :keyword max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :paramtype max_request_body_size_in_kb: int + :keyword file_upload_enforcement: Whether allow WAF to enforce file upload limits. + :paramtype file_upload_enforcement: bool + :keyword file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :paramtype file_upload_limit_in_mb: int + :keyword custom_block_response_status_code: If the action type is block, customer can override + the response status code. + :paramtype custom_block_response_status_code: int + :keyword custom_block_response_body: If the action type is block, customer can override the + response body. The body must be specified in base64 encoding. + :paramtype custom_block_response_body: str + :keyword log_scrubbing: To scrub sensitive log fields. + :paramtype log_scrubbing: ~azure.mgmt.network.v2023_09_01.models.PolicySettingsLogScrubbing + """ + super().__init__(**kwargs) + self.state = state + self.mode = mode + self.request_body_check = request_body_check + self.request_body_inspect_limit_in_kb = request_body_inspect_limit_in_kb + self.request_body_enforcement = request_body_enforcement + self.max_request_body_size_in_kb = max_request_body_size_in_kb + self.file_upload_enforcement = file_upload_enforcement + self.file_upload_limit_in_mb = file_upload_limit_in_mb + self.custom_block_response_status_code = custom_block_response_status_code + self.custom_block_response_body = custom_block_response_body + self.log_scrubbing = log_scrubbing + + +class PolicySettingsLogScrubbing(_serialization.Model): + """To scrub sensitive log fields. + + :ivar state: State of the log scrubbing config. Default value is Enabled. Known values are: + "Disabled" and "Enabled". + :vartype state: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallScrubbingState + :ivar scrubbing_rules: The rules that are applied to the logs for scrubbing. + :vartype scrubbing_rules: + list[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallScrubbingRules] + """ + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + "scrubbing_rules": {"key": "scrubbingRules", "type": "[WebApplicationFirewallScrubbingRules]"}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "_models.WebApplicationFirewallScrubbingState"]] = None, + scrubbing_rules: Optional[List["_models.WebApplicationFirewallScrubbingRules"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword state: State of the log scrubbing config. Default value is Enabled. Known values are: + "Disabled" and "Enabled". + :paramtype state: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallScrubbingState + :keyword scrubbing_rules: The rules that are applied to the logs for scrubbing. + :paramtype scrubbing_rules: + list[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallScrubbingRules] + """ + super().__init__(**kwargs) + self.state = state + self.scrubbing_rules = scrubbing_rules + + +class PrepareNetworkPoliciesRequest(_serialization.Model): + """Details of PrepareNetworkPolicies for Subnet. + + :ivar service_name: The name of the service for which subnet is being prepared for. + :vartype service_name: str + :ivar network_intent_policy_configurations: A list of NetworkIntentPolicyConfiguration. + :vartype network_intent_policy_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkIntentPolicyConfiguration] + """ + + _attribute_map = { + "service_name": {"key": "serviceName", "type": "str"}, + "network_intent_policy_configurations": { + "key": "networkIntentPolicyConfigurations", + "type": "[NetworkIntentPolicyConfiguration]", + }, + } + + def __init__( + self, + *, + service_name: Optional[str] = None, + network_intent_policy_configurations: Optional[List["_models.NetworkIntentPolicyConfiguration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword service_name: The name of the service for which subnet is being prepared for. + :paramtype service_name: str + :keyword network_intent_policy_configurations: A list of NetworkIntentPolicyConfiguration. + :paramtype network_intent_policy_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkIntentPolicyConfiguration] + """ + super().__init__(**kwargs) + self.service_name = service_name + self.network_intent_policy_configurations = network_intent_policy_configurations + + +class PrivateDnsZoneConfig(_serialization.Model): + """PrivateDnsZoneConfig resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :vartype name: str + :ivar private_dns_zone_id: The resource id of the private dns zone. + :vartype private_dns_zone_id: str + :ivar record_sets: A collection of information regarding a recordSet, holding information to + identify private resources. + :vartype record_sets: list[~azure.mgmt.network.v2023_09_01.models.RecordSet] + """ + + _validation = { + "record_sets": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "private_dns_zone_id": {"key": "properties.privateDnsZoneId", "type": "str"}, + "record_sets": {"key": "properties.recordSets", "type": "[RecordSet]"}, + } + + def __init__(self, *, name: Optional[str] = None, private_dns_zone_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the resource that is unique within a resource group. This name can be + used to access the resource. + :paramtype name: str + :keyword private_dns_zone_id: The resource id of the private dns zone. + :paramtype private_dns_zone_id: str + """ + super().__init__(**kwargs) + self.name = name + self.private_dns_zone_id = private_dns_zone_id + self.record_sets = None + + +class PrivateDnsZoneGroup(SubResource): + """Private dns zone group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private dns zone group resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_dns_zone_configs: A collection of private dns zone configurations of the private + dns zone group. + :vartype private_dns_zone_configs: + list[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneConfig] + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_dns_zone_configs": {"key": "properties.privateDnsZoneConfigs", "type": "[PrivateDnsZoneConfig]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_dns_zone_configs: Optional[List["_models.PrivateDnsZoneConfig"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the resource that is unique within a resource group. This name can be + used to access the resource. + :paramtype name: str + :keyword private_dns_zone_configs: A collection of private dns zone configurations of the + private dns zone group. + :paramtype private_dns_zone_configs: + list[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneConfig] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.provisioning_state = None + self.private_dns_zone_configs = private_dns_zone_configs + + +class PrivateDnsZoneGroupListResult(_serialization.Model): + """Response for the ListPrivateDnsZoneGroups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of private dns zone group resources in a private endpoint. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateDnsZoneGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateDnsZoneGroup"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of private dns zone group resources in a private endpoint. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateEndpoint(Resource): # pylint: disable=too-many-instance-attributes + """Private endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the load balancer. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar subnet: The ID of the subnet from which the private IP will be allocated. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar network_interfaces: An array of references to the network interfaces created for this + private endpoint. + :vartype network_interfaces: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :ivar provisioning_state: The provisioning state of the private endpoint resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_link_service_connections: A grouping of information about the connection to the + remote resource. + :vartype private_link_service_connections: + list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnection] + :ivar manual_private_link_service_connections: A grouping of information about the connection + to the remote resource. Used when the network admin does not have access to approve connections + to the remote resource. + :vartype manual_private_link_service_connections: + list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnection] + :ivar custom_dns_configs: An array of custom dns configurations. + :vartype custom_dns_configs: + list[~azure.mgmt.network.v2023_09_01.models.CustomDnsConfigPropertiesFormat] + :ivar application_security_groups: Application security groups in which the private endpoint IP + configuration is included. + :vartype application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :ivar ip_configurations: A list of IP configurations of the private endpoint. This will be used + to map to the First Party Service's endpoints. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointIPConfiguration] + :ivar custom_network_interface_name: The custom name of the network interface attached to the + private endpoint. + :vartype custom_network_interface_name: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "network_interfaces": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "etag": {"key": "etag", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "network_interfaces": {"key": "properties.networkInterfaces", "type": "[NetworkInterface]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_link_service_connections": { + "key": "properties.privateLinkServiceConnections", + "type": "[PrivateLinkServiceConnection]", + }, + "manual_private_link_service_connections": { + "key": "properties.manualPrivateLinkServiceConnections", + "type": "[PrivateLinkServiceConnection]", + }, + "custom_dns_configs": {"key": "properties.customDnsConfigs", "type": "[CustomDnsConfigPropertiesFormat]"}, + "application_security_groups": { + "key": "properties.applicationSecurityGroups", + "type": "[ApplicationSecurityGroup]", + }, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[PrivateEndpointIPConfiguration]"}, + "custom_network_interface_name": {"key": "properties.customNetworkInterfaceName", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + subnet: Optional["_models.Subnet"] = None, + private_link_service_connections: Optional[List["_models.PrivateLinkServiceConnection"]] = None, + manual_private_link_service_connections: Optional[List["_models.PrivateLinkServiceConnection"]] = None, + custom_dns_configs: Optional[List["_models.CustomDnsConfigPropertiesFormat"]] = None, + application_security_groups: Optional[List["_models.ApplicationSecurityGroup"]] = None, + ip_configurations: Optional[List["_models.PrivateEndpointIPConfiguration"]] = None, + custom_network_interface_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the load balancer. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword subnet: The ID of the subnet from which the private IP will be allocated. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword private_link_service_connections: A grouping of information about the connection to + the remote resource. + :paramtype private_link_service_connections: + list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnection] + :keyword manual_private_link_service_connections: A grouping of information about the + connection to the remote resource. Used when the network admin does not have access to approve + connections to the remote resource. + :paramtype manual_private_link_service_connections: + list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnection] + :keyword custom_dns_configs: An array of custom dns configurations. + :paramtype custom_dns_configs: + list[~azure.mgmt.network.v2023_09_01.models.CustomDnsConfigPropertiesFormat] + :keyword application_security_groups: Application security groups in which the private endpoint + IP configuration is included. + :paramtype application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :keyword ip_configurations: A list of IP configurations of the private endpoint. This will be + used to map to the First Party Service's endpoints. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointIPConfiguration] + :keyword custom_network_interface_name: The custom name of the network interface attached to + the private endpoint. + :paramtype custom_network_interface_name: str + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.subnet = subnet + self.network_interfaces = None + self.provisioning_state = None + self.private_link_service_connections = private_link_service_connections + self.manual_private_link_service_connections = manual_private_link_service_connections + self.custom_dns_configs = custom_dns_configs + self.application_security_groups = application_security_groups + self.ip_configurations = ip_configurations + self.custom_network_interface_name = custom_network_interface_name + + +class PrivateEndpointConnection(SubResource): + """PrivateEndpointConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar link_identifier: The consumer link id. + :vartype link_identifier: str + :ivar private_endpoint_location: The location of the private endpoint. + :vartype private_endpoint_location: str + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + "private_endpoint": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "link_identifier": {"readonly": True}, + "private_endpoint_location": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "link_identifier": {"key": "properties.linkIdentifier", "type": "str"}, + "private_endpoint_location": {"key": "properties.privateEndpointLocation", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnectionState + """ + super().__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.private_endpoint = None + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + self.link_identifier = None + self.private_endpoint_location = None + + +class PrivateEndpointConnectionListResult(_serialization.Model): + """Response for the ListPrivateEndpointConnection API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of PrivateEndpointConnection resources for a specific private link service. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of PrivateEndpointConnection resources for a specific private link + service. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateEndpointIPConfiguration(_serialization.Model): + """An IP Configuration of the private endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the resource that is unique within a resource group. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar group_id: The ID of a group obtained from the remote resource that this private endpoint + should connect to. + :vartype group_id: str + :ivar member_name: The member name of a group obtained from the remote resource that this + private endpoint should connect to. + :vartype member_name: str + :ivar private_ip_address: A private ip address obtained from the private endpoint's subnet. + :vartype private_ip_address: str + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "member_name": {"key": "properties.memberName", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + group_id: Optional[str] = None, + member_name: Optional[str] = None, + private_ip_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the resource that is unique within a resource group. + :paramtype name: str + :keyword group_id: The ID of a group obtained from the remote resource that this private + endpoint should connect to. + :paramtype group_id: str + :keyword member_name: The member name of a group obtained from the remote resource that this + private endpoint should connect to. + :paramtype member_name: str + :keyword private_ip_address: A private ip address obtained from the private endpoint's subnet. + :paramtype private_ip_address: str + """ + super().__init__(**kwargs) + self.name = name + self.type = None + self.etag = None + self.group_id = group_id + self.member_name = member_name + self.private_ip_address = private_ip_address + + +class PrivateEndpointListResult(_serialization.Model): + """Response for the ListPrivateEndpoints API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of private endpoint resources in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateEndpoint]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateEndpoint"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of private endpoint resources in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateLinkService(Resource): # pylint: disable=too-many-instance-attributes + """Private link service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the load balancer. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar load_balancer_frontend_ip_configurations: An array of references to the load balancer IP + configurations. + :vartype load_balancer_frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :ivar ip_configurations: An array of private link service IP configurations. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceIpConfiguration] + :ivar network_interfaces: An array of references to the network interfaces created for this + private link service. + :vartype network_interfaces: list[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :ivar provisioning_state: The provisioning state of the private link service resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_endpoint_connections: An array of list about connections to the private endpoint. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection] + :ivar visibility: The visibility list of the private link service. + :vartype visibility: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServicePropertiesVisibility + :ivar auto_approval: The auto-approval list of the private link service. + :vartype auto_approval: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServicePropertiesAutoApproval + :ivar fqdns: The list of Fqdn. + :vartype fqdns: list[str] + :ivar alias: The alias of the private link service. + :vartype alias: str + :ivar enable_proxy_protocol: Whether the private link service is enabled for proxy protocol or + not. + :vartype enable_proxy_protocol: bool + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "network_interfaces": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "alias": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "etag": {"key": "etag", "type": "str"}, + "load_balancer_frontend_ip_configurations": { + "key": "properties.loadBalancerFrontendIpConfigurations", + "type": "[FrontendIPConfiguration]", + }, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[PrivateLinkServiceIpConfiguration]"}, + "network_interfaces": {"key": "properties.networkInterfaces", "type": "[NetworkInterface]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "visibility": {"key": "properties.visibility", "type": "PrivateLinkServicePropertiesVisibility"}, + "auto_approval": {"key": "properties.autoApproval", "type": "PrivateLinkServicePropertiesAutoApproval"}, + "fqdns": {"key": "properties.fqdns", "type": "[str]"}, + "alias": {"key": "properties.alias", "type": "str"}, + "enable_proxy_protocol": {"key": "properties.enableProxyProtocol", "type": "bool"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + load_balancer_frontend_ip_configurations: Optional[List["_models.FrontendIPConfiguration"]] = None, + ip_configurations: Optional[List["_models.PrivateLinkServiceIpConfiguration"]] = None, + visibility: Optional["_models.PrivateLinkServicePropertiesVisibility"] = None, + auto_approval: Optional["_models.PrivateLinkServicePropertiesAutoApproval"] = None, + fqdns: Optional[List[str]] = None, + enable_proxy_protocol: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the load balancer. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword load_balancer_frontend_ip_configurations: An array of references to the load balancer + IP configurations. + :paramtype load_balancer_frontend_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :keyword ip_configurations: An array of private link service IP configurations. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceIpConfiguration] + :keyword visibility: The visibility list of the private link service. + :paramtype visibility: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServicePropertiesVisibility + :keyword auto_approval: The auto-approval list of the private link service. + :paramtype auto_approval: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServicePropertiesAutoApproval + :keyword fqdns: The list of Fqdn. + :paramtype fqdns: list[str] + :keyword enable_proxy_protocol: Whether the private link service is enabled for proxy protocol + or not. + :paramtype enable_proxy_protocol: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.load_balancer_frontend_ip_configurations = load_balancer_frontend_ip_configurations + self.ip_configurations = ip_configurations + self.network_interfaces = None + self.provisioning_state = None + self.private_endpoint_connections = None + self.visibility = visibility + self.auto_approval = auto_approval + self.fqdns = fqdns + self.alias = None + self.enable_proxy_protocol = enable_proxy_protocol + + +class PrivateLinkServiceConnection(SubResource): + """PrivateLinkServiceConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private link service connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_link_service_id: The resource id of private link service. + :vartype private_link_service_id: str + :ivar group_ids: The ID(s) of the group(s) obtained from the remote resource that this private + endpoint should connect to. + :vartype group_ids: list[str] + :ivar request_message: A message passed to the owner of the remote resource with this + connection request. Restricted to 140 chars. + :vartype request_message: str + :ivar private_link_service_connection_state: A collection of read-only information about the + state of the connection to the remote resource. + :vartype private_link_service_connection_state: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_link_service_id": {"key": "properties.privateLinkServiceId", "type": "str"}, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_link_service_id: Optional[str] = None, + group_ids: Optional[List[str]] = None, + request_message: Optional[str] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword private_link_service_id: The resource id of private link service. + :paramtype private_link_service_id: str + :keyword group_ids: The ID(s) of the group(s) obtained from the remote resource that this + private endpoint should connect to. + :paramtype group_ids: list[str] + :keyword request_message: A message passed to the owner of the remote resource with this + connection request. Restricted to 140 chars. + :paramtype request_message: str + :keyword private_link_service_connection_state: A collection of read-only information about the + state of the connection to the remote resource. + :paramtype private_link_service_connection_state: + ~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceConnectionState + """ + super().__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.provisioning_state = None + self.private_link_service_id = private_link_service_id + self.group_ids = group_ids + self.request_message = request_message + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkServiceConnectionState(_serialization.Model): + """A collection of information about the state of the connection between service consumer and + provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. + :vartype status: str + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actions_required: str + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the + owner of the service. + :paramtype status: str + :keyword description: The reason for approval/rejection of the connection. + :paramtype description: str + :keyword actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :paramtype actions_required: str + """ + super().__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class PrivateLinkServiceIpConfiguration(SubResource): + """The private link service ip configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of private link service ip configuration. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + :ivar private_ip_address: The private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar subnet: The reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :ivar primary: Whether the ip configuration is primary or not. + :vartype primary: bool + :ivar provisioning_state: The provisioning state of the private link service IP configuration + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Known values are: "IPv4" and "IPv6". + :vartype private_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "Subnet"}, + "primary": {"key": "properties.primary", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_ip_address_version": {"key": "properties.privateIPAddressVersion", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + subnet: Optional["_models.Subnet"] = None, + primary: Optional[bool] = None, + private_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of private link service ip configuration. + :paramtype name: str + :keyword private_ip_address: The private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword subnet: The reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword primary: Whether the ip configuration is primary or not. + :paramtype primary: bool + :keyword private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Known values are: "IPv4" and "IPv6". + :paramtype private_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.primary = primary + self.provisioning_state = None + self.private_ip_address_version = private_ip_address_version + + +class PrivateLinkServiceListResult(_serialization.Model): + """Response for the ListPrivateLinkService API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of PrivateLinkService resources in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateLinkService]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateLinkService"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of PrivateLinkService resources in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceSet(_serialization.Model): + """The base resource set for visibility and auto-approval. + + :ivar subscriptions: The list of subscriptions. + :vartype subscriptions: list[str] + """ + + _attribute_map = { + "subscriptions": {"key": "subscriptions", "type": "[str]"}, + } + + def __init__(self, *, subscriptions: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword subscriptions: The list of subscriptions. + :paramtype subscriptions: list[str] + """ + super().__init__(**kwargs) + self.subscriptions = subscriptions + + +class PrivateLinkServicePropertiesAutoApproval(ResourceSet): + """The auto-approval list of the private link service. + + :ivar subscriptions: The list of subscriptions. + :vartype subscriptions: list[str] + """ + + +class PrivateLinkServicePropertiesVisibility(ResourceSet): + """The visibility list of the private link service. + + :ivar subscriptions: The list of subscriptions. + :vartype subscriptions: list[str] + """ + + +class PrivateLinkServiceVisibility(_serialization.Model): + """Response for the CheckPrivateLinkServiceVisibility API service call. + + :ivar visible: Private Link Service Visibility (True/False). + :vartype visible: bool + """ + + _attribute_map = { + "visible": {"key": "visible", "type": "bool"}, + } + + def __init__(self, *, visible: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword visible: Private Link Service Visibility (True/False). + :paramtype visible: bool + """ + super().__init__(**kwargs) + self.visible = visible + + +class Probe(SubResource): # pylint: disable=too-many-instance-attributes + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within the set of probes used by the load + balancer. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar protocol: The protocol of the end point. If 'Tcp' is specified, a received ACK is + required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. Known values are: "Http", + "Tcp", and "Https". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ProbeProtocol + :ivar port: The port for communicating the probe. Possible values range from 1 to 65535, + inclusive. + :vartype port: int + :ivar interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint + for health status. Typically, the interval is slightly less than half the allocated timeout + period (in seconds) which allows two full probes before taking the instance out of rotation. + The default value is 15, the minimum value is 5. + :vartype interval_in_seconds: int + :ivar number_of_probes: The number of probes where if no response, will result in stopping + further traffic from being delivered to the endpoint. This values allows endpoints to be taken + out of rotation faster or slower than the typical times used in Azure. + :vartype number_of_probes: int + :ivar probe_threshold: The number of consecutive successful or failed probes in order to allow + or deny traffic from being delivered to this endpoint. After failing the number of consecutive + probes equal to this value, the endpoint will be taken out of rotation and require the same + number of successful consecutive probes to be placed back in rotation. + :vartype probe_threshold: int + :ivar request_path: The URI used for requesting health status from the VM. Path is required if + a protocol is set to http. Otherwise, it is not allowed. There is no default value. + :vartype request_path: str + :ivar provisioning_state: The provisioning state of the probe resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "load_balancing_rules": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "load_balancing_rules": {"key": "properties.loadBalancingRules", "type": "[SubResource]"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "port": {"key": "properties.port", "type": "int"}, + "interval_in_seconds": {"key": "properties.intervalInSeconds", "type": "int"}, + "number_of_probes": {"key": "properties.numberOfProbes", "type": "int"}, + "probe_threshold": {"key": "properties.probeThreshold", "type": "int"}, + "request_path": {"key": "properties.requestPath", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + protocol: Optional[Union[str, "_models.ProbeProtocol"]] = None, + port: Optional[int] = None, + interval_in_seconds: Optional[int] = None, + number_of_probes: Optional[int] = None, + probe_threshold: Optional[int] = None, + request_path: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within the set of probes used by the + load balancer. This name can be used to access the resource. + :paramtype name: str + :keyword protocol: The protocol of the end point. If 'Tcp' is specified, a received ACK is + required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. Known values are: "Http", + "Tcp", and "Https". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ProbeProtocol + :keyword port: The port for communicating the probe. Possible values range from 1 to 65535, + inclusive. + :paramtype port: int + :keyword interval_in_seconds: The interval, in seconds, for how frequently to probe the + endpoint for health status. Typically, the interval is slightly less than half the allocated + timeout period (in seconds) which allows two full probes before taking the instance out of + rotation. The default value is 15, the minimum value is 5. + :paramtype interval_in_seconds: int + :keyword number_of_probes: The number of probes where if no response, will result in stopping + further traffic from being delivered to the endpoint. This values allows endpoints to be taken + out of rotation faster or slower than the typical times used in Azure. + :paramtype number_of_probes: int + :keyword probe_threshold: The number of consecutive successful or failed probes in order to + allow or deny traffic from being delivered to this endpoint. After failing the number of + consecutive probes equal to this value, the endpoint will be taken out of rotation and require + the same number of successful consecutive probes to be placed back in rotation. + :paramtype probe_threshold: int + :keyword request_path: The URI used for requesting health status from the VM. Path is required + if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + :paramtype request_path: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.probe_threshold = probe_threshold + self.request_path = request_path + self.provisioning_state = None + + +class PropagatedRouteTable(_serialization.Model): + """The list of RouteTables to advertise the routes to. + + :ivar labels: The list of labels. + :vartype labels: list[str] + :ivar ids: The list of resource ids of all the RouteTables. + :vartype ids: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _attribute_map = { + "labels": {"key": "labels", "type": "[str]"}, + "ids": {"key": "ids", "type": "[SubResource]"}, + } + + def __init__( + self, *, labels: Optional[List[str]] = None, ids: Optional[List["_models.SubResource"]] = None, **kwargs: Any + ) -> None: + """ + :keyword labels: The list of labels. + :paramtype labels: list[str] + :keyword ids: The list of resource ids of all the RouteTables. + :paramtype ids: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(**kwargs) + self.labels = labels + self.ids = ids + + +class ProtocolConfiguration(_serialization.Model): + """Configuration of the protocol. + + :ivar http_configuration: HTTP configuration of the connectivity check. + :vartype http_configuration: ~azure.mgmt.network.v2023_09_01.models.HTTPConfiguration + """ + + _attribute_map = { + "http_configuration": {"key": "HTTPConfiguration", "type": "HTTPConfiguration"}, + } + + def __init__(self, *, http_configuration: Optional["_models.HTTPConfiguration"] = None, **kwargs: Any) -> None: + """ + :keyword http_configuration: HTTP configuration of the connectivity check. + :paramtype http_configuration: ~azure.mgmt.network.v2023_09_01.models.HTTPConfiguration + """ + super().__init__(**kwargs) + self.http_configuration = http_configuration + + +class PublicIPAddress(Resource): # pylint: disable=too-many-instance-attributes + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the public ip address. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar sku: The public IP address SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :vartype zones: list[str] + :ivar public_ip_allocation_method: The public IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype public_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar public_ip_address_version: The public IP address version. Known values are: "IPv4" and + "IPv6". + :vartype public_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2023_09_01.models.IPConfiguration + :ivar dns_settings: The FQDN of the DNS record associated with the public IP address. + :vartype dns_settings: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressDnsSettings + :ivar ddos_settings: The DDoS protection custom policy associated with the public IP address. + :vartype ddos_settings: ~azure.mgmt.network.v2023_09_01.models.DdosSettings + :ivar ip_tags: The list of tags associated with the public IP address. + :vartype ip_tags: list[~azure.mgmt.network.v2023_09_01.models.IpTag] + :ivar ip_address: The IP address associated with the public IP address resource. + :vartype ip_address: str + :ivar public_ip_prefix: The Public IP Prefix this Public IP Address should be allocated from. + :vartype public_ip_prefix: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar idle_timeout_in_minutes: The idle timeout of the public IP address. + :vartype idle_timeout_in_minutes: int + :ivar resource_guid: The resource GUID property of the public IP address resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the public IP address resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar service_public_ip_address: The service public IP address of the public IP address + resource. + :vartype service_public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :ivar nat_gateway: The NatGateway for the Public IP address. + :vartype nat_gateway: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :ivar migration_phase: Migration phase of Public IP Address. Known values are: "None", + "Prepare", "Commit", "Abort", and "Committed". + :vartype migration_phase: str or + ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressMigrationPhase + :ivar linked_public_ip_address: The linked public IP address of the public IP address resource. + :vartype linked_public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :ivar delete_option: Specify what happens to the public IP address when the VM using it is + deleted. Known values are: "Delete" and "Detach". + :vartype delete_option: str or ~azure.mgmt.network.v2023_09_01.models.DeleteOptions + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "ip_configuration": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "sku": {"key": "sku", "type": "PublicIPAddressSku"}, + "etag": {"key": "etag", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "public_ip_allocation_method": {"key": "properties.publicIPAllocationMethod", "type": "str"}, + "public_ip_address_version": {"key": "properties.publicIPAddressVersion", "type": "str"}, + "ip_configuration": {"key": "properties.ipConfiguration", "type": "IPConfiguration"}, + "dns_settings": {"key": "properties.dnsSettings", "type": "PublicIPAddressDnsSettings"}, + "ddos_settings": {"key": "properties.ddosSettings", "type": "DdosSettings"}, + "ip_tags": {"key": "properties.ipTags", "type": "[IpTag]"}, + "ip_address": {"key": "properties.ipAddress", "type": "str"}, + "public_ip_prefix": {"key": "properties.publicIPPrefix", "type": "SubResource"}, + "idle_timeout_in_minutes": {"key": "properties.idleTimeoutInMinutes", "type": "int"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "service_public_ip_address": {"key": "properties.servicePublicIPAddress", "type": "PublicIPAddress"}, + "nat_gateway": {"key": "properties.natGateway", "type": "NatGateway"}, + "migration_phase": {"key": "properties.migrationPhase", "type": "str"}, + "linked_public_ip_address": {"key": "properties.linkedPublicIPAddress", "type": "PublicIPAddress"}, + "delete_option": {"key": "properties.deleteOption", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + sku: Optional["_models.PublicIPAddressSku"] = None, + zones: Optional[List[str]] = None, + public_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + public_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + dns_settings: Optional["_models.PublicIPAddressDnsSettings"] = None, + ddos_settings: Optional["_models.DdosSettings"] = None, + ip_tags: Optional[List["_models.IpTag"]] = None, + ip_address: Optional[str] = None, + public_ip_prefix: Optional["_models.SubResource"] = None, + idle_timeout_in_minutes: Optional[int] = None, + service_public_ip_address: Optional["_models.PublicIPAddress"] = None, + nat_gateway: Optional["_models.NatGateway"] = None, + migration_phase: Optional[Union[str, "_models.PublicIPAddressMigrationPhase"]] = None, + linked_public_ip_address: Optional["_models.PublicIPAddress"] = None, + delete_option: Optional[Union[str, "_models.DeleteOptions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the public ip address. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword sku: The public IP address SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressSku + :keyword zones: A list of availability zones denoting the IP allocated for the resource needs + to come from. + :paramtype zones: list[str] + :keyword public_ip_allocation_method: The public IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype public_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword public_ip_address_version: The public IP address version. Known values are: "IPv4" and + "IPv6". + :paramtype public_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :keyword dns_settings: The FQDN of the DNS record associated with the public IP address. + :paramtype dns_settings: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressDnsSettings + :keyword ddos_settings: The DDoS protection custom policy associated with the public IP + address. + :paramtype ddos_settings: ~azure.mgmt.network.v2023_09_01.models.DdosSettings + :keyword ip_tags: The list of tags associated with the public IP address. + :paramtype ip_tags: list[~azure.mgmt.network.v2023_09_01.models.IpTag] + :keyword ip_address: The IP address associated with the public IP address resource. + :paramtype ip_address: str + :keyword public_ip_prefix: The Public IP Prefix this Public IP Address should be allocated + from. + :paramtype public_ip_prefix: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword idle_timeout_in_minutes: The idle timeout of the public IP address. + :paramtype idle_timeout_in_minutes: int + :keyword service_public_ip_address: The service public IP address of the public IP address + resource. + :paramtype service_public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :keyword nat_gateway: The NatGateway for the Public IP address. + :paramtype nat_gateway: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :keyword migration_phase: Migration phase of Public IP Address. Known values are: "None", + "Prepare", "Commit", "Abort", and "Committed". + :paramtype migration_phase: str or + ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressMigrationPhase + :keyword linked_public_ip_address: The linked public IP address of the public IP address + resource. + :paramtype linked_public_ip_address: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :keyword delete_option: Specify what happens to the public IP address when the VM using it is + deleted. Known values are: "Delete" and "Detach". + :paramtype delete_option: str or ~azure.mgmt.network.v2023_09_01.models.DeleteOptions + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.sku = sku + self.etag = None + self.zones = zones + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ddos_settings = ddos_settings + self.ip_tags = ip_tags + self.ip_address = ip_address + self.public_ip_prefix = public_ip_prefix + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = None + self.provisioning_state = None + self.service_public_ip_address = service_public_ip_address + self.nat_gateway = nat_gateway + self.migration_phase = migration_phase + self.linked_public_ip_address = linked_public_ip_address + self.delete_option = delete_option + + +class PublicIPAddressDnsSettings(_serialization.Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :ivar domain_name_label: The domain name label. The concatenation of the domain name label and + the regionalized DNS zone make up the fully qualified domain name associated with the public IP + address. If a domain name label is specified, an A DNS record is created for the public IP in + the Microsoft Azure DNS system. + :vartype domain_name_label: str + :ivar domain_name_label_scope: The domain name label scope. If a domain name label and a domain + name label scope are specified, an A DNS record is created for the public IP in the Microsoft + Azure DNS system with a hashed value includes in FQDN. Known values are: "TenantReuse", + "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse". + :vartype domain_name_label_scope: str or + ~azure.mgmt.network.v2023_09_01.models.PublicIpAddressDnsSettingsDomainNameLabelScope + :ivar fqdn: The Fully Qualified Domain Name of the A DNS record associated with the public IP. + This is the concatenation of the domainNameLabel and the regionalized DNS zone. + :vartype fqdn: str + :ivar reverse_fqdn: The reverse FQDN. A user-visible, fully qualified domain name that resolves + to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created + pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + :vartype reverse_fqdn: str + """ + + _attribute_map = { + "domain_name_label": {"key": "domainNameLabel", "type": "str"}, + "domain_name_label_scope": {"key": "domainNameLabelScope", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "reverse_fqdn": {"key": "reverseFqdn", "type": "str"}, + } + + def __init__( + self, + *, + domain_name_label: Optional[str] = None, + domain_name_label_scope: Optional[Union[str, "_models.PublicIpAddressDnsSettingsDomainNameLabelScope"]] = None, + fqdn: Optional[str] = None, + reverse_fqdn: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword domain_name_label: The domain name label. The concatenation of the domain name label + and the regionalized DNS zone make up the fully qualified domain name associated with the + public IP address. If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :paramtype domain_name_label: str + :keyword domain_name_label_scope: The domain name label scope. If a domain name label and a + domain name label scope are specified, an A DNS record is created for the public IP in the + Microsoft Azure DNS system with a hashed value includes in FQDN. Known values are: + "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse". + :paramtype domain_name_label_scope: str or + ~azure.mgmt.network.v2023_09_01.models.PublicIpAddressDnsSettingsDomainNameLabelScope + :keyword fqdn: The Fully Qualified Domain Name of the A DNS record associated with the public + IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + :paramtype fqdn: str + :keyword reverse_fqdn: The reverse FQDN. A user-visible, fully qualified domain name that + resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is + created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + :paramtype reverse_fqdn: str + """ + super().__init__(**kwargs) + self.domain_name_label = domain_name_label + self.domain_name_label_scope = domain_name_label_scope + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn + + +class PublicIPAddressListResult(_serialization.Model): + """Response for ListPublicIpAddresses API service call. + + :ivar value: A list of public IP addresses that exists in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PublicIPAddress]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.PublicIPAddress"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of public IP addresses that exists in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PublicIPAddressSku(_serialization.Model): + """SKU of a public IP address. + + :ivar name: Name of a public IP address SKU. Known values are: "Basic" and "Standard". + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressSkuName + :ivar tier: Tier of a public IP address SKU. Known values are: "Regional" and "Global". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressSkuTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.PublicIPAddressSkuName"]] = None, + tier: Optional[Union[str, "_models.PublicIPAddressSkuTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of a public IP address SKU. Known values are: "Basic" and "Standard". + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressSkuName + :keyword tier: Tier of a public IP address SKU. Known values are: "Regional" and "Global". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPAddressSkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class PublicIpDdosProtectionStatusResult(_serialization.Model): + """Response for GetPublicIpAddressDdosProtectionStatusOperation API service call. + + :ivar public_ip_address_id: Public IP ARM resource ID. + :vartype public_ip_address_id: str + :ivar public_ip_address: IP Address of the Public IP Resource. + :vartype public_ip_address: str + :ivar is_workload_protected: Value indicating whether the IP address is DDoS workload protected + or not. Known values are: "False" and "True". + :vartype is_workload_protected: str or + ~azure.mgmt.network.v2023_09_01.models.IsWorkloadProtected + :ivar ddos_protection_plan_id: DDoS protection plan Resource Id of a if IP address is protected + through a plan. + :vartype ddos_protection_plan_id: str + """ + + _attribute_map = { + "public_ip_address_id": {"key": "publicIpAddressId", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "is_workload_protected": {"key": "isWorkloadProtected", "type": "str"}, + "ddos_protection_plan_id": {"key": "ddosProtectionPlanId", "type": "str"}, + } + + def __init__( + self, + *, + public_ip_address_id: Optional[str] = None, + public_ip_address: Optional[str] = None, + is_workload_protected: Optional[Union[str, "_models.IsWorkloadProtected"]] = None, + ddos_protection_plan_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword public_ip_address_id: Public IP ARM resource ID. + :paramtype public_ip_address_id: str + :keyword public_ip_address: IP Address of the Public IP Resource. + :paramtype public_ip_address: str + :keyword is_workload_protected: Value indicating whether the IP address is DDoS workload + protected or not. Known values are: "False" and "True". + :paramtype is_workload_protected: str or + ~azure.mgmt.network.v2023_09_01.models.IsWorkloadProtected + :keyword ddos_protection_plan_id: DDoS protection plan Resource Id of a if IP address is + protected through a plan. + :paramtype ddos_protection_plan_id: str + """ + super().__init__(**kwargs) + self.public_ip_address_id = public_ip_address_id + self.public_ip_address = public_ip_address + self.is_workload_protected = is_workload_protected + self.ddos_protection_plan_id = ddos_protection_plan_id + + +class PublicIPPrefix(Resource): # pylint: disable=too-many-instance-attributes + """Public IP prefix resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the public ip address. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar sku: The public IP prefix SKU. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefixSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :vartype zones: list[str] + :ivar public_ip_address_version: The public IP address version. Known values are: "IPv4" and + "IPv6". + :vartype public_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :ivar ip_tags: The list of tags associated with the public IP prefix. + :vartype ip_tags: list[~azure.mgmt.network.v2023_09_01.models.IpTag] + :ivar prefix_length: The Length of the Public IP Prefix. + :vartype prefix_length: int + :ivar ip_prefix: The allocated Prefix. + :vartype ip_prefix: str + :ivar public_ip_addresses: The list of all referenced PublicIPAddresses. + :vartype public_ip_addresses: + list[~azure.mgmt.network.v2023_09_01.models.ReferencedPublicIpAddress] + :ivar load_balancer_frontend_ip_configuration: The reference to load balancer frontend IP + configuration associated with the public IP prefix. + :vartype load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar custom_ip_prefix: The customIpPrefix that this prefix is associated with. + :vartype custom_ip_prefix: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar resource_guid: The resource GUID property of the public IP prefix resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the public IP prefix resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar nat_gateway: NatGateway of Public IP Prefix. + :vartype nat_gateway: ~azure.mgmt.network.v2023_09_01.models.NatGateway + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "ip_prefix": {"readonly": True}, + "public_ip_addresses": {"readonly": True}, + "load_balancer_frontend_ip_configuration": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "sku": {"key": "sku", "type": "PublicIPPrefixSku"}, + "etag": {"key": "etag", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "public_ip_address_version": {"key": "properties.publicIPAddressVersion", "type": "str"}, + "ip_tags": {"key": "properties.ipTags", "type": "[IpTag]"}, + "prefix_length": {"key": "properties.prefixLength", "type": "int"}, + "ip_prefix": {"key": "properties.ipPrefix", "type": "str"}, + "public_ip_addresses": {"key": "properties.publicIPAddresses", "type": "[ReferencedPublicIpAddress]"}, + "load_balancer_frontend_ip_configuration": { + "key": "properties.loadBalancerFrontendIpConfiguration", + "type": "SubResource", + }, + "custom_ip_prefix": {"key": "properties.customIPPrefix", "type": "SubResource"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "nat_gateway": {"key": "properties.natGateway", "type": "NatGateway"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + sku: Optional["_models.PublicIPPrefixSku"] = None, + zones: Optional[List[str]] = None, + public_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + ip_tags: Optional[List["_models.IpTag"]] = None, + prefix_length: Optional[int] = None, + custom_ip_prefix: Optional["_models.SubResource"] = None, + nat_gateway: Optional["_models.NatGateway"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the public ip address. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword sku: The public IP prefix SKU. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefixSku + :keyword zones: A list of availability zones denoting the IP allocated for the resource needs + to come from. + :paramtype zones: list[str] + :keyword public_ip_address_version: The public IP address version. Known values are: "IPv4" and + "IPv6". + :paramtype public_ip_address_version: str or ~azure.mgmt.network.v2023_09_01.models.IPVersion + :keyword ip_tags: The list of tags associated with the public IP prefix. + :paramtype ip_tags: list[~azure.mgmt.network.v2023_09_01.models.IpTag] + :keyword prefix_length: The Length of the Public IP Prefix. + :paramtype prefix_length: int + :keyword custom_ip_prefix: The customIpPrefix that this prefix is associated with. + :paramtype custom_ip_prefix: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword nat_gateway: NatGateway of Public IP Prefix. + :paramtype nat_gateway: ~azure.mgmt.network.v2023_09_01.models.NatGateway + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.sku = sku + self.etag = None + self.zones = zones + self.public_ip_address_version = public_ip_address_version + self.ip_tags = ip_tags + self.prefix_length = prefix_length + self.ip_prefix = None + self.public_ip_addresses = None + self.load_balancer_frontend_ip_configuration = None + self.custom_ip_prefix = custom_ip_prefix + self.resource_guid = None + self.provisioning_state = None + self.nat_gateway = nat_gateway + + +class PublicIPPrefixListResult(_serialization.Model): + """Response for ListPublicIpPrefixes API service call. + + :ivar value: A list of public IP prefixes that exists in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PublicIPPrefix]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.PublicIPPrefix"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of public IP prefixes that exists in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PublicIPPrefixSku(_serialization.Model): + """SKU of a public IP prefix. + + :ivar name: Name of a public IP prefix SKU. "Standard" + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefixSkuName + :ivar tier: Tier of a public IP prefix SKU. Known values are: "Regional" and "Global". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefixSkuTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.PublicIPPrefixSkuName"]] = None, + tier: Optional[Union[str, "_models.PublicIPPrefixSkuTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of a public IP prefix SKU. "Standard" + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefixSkuName + :keyword tier: Tier of a public IP prefix SKU. Known values are: "Regional" and "Global". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefixSkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class QosDefinition(_serialization.Model): + """Quality of Service defines the traffic configuration between endpoints. Mandatory to have one + marking. + + :ivar markings: List of markings to be used in the configuration. + :vartype markings: list[int] + :ivar source_ip_ranges: Source IP ranges. + :vartype source_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :ivar destination_ip_ranges: Destination IP ranges. + :vartype destination_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :ivar source_port_ranges: Sources port ranges. + :vartype source_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :ivar destination_port_ranges: Destination port ranges. + :vartype destination_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :ivar protocol: RNM supported protocol types. Known values are: "DoNotUse", "Icmp", "Tcp", + "Udp", "Gre", "Esp", "Ah", "Vxlan", and "All". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ProtocolType + """ + + _attribute_map = { + "markings": {"key": "markings", "type": "[int]"}, + "source_ip_ranges": {"key": "sourceIpRanges", "type": "[QosIpRange]"}, + "destination_ip_ranges": {"key": "destinationIpRanges", "type": "[QosIpRange]"}, + "source_port_ranges": {"key": "sourcePortRanges", "type": "[QosPortRange]"}, + "destination_port_ranges": {"key": "destinationPortRanges", "type": "[QosPortRange]"}, + "protocol": {"key": "protocol", "type": "str"}, + } + + def __init__( + self, + *, + markings: Optional[List[int]] = None, + source_ip_ranges: Optional[List["_models.QosIpRange"]] = None, + destination_ip_ranges: Optional[List["_models.QosIpRange"]] = None, + source_port_ranges: Optional[List["_models.QosPortRange"]] = None, + destination_port_ranges: Optional[List["_models.QosPortRange"]] = None, + protocol: Optional[Union[str, "_models.ProtocolType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword markings: List of markings to be used in the configuration. + :paramtype markings: list[int] + :keyword source_ip_ranges: Source IP ranges. + :paramtype source_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :keyword destination_ip_ranges: Destination IP ranges. + :paramtype destination_ip_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosIpRange] + :keyword source_port_ranges: Sources port ranges. + :paramtype source_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :keyword destination_port_ranges: Destination port ranges. + :paramtype destination_port_ranges: list[~azure.mgmt.network.v2023_09_01.models.QosPortRange] + :keyword protocol: RNM supported protocol types. Known values are: "DoNotUse", "Icmp", "Tcp", + "Udp", "Gre", "Esp", "Ah", "Vxlan", and "All". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.ProtocolType + """ + super().__init__(**kwargs) + self.markings = markings + self.source_ip_ranges = source_ip_ranges + self.destination_ip_ranges = destination_ip_ranges + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.protocol = protocol + + +class QosIpRange(_serialization.Model): + """Qos Traffic Profiler IP Range properties. + + :ivar start_ip: Start IP Address. + :vartype start_ip: str + :ivar end_ip: End IP Address. + :vartype end_ip: str + """ + + _attribute_map = { + "start_ip": {"key": "startIP", "type": "str"}, + "end_ip": {"key": "endIP", "type": "str"}, + } + + def __init__(self, *, start_ip: Optional[str] = None, end_ip: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword start_ip: Start IP Address. + :paramtype start_ip: str + :keyword end_ip: End IP Address. + :paramtype end_ip: str + """ + super().__init__(**kwargs) + self.start_ip = start_ip + self.end_ip = end_ip + + +class QosPortRange(_serialization.Model): + """Qos Traffic Profiler Port range properties. + + :ivar start: Qos Port Range start. + :vartype start: int + :ivar end: Qos Port Range end. + :vartype end: int + """ + + _attribute_map = { + "start": {"key": "start", "type": "int"}, + "end": {"key": "end", "type": "int"}, + } + + def __init__(self, *, start: Optional[int] = None, end: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword start: Qos Port Range start. + :paramtype start: int + :keyword end: Qos Port Range end. + :paramtype end: int + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class QueryInboundNatRulePortMappingRequest(_serialization.Model): + """The request for a QueryInboundNatRulePortMapping API. Either IpConfiguration or IpAddress + should be set. + + :ivar ip_configuration: NetworkInterfaceIPConfiguration set in load balancer backend address. + :vartype ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar ip_address: IP address set in load balancer backend address. + :vartype ip_address: str + """ + + _attribute_map = { + "ip_configuration": {"key": "ipConfiguration", "type": "SubResource"}, + "ip_address": {"key": "ipAddress", "type": "str"}, + } + + def __init__( + self, + *, + ip_configuration: Optional["_models.SubResource"] = None, + ip_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword ip_configuration: NetworkInterfaceIPConfiguration set in load balancer backend + address. + :paramtype ip_configuration: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword ip_address: IP address set in load balancer backend address. + :paramtype ip_address: str + """ + super().__init__(**kwargs) + self.ip_configuration = ip_configuration + self.ip_address = ip_address + + +class QueryRequestOptions(_serialization.Model): + """Query Request Options. + + :ivar skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :vartype skip_token: str + """ + + _attribute_map = { + "skip_token": {"key": "skipToken", "type": "str"}, + } + + def __init__(self, *, skip_token: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword skip_token: When present, the value can be passed to a subsequent query call (together + with the same query and scopes used in the current request) to retrieve the next page of data. + :paramtype skip_token: str + """ + super().__init__(**kwargs) + self.skip_token = skip_token + + +class QueryResults(_serialization.Model): + """Query result. + + :ivar matching_records_count: Number of total records matching the query. + :vartype matching_records_count: int + :ivar signatures: Array containing the results of the query. + :vartype signatures: list[~azure.mgmt.network.v2023_09_01.models.SingleQueryResult] + """ + + _attribute_map = { + "matching_records_count": {"key": "matchingRecordsCount", "type": "int"}, + "signatures": {"key": "signatures", "type": "[SingleQueryResult]"}, + } + + def __init__( + self, + *, + matching_records_count: Optional[int] = None, + signatures: Optional[List["_models.SingleQueryResult"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword matching_records_count: Number of total records matching the query. + :paramtype matching_records_count: int + :keyword signatures: Array containing the results of the query. + :paramtype signatures: list[~azure.mgmt.network.v2023_09_01.models.SingleQueryResult] + """ + super().__init__(**kwargs) + self.matching_records_count = matching_records_count + self.signatures = signatures + + +class QueryTroubleshootingParameters(_serialization.Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The target resource ID to query the troubleshooting result. Required. + :vartype target_resource_id: str + """ + + _validation = { + "target_resource_id": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + } + + def __init__(self, *, target_resource_id: str, **kwargs: Any) -> None: + """ + :keyword target_resource_id: The target resource ID to query the troubleshooting result. + Required. + :paramtype target_resource_id: str + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + + +class RadiusServer(_serialization.Model): + """Radius Server Settings. + + All required parameters must be populated in order to send to server. + + :ivar radius_server_address: The address of this radius server. Required. + :vartype radius_server_address: str + :ivar radius_server_score: The initial score assigned to this radius server. + :vartype radius_server_score: int + :ivar radius_server_secret: The secret used for this radius server. + :vartype radius_server_secret: str + """ + + _validation = { + "radius_server_address": {"required": True}, + } + + _attribute_map = { + "radius_server_address": {"key": "radiusServerAddress", "type": "str"}, + "radius_server_score": {"key": "radiusServerScore", "type": "int"}, + "radius_server_secret": {"key": "radiusServerSecret", "type": "str"}, + } + + def __init__( + self, + *, + radius_server_address: str, + radius_server_score: Optional[int] = None, + radius_server_secret: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword radius_server_address: The address of this radius server. Required. + :paramtype radius_server_address: str + :keyword radius_server_score: The initial score assigned to this radius server. + :paramtype radius_server_score: int + :keyword radius_server_secret: The secret used for this radius server. + :paramtype radius_server_secret: str + """ + super().__init__(**kwargs) + self.radius_server_address = radius_server_address + self.radius_server_score = radius_server_score + self.radius_server_secret = radius_server_secret + + +class RecordSet(_serialization.Model): + """A collective group of information about the record set information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar record_type: Resource record type. + :vartype record_type: str + :ivar record_set_name: Recordset name. + :vartype record_set_name: str + :ivar fqdn: Fqdn that resolves to private endpoint ip address. + :vartype fqdn: str + :ivar provisioning_state: The provisioning state of the recordset. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar ttl: Recordset time to live. + :vartype ttl: int + :ivar ip_addresses: The private ip address of the private endpoint. + :vartype ip_addresses: list[str] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "record_type": {"key": "recordType", "type": "str"}, + "record_set_name": {"key": "recordSetName", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "ttl": {"key": "ttl", "type": "int"}, + "ip_addresses": {"key": "ipAddresses", "type": "[str]"}, + } + + def __init__( + self, + *, + record_type: Optional[str] = None, + record_set_name: Optional[str] = None, + fqdn: Optional[str] = None, + ttl: Optional[int] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword record_type: Resource record type. + :paramtype record_type: str + :keyword record_set_name: Recordset name. + :paramtype record_set_name: str + :keyword fqdn: Fqdn that resolves to private endpoint ip address. + :paramtype fqdn: str + :keyword ttl: Recordset time to live. + :paramtype ttl: int + :keyword ip_addresses: The private ip address of the private endpoint. + :paramtype ip_addresses: list[str] + """ + super().__init__(**kwargs) + self.record_type = record_type + self.record_set_name = record_set_name + self.fqdn = fqdn + self.provisioning_state = None + self.ttl = ttl + self.ip_addresses = ip_addresses + + +class ReferencedPublicIpAddress(_serialization.Model): + """Reference to a public IP address. + + :ivar id: The PublicIPAddress Reference. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The PublicIPAddress Reference. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar linked_resource_type: Resource type of the linked resource. + :vartype linked_resource_type: str + :ivar link: Link to the external resource. + :vartype link: str + :ivar provisioning_state: The provisioning state of the resource navigation link resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "linked_resource_type": {"key": "properties.linkedResourceType", "type": "str"}, + "link": {"key": "properties.link", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + linked_resource_type: Optional[str] = None, + link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the resource that is unique within a resource group. This name can be + used to access the resource. + :paramtype name: str + :keyword linked_resource_type: Resource type of the linked resource. + :paramtype linked_resource_type: str + :keyword link: Link to the external resource. + :paramtype link: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + + +class ResourceNavigationLinksListResult(_serialization.Model): + """Response for ResourceNavigationLinks_List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The resource navigation links in a subnet. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ResourceNavigationLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ResourceNavigationLink]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ResourceNavigationLink"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The resource navigation links in a subnet. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ResourceNavigationLink] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class RetentionPolicyParameters(_serialization.Model): + """Parameters that define the retention policy for flow log. + + :ivar days: Number of days to retain flow log records. + :vartype days: int + :ivar enabled: Flag to enable/disable retention. + :vartype enabled: bool + """ + + _attribute_map = { + "days": {"key": "days", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, days: int = 0, enabled: bool = False, **kwargs: Any) -> None: + """ + :keyword days: Number of days to retain flow log records. + :paramtype days: int + :keyword enabled: Flag to enable/disable retention. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.days = days + self.enabled = enabled + + +class Route(SubResource): + """Route resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The type of the resource. + :vartype type: str + :ivar address_prefix: The destination CIDR to which the route applies. + :vartype address_prefix: str + :ivar next_hop_type: The type of Azure hop the packet should be sent to. Known values are: + "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", and "None". + :vartype next_hop_type: str or ~azure.mgmt.network.v2023_09_01.models.RouteNextHopType + :ivar next_hop_ip_address: The IP address packets should be forwarded to. Next hop values are + only allowed in routes where the next hop type is VirtualAppliance. + :vartype next_hop_ip_address: str + :ivar provisioning_state: The provisioning state of the route resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar has_bgp_override: A value indicating whether this route overrides overlapping BGP routes + regardless of LPM. + :vartype has_bgp_override: bool + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "next_hop_type": {"key": "properties.nextHopType", "type": "str"}, + "next_hop_ip_address": {"key": "properties.nextHopIpAddress", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "has_bgp_override": {"key": "properties.hasBgpOverride", "type": "bool"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + address_prefix: Optional[str] = None, + next_hop_type: Optional[Union[str, "_models.RouteNextHopType"]] = None, + next_hop_ip_address: Optional[str] = None, + has_bgp_override: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type: The type of the resource. + :paramtype type: str + :keyword address_prefix: The destination CIDR to which the route applies. + :paramtype address_prefix: str + :keyword next_hop_type: The type of Azure hop the packet should be sent to. Known values are: + "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", and "None". + :paramtype next_hop_type: str or ~azure.mgmt.network.v2023_09_01.models.RouteNextHopType + :keyword next_hop_ip_address: The IP address packets should be forwarded to. Next hop values + are only allowed in routes where the next hop type is VirtualAppliance. + :paramtype next_hop_ip_address: str + :keyword has_bgp_override: A value indicating whether this route overrides overlapping BGP + routes regardless of LPM. + :paramtype has_bgp_override: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = None + self.has_bgp_override = has_bgp_override + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar rules: Collection of RouteFilterRules contained within a route filter. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the route filter resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "peerings": {"readonly": True}, + "ipv6_peerings": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "rules": {"key": "properties.rules", "type": "[RouteFilterRule]"}, + "peerings": {"key": "properties.peerings", "type": "[ExpressRouteCircuitPeering]"}, + "ipv6_peerings": {"key": "properties.ipv6Peerings", "type": "[ExpressRouteCircuitPeering]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + rules: Optional[List["_models.RouteFilterRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword rules: Collection of RouteFilterRules contained within a route filter. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.rules = rules + self.peerings = None + self.ipv6_peerings = None + self.provisioning_state = None + + +class RouteFilterListResult(_serialization.Model): + """Response for the ListRouteFilters API service call. + + :ivar value: A list of route filters in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[RouteFilter]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.RouteFilter"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of route filters in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar access: The access type of the rule. Known values are: "Allow" and "Deny". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. "Community" + :vartype route_filter_rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.RouteFilterRuleType + :ivar communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :vartype communities: list[str] + :ivar provisioning_state: The provisioning state of the route filter rule resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "access": {"key": "properties.access", "type": "str"}, + "route_filter_rule_type": {"key": "properties.routeFilterRuleType", "type": "str"}, + "communities": {"key": "properties.communities", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + location: Optional[str] = None, + access: Optional[Union[str, "_models.Access"]] = None, + route_filter_rule_type: Optional[Union[str, "_models.RouteFilterRuleType"]] = None, + communities: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword location: Resource location. + :paramtype location: str + :keyword access: The access type of the rule. Known values are: "Allow" and "Deny". + :paramtype access: str or ~azure.mgmt.network.v2023_09_01.models.Access + :keyword route_filter_rule_type: The rule type of the rule. "Community" + :paramtype route_filter_rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.RouteFilterRuleType + :keyword communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :paramtype communities: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.location = location + self.etag = None + self.access = access + self.route_filter_rule_type = route_filter_rule_type + self.communities = communities + self.provisioning_state = None + + +class RouteFilterRuleListResult(_serialization.Model): + """Response for the ListRouteFilterRules API service call. + + :ivar value: A list of RouteFilterRules in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[RouteFilterRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.RouteFilterRule"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of RouteFilterRules in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RouteListResult(_serialization.Model): + """Response for the ListRoute API service call. + + :ivar value: A list of routes in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.Route] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[Route]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.Route"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of routes in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.Route] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RouteMap(SubResource): + """The RouteMap child resource of a Virtual hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar associated_inbound_connections: List of connections which have this RoutMap associated + for inbound traffic. + :vartype associated_inbound_connections: list[str] + :ivar associated_outbound_connections: List of connections which have this RoutMap associated + for outbound traffic. + :vartype associated_outbound_connections: list[str] + :ivar rules: List of RouteMap rules to be applied. + :vartype rules: list[~azure.mgmt.network.v2023_09_01.models.RouteMapRule] + :ivar provisioning_state: The provisioning state of the RouteMap resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "associated_inbound_connections": {"key": "properties.associatedInboundConnections", "type": "[str]"}, + "associated_outbound_connections": {"key": "properties.associatedOutboundConnections", "type": "[str]"}, + "rules": {"key": "properties.rules", "type": "[RouteMapRule]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + associated_inbound_connections: Optional[List[str]] = None, + associated_outbound_connections: Optional[List[str]] = None, + rules: Optional[List["_models.RouteMapRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword associated_inbound_connections: List of connections which have this RoutMap associated + for inbound traffic. + :paramtype associated_inbound_connections: list[str] + :keyword associated_outbound_connections: List of connections which have this RoutMap + associated for outbound traffic. + :paramtype associated_outbound_connections: list[str] + :keyword rules: List of RouteMap rules to be applied. + :paramtype rules: list[~azure.mgmt.network.v2023_09_01.models.RouteMapRule] + """ + super().__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.type = None + self.associated_inbound_connections = associated_inbound_connections + self.associated_outbound_connections = associated_outbound_connections + self.rules = rules + self.provisioning_state = None + + +class RouteMapRule(_serialization.Model): + """A RouteMap Rule. + + :ivar name: The unique name for the rule. + :vartype name: str + :ivar match_criteria: List of matching criterion which will be applied to traffic. + :vartype match_criteria: list[~azure.mgmt.network.v2023_09_01.models.Criterion] + :ivar actions: List of actions which will be applied on a match. + :vartype actions: list[~azure.mgmt.network.v2023_09_01.models.Action] + :ivar next_step_if_matched: Next step after rule is evaluated. Current supported behaviors are + 'Continue'(to next rule) and 'Terminate'. Known values are: "Unknown", "Continue", and + "Terminate". + :vartype next_step_if_matched: str or ~azure.mgmt.network.v2023_09_01.models.NextStep + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "match_criteria": {"key": "matchCriteria", "type": "[Criterion]"}, + "actions": {"key": "actions", "type": "[Action]"}, + "next_step_if_matched": {"key": "nextStepIfMatched", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + match_criteria: Optional[List["_models.Criterion"]] = None, + actions: Optional[List["_models.Action"]] = None, + next_step_if_matched: Optional[Union[str, "_models.NextStep"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The unique name for the rule. + :paramtype name: str + :keyword match_criteria: List of matching criterion which will be applied to traffic. + :paramtype match_criteria: list[~azure.mgmt.network.v2023_09_01.models.Criterion] + :keyword actions: List of actions which will be applied on a match. + :paramtype actions: list[~azure.mgmt.network.v2023_09_01.models.Action] + :keyword next_step_if_matched: Next step after rule is evaluated. Current supported behaviors + are 'Continue'(to next rule) and 'Terminate'. Known values are: "Unknown", "Continue", and + "Terminate". + :paramtype next_step_if_matched: str or ~azure.mgmt.network.v2023_09_01.models.NextStep + """ + super().__init__(**kwargs) + self.name = name + self.match_criteria = match_criteria + self.actions = actions + self.next_step_if_matched = next_step_if_matched + + +class RouteTable(Resource): # pylint: disable=too-many-instance-attributes + """Route table resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar routes: Collection of routes contained within a route table. + :vartype routes: list[~azure.mgmt.network.v2023_09_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :ivar disable_bgp_route_propagation: Whether to disable the routes learned by BGP on that route + table. True means disable. + :vartype disable_bgp_route_propagation: bool + :ivar provisioning_state: The provisioning state of the route table resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: The resource GUID property of the route table. + :vartype resource_guid: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "subnets": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "routes": {"key": "properties.routes", "type": "[Route]"}, + "subnets": {"key": "properties.subnets", "type": "[Subnet]"}, + "disable_bgp_route_propagation": {"key": "properties.disableBgpRoutePropagation", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + routes: Optional[List["_models.Route"]] = None, + disable_bgp_route_propagation: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword routes: Collection of routes contained within a route table. + :paramtype routes: list[~azure.mgmt.network.v2023_09_01.models.Route] + :keyword disable_bgp_route_propagation: Whether to disable the routes learned by BGP on that + route table. True means disable. + :paramtype disable_bgp_route_propagation: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.routes = routes + self.subnets = None + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.provisioning_state = None + self.resource_guid = None + + +class RouteTableListResult(_serialization.Model): + """Response for the ListRouteTable API service call. + + :ivar value: A list of route tables in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[RouteTable]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.RouteTable"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of route tables in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RoutingConfiguration(_serialization.Model): + """Routing Configuration indicating the associated and propagated route tables for this + connection. + + :ivar associated_route_table: The resource id RouteTable associated with this + RoutingConfiguration. + :vartype associated_route_table: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar propagated_route_tables: The list of RouteTables to advertise the routes to. + :vartype propagated_route_tables: ~azure.mgmt.network.v2023_09_01.models.PropagatedRouteTable + :ivar vnet_routes: List of routes that control routing from VirtualHub into a virtual network + connection. + :vartype vnet_routes: ~azure.mgmt.network.v2023_09_01.models.VnetRoute + :ivar inbound_route_map: The resource id of the RouteMap associated with this + RoutingConfiguration for inbound learned routes. + :vartype inbound_route_map: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar outbound_route_map: The resource id of theRouteMap associated with this + RoutingConfiguration for outbound advertised routes. + :vartype outbound_route_map: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "associated_route_table": {"key": "associatedRouteTable", "type": "SubResource"}, + "propagated_route_tables": {"key": "propagatedRouteTables", "type": "PropagatedRouteTable"}, + "vnet_routes": {"key": "vnetRoutes", "type": "VnetRoute"}, + "inbound_route_map": {"key": "inboundRouteMap", "type": "SubResource"}, + "outbound_route_map": {"key": "outboundRouteMap", "type": "SubResource"}, + } + + def __init__( + self, + *, + associated_route_table: Optional["_models.SubResource"] = None, + propagated_route_tables: Optional["_models.PropagatedRouteTable"] = None, + vnet_routes: Optional["_models.VnetRoute"] = None, + inbound_route_map: Optional["_models.SubResource"] = None, + outbound_route_map: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword associated_route_table: The resource id RouteTable associated with this + RoutingConfiguration. + :paramtype associated_route_table: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword propagated_route_tables: The list of RouteTables to advertise the routes to. + :paramtype propagated_route_tables: ~azure.mgmt.network.v2023_09_01.models.PropagatedRouteTable + :keyword vnet_routes: List of routes that control routing from VirtualHub into a virtual + network connection. + :paramtype vnet_routes: ~azure.mgmt.network.v2023_09_01.models.VnetRoute + :keyword inbound_route_map: The resource id of the RouteMap associated with this + RoutingConfiguration for inbound learned routes. + :paramtype inbound_route_map: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword outbound_route_map: The resource id of theRouteMap associated with this + RoutingConfiguration for outbound advertised routes. + :paramtype outbound_route_map: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.associated_route_table = associated_route_table + self.propagated_route_tables = propagated_route_tables + self.vnet_routes = vnet_routes + self.inbound_route_map = inbound_route_map + self.outbound_route_map = outbound_route_map + + +class RoutingIntent(SubResource): + """The routing intent child resource of a Virtual hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar routing_policies: List of routing policies. + :vartype routing_policies: list[~azure.mgmt.network.v2023_09_01.models.RoutingPolicy] + :ivar provisioning_state: The provisioning state of the RoutingIntent resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "routing_policies": {"key": "properties.routingPolicies", "type": "[RoutingPolicy]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + routing_policies: Optional[List["_models.RoutingPolicy"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword routing_policies: List of routing policies. + :paramtype routing_policies: list[~azure.mgmt.network.v2023_09_01.models.RoutingPolicy] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.routing_policies = routing_policies + self.provisioning_state = None + + +class RoutingPolicy(_serialization.Model): + """The routing policy object used in a RoutingIntent resource. + + All required parameters must be populated in order to send to server. + + :ivar name: The unique name for the routing policy. Required. + :vartype name: str + :ivar destinations: List of all destinations which this routing policy is applicable to (for + example: Internet, PrivateTraffic). Required. + :vartype destinations: list[str] + :ivar next_hop: The next hop resource id on which this routing policy is applicable to. + Required. + :vartype next_hop: str + """ + + _validation = { + "name": {"required": True}, + "destinations": {"required": True}, + "next_hop": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "destinations": {"key": "destinations", "type": "[str]"}, + "next_hop": {"key": "nextHop", "type": "str"}, + } + + def __init__(self, *, name: str, destinations: List[str], next_hop: str, **kwargs: Any) -> None: + """ + :keyword name: The unique name for the routing policy. Required. + :paramtype name: str + :keyword destinations: List of all destinations which this routing policy is applicable to (for + example: Internet, PrivateTraffic). Required. + :paramtype destinations: list[str] + :keyword next_hop: The next hop resource id on which this routing policy is applicable to. + Required. + :paramtype next_hop: str + """ + super().__init__(**kwargs) + self.name = name + self.destinations = destinations + self.next_hop = next_hop + + +class ScopeConnection(ChildResource): + """The Scope Connections resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar tenant_id: Tenant ID. + :vartype tenant_id: str + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar connection_state: Connection State. Known values are: "Connected", "Pending", "Conflict", + "Revoked", and "Rejected". + :vartype connection_state: str or ~azure.mgmt.network.v2023_09_01.models.ScopeConnectionState + :ivar description: A description of the scope connection. + :vartype description: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "connection_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "resource_id": {"key": "properties.resourceId", "type": "str"}, + "connection_state": {"key": "properties.connectionState", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + } + + def __init__( + self, + *, + tenant_id: Optional[str] = None, + resource_id: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword tenant_id: Tenant ID. + :paramtype tenant_id: str + :keyword resource_id: Resource ID. + :paramtype resource_id: str + :keyword description: A description of the scope connection. + :paramtype description: str + """ + super().__init__(**kwargs) + self.system_data = None + self.tenant_id = tenant_id + self.resource_id = resource_id + self.connection_state = None + self.description = description + + +class ScopeConnectionListResult(_serialization.Model): + """List of scope connections. + + :ivar value: List of scope connections. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ScopeConnection] + :ivar next_link: Gets the URL to get the next page of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ScopeConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.ScopeConnection"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of scope connections. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ScopeConnection] + :keyword next_link: Gets the URL to get the next page of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SecurityAdminConfiguration(ChildResource): + """Defines the security admin configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar description: A description of the security configuration. + :vartype description: str + :ivar apply_on_network_intent_policy_based_services: Enum list of network intent policy based + services. + :vartype apply_on_network_intent_policy_based_services: list[str or + ~azure.mgmt.network.v2023_09_01.models.NetworkIntentPolicyBasedService] + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_guid: Unique identifier for this resource. + :vartype resource_guid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "description": {"key": "properties.description", "type": "str"}, + "apply_on_network_intent_policy_based_services": { + "key": "properties.applyOnNetworkIntentPolicyBasedServices", + "type": "[str]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + apply_on_network_intent_policy_based_services: Optional[ + List[Union[str, "_models.NetworkIntentPolicyBasedService"]] + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword description: A description of the security configuration. + :paramtype description: str + :keyword apply_on_network_intent_policy_based_services: Enum list of network intent policy + based services. + :paramtype apply_on_network_intent_policy_based_services: list[str or + ~azure.mgmt.network.v2023_09_01.models.NetworkIntentPolicyBasedService] + """ + super().__init__(**kwargs) + self.system_data = None + self.description = description + self.apply_on_network_intent_policy_based_services = apply_on_network_intent_policy_based_services + self.provisioning_state = None + self.resource_guid = None + + +class SecurityAdminConfigurationListResult(_serialization.Model): + """A list of network manager security admin configurations. + + :ivar value: Gets a page of security admin configurations. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration] + :ivar next_link: Gets the URL to get the next page of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SecurityAdminConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SecurityAdminConfiguration"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of security admin configurations. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration] + :keyword next_link: Gets the URL to get the next page of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SecurityGroupNetworkInterface(_serialization.Model): + """Network interface and all its associated security rules. + + :ivar id: ID of the network interface. + :vartype id: str + :ivar security_rule_associations: All security rules associated with the network interface. + :vartype security_rule_associations: + ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "security_rule_associations": {"key": "securityRuleAssociations", "type": "SecurityRuleAssociations"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + security_rule_associations: Optional["_models.SecurityRuleAssociations"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: ID of the network interface. + :paramtype id: str + :keyword security_rule_associations: All security rules associated with the network interface. + :paramtype security_rule_associations: + ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAssociations + """ + super().__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations + + +class SecurityGroupViewParameters(_serialization.Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: ID of the target VM. Required. + :vartype target_resource_id: str + """ + + _validation = { + "target_resource_id": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + } + + def __init__(self, *, target_resource_id: str, **kwargs: Any) -> None: + """ + :keyword target_resource_id: ID of the target VM. Required. + :paramtype target_resource_id: str + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + + +class SecurityGroupViewResult(_serialization.Model): + """The information about security rules applied to the specified VM. + + :ivar network_interfaces: List of network interfaces on the specified VM. + :vartype network_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + "network_interfaces": {"key": "networkInterfaces", "type": "[SecurityGroupNetworkInterface]"}, + } + + def __init__( + self, *, network_interfaces: Optional[List["_models.SecurityGroupNetworkInterface"]] = None, **kwargs: Any + ) -> None: + """ + :keyword network_interfaces: List of network interfaces on the specified VM. + :paramtype network_interfaces: + list[~azure.mgmt.network.v2023_09_01.models.SecurityGroupNetworkInterface] + """ + super().__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class SecurityPartnerProvider(Resource): + """Security Partner Provider resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the Security Partner Provider resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar security_provider_name: The security provider name. Known values are: "ZScaler", "IBoss", + and "Checkpoint". + :vartype security_provider_name: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityProviderName + :ivar connection_status: The connection status with the Security Partner Provider. Known values + are: "Unknown", "PartiallyConnected", "Connected", and "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProviderConnectionStatus + :ivar virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :vartype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "connection_status": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "security_provider_name": {"key": "properties.securityProviderName", "type": "str"}, + "connection_status": {"key": "properties.connectionStatus", "type": "str"}, + "virtual_hub": {"key": "properties.virtualHub", "type": "SubResource"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + security_provider_name: Optional[Union[str, "_models.SecurityProviderName"]] = None, + virtual_hub: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword security_provider_name: The security provider name. Known values are: "ZScaler", + "IBoss", and "Checkpoint". + :paramtype security_provider_name: str or + ~azure.mgmt.network.v2023_09_01.models.SecurityProviderName + :keyword virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :paramtype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + self.security_provider_name = security_provider_name + self.connection_status = None + self.virtual_hub = virtual_hub + + +class SecurityPartnerProviderListResult(_serialization.Model): + """Response for ListSecurityPartnerProviders API service call. + + :ivar value: List of Security Partner Providers in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SecurityPartnerProvider]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SecurityPartnerProvider"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of Security Partner Providers in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SecurityRule(SubResource): # pylint: disable=too-many-instance-attributes + """Network security rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The type of the resource. + :vartype type: str + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", "Icmp", + "Esp", "*", and "Ah". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleProtocol + :ivar source_port_range: The source port or range. Integer or range between 0 and 65535. + Asterisk '*' can also be used to match all ports. + :vartype source_port_range: str + :ivar destination_port_range: The destination port or range. Integer or range between 0 and + 65535. Asterisk '*' can also be used to match all ports. + :vartype destination_port_range: str + :ivar source_address_prefix: The CIDR or source IP range. Asterisk '*' can also be used to + match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + can also be used. If this is an ingress rule, specifies where network traffic originates from. + :vartype source_address_prefix: str + :ivar source_address_prefixes: The CIDR or source IP ranges. + :vartype source_address_prefixes: list[str] + :ivar source_application_security_groups: The application security group specified as source. + :vartype source_application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :ivar destination_address_prefix: The destination address prefix. CIDR or destination IP range. + Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + 'AzureLoadBalancer' and 'Internet' can also be used. + :vartype destination_address_prefix: str + :ivar destination_address_prefixes: The destination address prefixes. CIDR or destination IP + ranges. + :vartype destination_address_prefixes: list[str] + :ivar destination_application_security_groups: The application security group specified as + destination. + :vartype destination_application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :ivar source_port_ranges: The source port ranges. + :vartype source_port_ranges: list[str] + :ivar destination_port_ranges: The destination port ranges. + :vartype destination_port_ranges: list[str] + :ivar access: The network traffic is allowed or denied. Known values are: "Allow" and "Deny". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAccess + :ivar priority: The priority of the rule. The value can be between 100 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :vartype priority: int + :ivar direction: The direction of the rule. The direction specifies if rule will be evaluated + on incoming or outgoing traffic. Known values are: "Inbound" and "Outbound". + :vartype direction: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleDirection + :ivar provisioning_state: The provisioning state of the security rule resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "protocol": {"key": "properties.protocol", "type": "str"}, + "source_port_range": {"key": "properties.sourcePortRange", "type": "str"}, + "destination_port_range": {"key": "properties.destinationPortRange", "type": "str"}, + "source_address_prefix": {"key": "properties.sourceAddressPrefix", "type": "str"}, + "source_address_prefixes": {"key": "properties.sourceAddressPrefixes", "type": "[str]"}, + "source_application_security_groups": { + "key": "properties.sourceApplicationSecurityGroups", + "type": "[ApplicationSecurityGroup]", + }, + "destination_address_prefix": {"key": "properties.destinationAddressPrefix", "type": "str"}, + "destination_address_prefixes": {"key": "properties.destinationAddressPrefixes", "type": "[str]"}, + "destination_application_security_groups": { + "key": "properties.destinationApplicationSecurityGroups", + "type": "[ApplicationSecurityGroup]", + }, + "source_port_ranges": {"key": "properties.sourcePortRanges", "type": "[str]"}, + "destination_port_ranges": {"key": "properties.destinationPortRanges", "type": "[str]"}, + "access": {"key": "properties.access", "type": "str"}, + "priority": {"key": "properties.priority", "type": "int"}, + "direction": {"key": "properties.direction", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + description: Optional[str] = None, + protocol: Optional[Union[str, "_models.SecurityRuleProtocol"]] = None, + source_port_range: Optional[str] = None, + destination_port_range: Optional[str] = None, + source_address_prefix: Optional[str] = None, + source_address_prefixes: Optional[List[str]] = None, + source_application_security_groups: Optional[List["_models.ApplicationSecurityGroup"]] = None, + destination_address_prefix: Optional[str] = None, + destination_address_prefixes: Optional[List[str]] = None, + destination_application_security_groups: Optional[List["_models.ApplicationSecurityGroup"]] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + access: Optional[Union[str, "_models.SecurityRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "_models.SecurityRuleDirection"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type: The type of the resource. + :paramtype type: str + :keyword description: A description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword protocol: Network protocol this rule applies to. Known values are: "Tcp", "Udp", + "Icmp", "Esp", "*", and "Ah". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleProtocol + :keyword source_port_range: The source port or range. Integer or range between 0 and 65535. + Asterisk '*' can also be used to match all ports. + :paramtype source_port_range: str + :keyword destination_port_range: The destination port or range. Integer or range between 0 and + 65535. Asterisk '*' can also be used to match all ports. + :paramtype destination_port_range: str + :keyword source_address_prefix: The CIDR or source IP range. Asterisk '*' can also be used to + match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + can also be used. If this is an ingress rule, specifies where network traffic originates from. + :paramtype source_address_prefix: str + :keyword source_address_prefixes: The CIDR or source IP ranges. + :paramtype source_address_prefixes: list[str] + :keyword source_application_security_groups: The application security group specified as + source. + :paramtype source_application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :keyword destination_address_prefix: The destination address prefix. CIDR or destination IP + range. Asterisk '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + :paramtype destination_address_prefix: str + :keyword destination_address_prefixes: The destination address prefixes. CIDR or destination IP + ranges. + :paramtype destination_address_prefixes: list[str] + :keyword destination_application_security_groups: The application security group specified as + destination. + :paramtype destination_application_security_groups: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :keyword source_port_ranges: The source port ranges. + :paramtype source_port_ranges: list[str] + :keyword destination_port_ranges: The destination port ranges. + :paramtype destination_port_ranges: list[str] + :keyword access: The network traffic is allowed or denied. Known values are: "Allow" and + "Deny". + :paramtype access: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleAccess + :keyword priority: The priority of the rule. The value can be between 100 and 4096. The + priority number must be unique for each rule in the collection. The lower the priority number, + the higher the priority of the rule. + :paramtype priority: int + :keyword direction: The direction of the rule. The direction specifies if rule will be + evaluated on incoming or outgoing traffic. Known values are: "Inbound" and "Outbound". + :paramtype direction: str or ~azure.mgmt.network.v2023_09_01.models.SecurityRuleDirection + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.source_application_security_groups = source_application_security_groups + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.destination_application_security_groups = destination_application_security_groups + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = None + + +class SecurityRuleAssociations(_serialization.Model): + """All security rules associated with the network interface. + + :ivar network_interface_association: Network interface and it's custom security rules. + :vartype network_interface_association: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceAssociation + :ivar subnet_association: Subnet and it's custom security rules. + :vartype subnet_association: ~azure.mgmt.network.v2023_09_01.models.SubnetAssociation + :ivar default_security_rules: Collection of default security rules of the network security + group. + :vartype default_security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :ivar effective_security_rules: Collection of effective security rules. + :vartype effective_security_rules: + list[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + "network_interface_association": {"key": "networkInterfaceAssociation", "type": "NetworkInterfaceAssociation"}, + "subnet_association": {"key": "subnetAssociation", "type": "SubnetAssociation"}, + "default_security_rules": {"key": "defaultSecurityRules", "type": "[SecurityRule]"}, + "effective_security_rules": {"key": "effectiveSecurityRules", "type": "[EffectiveNetworkSecurityRule]"}, + } + + def __init__( + self, + *, + network_interface_association: Optional["_models.NetworkInterfaceAssociation"] = None, + subnet_association: Optional["_models.SubnetAssociation"] = None, + default_security_rules: Optional[List["_models.SecurityRule"]] = None, + effective_security_rules: Optional[List["_models.EffectiveNetworkSecurityRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_interface_association: Network interface and it's custom security rules. + :paramtype network_interface_association: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceAssociation + :keyword subnet_association: Subnet and it's custom security rules. + :paramtype subnet_association: ~azure.mgmt.network.v2023_09_01.models.SubnetAssociation + :keyword default_security_rules: Collection of default security rules of the network security + group. + :paramtype default_security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :keyword effective_security_rules: Collection of effective security rules. + :paramtype effective_security_rules: + list[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityRule] + """ + super().__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules + + +class SecurityRuleListResult(_serialization.Model): + """Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a + network security group. + + :ivar value: The security rules in a network security group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SecurityRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.SecurityRule"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The security rules in a network security group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ServiceAssociationLink(SubResource): + """ServiceAssociationLink resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar linked_resource_type: Resource type of the linked resource. + :vartype linked_resource_type: str + :ivar link: Link to the external resource. + :vartype link: str + :ivar provisioning_state: The provisioning state of the service association link resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar allow_delete: If true, the resource can be deleted. + :vartype allow_delete: bool + :ivar locations: A list of locations. + :vartype locations: list[str] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "linked_resource_type": {"key": "properties.linkedResourceType", "type": "str"}, + "link": {"key": "properties.link", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "allow_delete": {"key": "properties.allowDelete", "type": "bool"}, + "locations": {"key": "properties.locations", "type": "[str]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + linked_resource_type: Optional[str] = None, + link: Optional[str] = None, + allow_delete: Optional[bool] = None, + locations: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the resource that is unique within a resource group. This name can be + used to access the resource. + :paramtype name: str + :keyword linked_resource_type: Resource type of the linked resource. + :paramtype linked_resource_type: str + :keyword link: Link to the external resource. + :paramtype link: str + :keyword allow_delete: If true, the resource can be deleted. + :paramtype allow_delete: bool + :keyword locations: A list of locations. + :paramtype locations: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.allow_delete = allow_delete + self.locations = locations + + +class ServiceAssociationLinksListResult(_serialization.Model): + """Response for ServiceAssociationLinks_List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The service association links in a subnet. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceAssociationLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceAssociationLink]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ServiceAssociationLink"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The service association links in a subnet. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceAssociationLink] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ServiceEndpointPolicy(Resource): # pylint: disable=too-many-instance-attributes + """Service End point policy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar kind: Kind of service endpoint policy. This is metadata used for the Azure portal + experience. + :vartype kind: str + :ivar service_endpoint_policy_definitions: A collection of service endpoint policy definitions + of the service endpoint policy. + :vartype service_endpoint_policy_definitions: + list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :ivar resource_guid: The resource GUID property of the service endpoint policy resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the service endpoint policy resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar service_alias: The alias indicating if the policy belongs to a service. + :vartype service_alias: str + :ivar contextual_service_endpoint_policies: A collection of contextual service endpoint policy. + :vartype contextual_service_endpoint_policies: list[str] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "kind": {"readonly": True}, + "subnets": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "service_endpoint_policy_definitions": { + "key": "properties.serviceEndpointPolicyDefinitions", + "type": "[ServiceEndpointPolicyDefinition]", + }, + "subnets": {"key": "properties.subnets", "type": "[Subnet]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "service_alias": {"key": "properties.serviceAlias", "type": "str"}, + "contextual_service_endpoint_policies": { + "key": "properties.contextualServiceEndpointPolicies", + "type": "[str]", + }, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + service_endpoint_policy_definitions: Optional[List["_models.ServiceEndpointPolicyDefinition"]] = None, + service_alias: Optional[str] = None, + contextual_service_endpoint_policies: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword service_endpoint_policy_definitions: A collection of service endpoint policy + definitions of the service endpoint policy. + :paramtype service_endpoint_policy_definitions: + list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :keyword service_alias: The alias indicating if the policy belongs to a service. + :paramtype service_alias: str + :keyword contextual_service_endpoint_policies: A collection of contextual service endpoint + policy. + :paramtype contextual_service_endpoint_policies: list[str] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.kind = None + self.service_endpoint_policy_definitions = service_endpoint_policy_definitions + self.subnets = None + self.resource_guid = None + self.provisioning_state = None + self.service_alias = service_alias + self.contextual_service_endpoint_policies = contextual_service_endpoint_policies + + +class ServiceEndpointPolicyDefinition(SubResource): + """Service Endpoint policy definitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The type of the resource. + :vartype type: str + :ivar description: A description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar service: Service endpoint name. + :vartype service: str + :ivar service_resources: A list of service resources. + :vartype service_resources: list[str] + :ivar provisioning_state: The provisioning state of the service endpoint policy definition + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "service": {"key": "properties.service", "type": "str"}, + "service_resources": {"key": "properties.serviceResources", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + description: Optional[str] = None, + service: Optional[str] = None, + service_resources: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type: The type of the resource. + :paramtype type: str + :keyword description: A description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword service: Service endpoint name. + :paramtype service: str + :keyword service_resources: A list of service resources. + :paramtype service_resources: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.description = description + self.service = service + self.service_resources = service_resources + self.provisioning_state = None + + +class ServiceEndpointPolicyDefinitionListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service + endpoint policy definition that belongs to a service endpoint policy. + + :ivar value: The service endpoint policy definition in a service endpoint policy. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceEndpointPolicyDefinition]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ServiceEndpointPolicyDefinition"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The service endpoint policy definition in a service endpoint policy. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ServiceEndpointPolicyListResult(_serialization.Model): + """Response for ListServiceEndpointPolicies API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of ServiceEndpointPolicy resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceEndpointPolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ServiceEndpointPolicy"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of ServiceEndpointPolicy resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ServiceEndpointPropertiesFormat(_serialization.Model): + """The service endpoint properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service: The type of the endpoint service. + :vartype service: str + :ivar locations: A list of locations. + :vartype locations: list[str] + :ivar provisioning_state: The provisioning state of the service endpoint resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "service": {"key": "service", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + def __init__(self, *, service: Optional[str] = None, locations: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword service: The type of the endpoint service. + :paramtype service: str + :keyword locations: A list of locations. + :paramtype locations: list[str] + """ + super().__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = None + + +class ServiceTagInformation(_serialization.Model): + """The service tag information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: Properties of the service tag information. + :vartype properties: + ~azure.mgmt.network.v2023_09_01.models.ServiceTagInformationPropertiesFormat + :ivar name: The name of service tag. + :vartype name: str + :ivar id: The ID of service tag. + :vartype id: str + :ivar service_tag_change_number: The iteration number of service tag object for region. + :vartype service_tag_change_number: str + """ + + _validation = { + "properties": {"readonly": True}, + "name": {"readonly": True}, + "id": {"readonly": True}, + "service_tag_change_number": {"readonly": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "ServiceTagInformationPropertiesFormat"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "service_tag_change_number": {"key": "serviceTagChangeNumber", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.properties = None + self.name = None + self.id = None + self.service_tag_change_number = None + + +class ServiceTagInformationListResult(_serialization.Model): + """Response for Get ServiceTagInformation API service call. Retrieves the list of service tag + information resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of service tag information resources. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceTagInformation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceTagInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ServiceTagInformation"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of service tag information resources. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.ServiceTagInformation] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ServiceTagInformationPropertiesFormat(_serialization.Model): + """Properties of the service tag information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar change_number: The iteration number of service tag. + :vartype change_number: str + :ivar region: The region of service tag. + :vartype region: str + :ivar system_service: The name of system service. + :vartype system_service: str + :ivar address_prefixes: The list of IP address prefixes. + :vartype address_prefixes: list[str] + :ivar state: The state of the service tag. + :vartype state: str + """ + + _validation = { + "change_number": {"readonly": True}, + "region": {"readonly": True}, + "system_service": {"readonly": True}, + "address_prefixes": {"readonly": True}, + "state": {"readonly": True}, + } + + _attribute_map = { + "change_number": {"key": "changeNumber", "type": "str"}, + "region": {"key": "region", "type": "str"}, + "system_service": {"key": "systemService", "type": "str"}, + "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.change_number = None + self.region = None + self.system_service = None + self.address_prefixes = None + self.state = None + + +class ServiceTagsListResult(_serialization.Model): + """Response for the ListServiceTags API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the cloud. + :vartype name: str + :ivar id: The ID of the cloud. + :vartype id: str + :ivar type: The azure resource type. + :vartype type: str + :ivar change_number: The iteration number. + :vartype change_number: str + :ivar cloud: The name of the cloud. + :vartype cloud: str + :ivar values: The list of service tag information resources. + :vartype values: list[~azure.mgmt.network.v2023_09_01.models.ServiceTagInformation] + :ivar next_link: The URL to get next page of service tag information resources. + :vartype next_link: str + """ + + _validation = { + "name": {"readonly": True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "change_number": {"readonly": True}, + "cloud": {"readonly": True}, + "values": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "change_number": {"key": "changeNumber", "type": "str"}, + "cloud": {"key": "cloud", "type": "str"}, + "values": {"key": "values", "type": "[ServiceTagInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.change_number = None + self.cloud = None + self.values = None + self.next_link = None + + +class SessionIds(_serialization.Model): + """List of session IDs. + + :ivar session_ids: List of session IDs. + :vartype session_ids: list[str] + """ + + _attribute_map = { + "session_ids": {"key": "sessionIds", "type": "[str]"}, + } + + def __init__(self, *, session_ids: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword session_ids: List of session IDs. + :paramtype session_ids: list[str] + """ + super().__init__(**kwargs) + self.session_ids = session_ids + + +class SignatureOverridesFilterValuesQuery(_serialization.Model): + """Describes the filter values possibles for a given column. + + :ivar filter_name: Describes the name of the column which values will be returned. + :vartype filter_name: str + """ + + _attribute_map = { + "filter_name": {"key": "filterName", "type": "str"}, + } + + def __init__(self, *, filter_name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword filter_name: Describes the name of the column which values will be returned. + :paramtype filter_name: str + """ + super().__init__(**kwargs) + self.filter_name = filter_name + + +class SignatureOverridesFilterValuesResponse(_serialization.Model): + """Describes the list of all possible values for a specific filter value. + + :ivar filter_values: Describes the possible values. + :vartype filter_values: list[str] + """ + + _attribute_map = { + "filter_values": {"key": "filterValues", "type": "[str]"}, + } + + def __init__(self, *, filter_values: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword filter_values: Describes the possible values. + :paramtype filter_values: list[str] + """ + super().__init__(**kwargs) + self.filter_values = filter_values + + +class SignaturesOverrides(_serialization.Model): + """Contains all specific policy signatures overrides for the IDPS. + + :ivar name: Contains the name of the resource (default). + :vartype name: str + :ivar id: Will contain the resource id of the signature override resource. + :vartype id: str + :ivar type: Will contain the type of the resource: + Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides. + :vartype type: str + :ivar properties: Will contain the properties of the resource (the actual signature overrides). + :vartype properties: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverridesProperties + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "SignaturesOverridesProperties"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + properties: Optional["_models.SignaturesOverridesProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Contains the name of the resource (default). + :paramtype name: str + :keyword id: Will contain the resource id of the signature override resource. + :paramtype id: str + :keyword type: Will contain the type of the resource: + Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides. + :paramtype type: str + :keyword properties: Will contain the properties of the resource (the actual signature + overrides). + :paramtype properties: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverridesProperties + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.properties = properties + + +class SignaturesOverridesList(_serialization.Model): + """Describes an object containing an array with a single item. + + :ivar value: Describes a list consisting exactly one item describing the policy's signature + override status. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SignaturesOverrides]"}, + } + + def __init__(self, *, value: Optional[List["_models.SignaturesOverrides"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Describes a list consisting exactly one item describing the policy's signature + override status. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides] + """ + super().__init__(**kwargs) + self.value = value + + +class SignaturesOverridesProperties(_serialization.Model): + """Will contain the properties of the resource (the actual signature overrides). + + :ivar signatures: Dictionary of :code:``. + :vartype signatures: dict[str, str] + """ + + _attribute_map = { + "signatures": {"key": "signatures", "type": "{str}"}, + } + + def __init__(self, *, signatures: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword signatures: Dictionary of :code:``. + :paramtype signatures: dict[str, str] + """ + super().__init__(**kwargs) + self.signatures = signatures + + +class SingleQueryResult(_serialization.Model): # pylint: disable=too-many-instance-attributes + """SingleQueryResult. + + :ivar signature_id: The ID of the signature. + :vartype signature_id: int + :ivar mode: The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny. Known values are: 0, + 1, and 2. + :vartype mode: int or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSSignatureMode + :ivar severity: Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low. Known + values are: 1, 2, and 3. + :vartype severity: int or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSSignatureSeverity + :ivar direction: Describes in which direction signature is being enforced: 0 - OutBound, 1 - + InBound, 2 - Any, 3 - Internal, 4 - InternalOutbound. Known values are: 0, 1, 2, 3, and 4. + :vartype direction: int or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSSignatureDirection + :ivar group: Describes the groups the signature belongs to. + :vartype group: str + :ivar description: Describes what is the signature enforces. + :vartype description: str + :ivar protocol: Describes the protocol the signatures is being enforced in. + :vartype protocol: str + :ivar source_ports: Describes the list of source ports related to this signature. + :vartype source_ports: list[str] + :ivar destination_ports: Describes the list of destination ports related to this signature. + :vartype destination_ports: list[str] + :ivar last_updated: Describes the last updated time of the signature (provided from 3rd party + vendor). + :vartype last_updated: str + :ivar inherited_from_parent_policy: Describes if this override is inherited from base policy or + not. + :vartype inherited_from_parent_policy: bool + """ + + _attribute_map = { + "signature_id": {"key": "signatureId", "type": "int"}, + "mode": {"key": "mode", "type": "int"}, + "severity": {"key": "severity", "type": "int"}, + "direction": {"key": "direction", "type": "int"}, + "group": {"key": "group", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "source_ports": {"key": "sourcePorts", "type": "[str]"}, + "destination_ports": {"key": "destinationPorts", "type": "[str]"}, + "last_updated": {"key": "lastUpdated", "type": "str"}, + "inherited_from_parent_policy": {"key": "inheritedFromParentPolicy", "type": "bool"}, + } + + def __init__( + self, + *, + signature_id: Optional[int] = None, + mode: Optional[Union[int, "_models.FirewallPolicyIDPSSignatureMode"]] = None, + severity: Optional[Union[int, "_models.FirewallPolicyIDPSSignatureSeverity"]] = None, + direction: Optional[Union[int, "_models.FirewallPolicyIDPSSignatureDirection"]] = None, + group: Optional[str] = None, + description: Optional[str] = None, + protocol: Optional[str] = None, + source_ports: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + last_updated: Optional[str] = None, + inherited_from_parent_policy: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword signature_id: The ID of the signature. + :paramtype signature_id: int + :keyword mode: The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny. Known values are: + 0, 1, and 2. + :paramtype mode: int or ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSSignatureMode + :keyword severity: Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low. Known + values are: 1, 2, and 3. + :paramtype severity: int or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSSignatureSeverity + :keyword direction: Describes in which direction signature is being enforced: 0 - OutBound, 1 - + InBound, 2 - Any, 3 - Internal, 4 - InternalOutbound. Known values are: 0, 1, 2, 3, and 4. + :paramtype direction: int or + ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyIDPSSignatureDirection + :keyword group: Describes the groups the signature belongs to. + :paramtype group: str + :keyword description: Describes what is the signature enforces. + :paramtype description: str + :keyword protocol: Describes the protocol the signatures is being enforced in. + :paramtype protocol: str + :keyword source_ports: Describes the list of source ports related to this signature. + :paramtype source_ports: list[str] + :keyword destination_ports: Describes the list of destination ports related to this signature. + :paramtype destination_ports: list[str] + :keyword last_updated: Describes the last updated time of the signature (provided from 3rd + party vendor). + :paramtype last_updated: str + :keyword inherited_from_parent_policy: Describes if this override is inherited from base policy + or not. + :paramtype inherited_from_parent_policy: bool + """ + super().__init__(**kwargs) + self.signature_id = signature_id + self.mode = mode + self.severity = severity + self.direction = direction + self.group = group + self.description = description + self.protocol = protocol + self.source_ports = source_ports + self.destination_ports = destination_ports + self.last_updated = last_updated + self.inherited_from_parent_policy = inherited_from_parent_policy + + +class Sku(_serialization.Model): + """The sku of this Bastion Host. + + :ivar name: The name of this Bastion Host. Known values are: "Basic", "Standard", and + "Developer". + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.BastionHostSkuName + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: Union[str, "_models.BastionHostSkuName"] = "Standard", **kwargs: Any) -> None: + """ + :keyword name: The name of this Bastion Host. Known values are: "Basic", "Standard", and + "Developer". + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.BastionHostSkuName + """ + super().__init__(**kwargs) + self.name = name + + +class StaticMember(ChildResource): + """StaticMember Item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar system_data: The system metadata related to this resource. + :vartype system_data: ~azure.mgmt.network.v2023_09_01.models.SystemData + :ivar resource_id: Resource Id. + :vartype resource_id: str + :ivar region: Resource region. + :vartype region: str + :ivar provisioning_state: The provisioning state of the scope assignment resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "system_data": {"readonly": True}, + "region": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "resource_id": {"key": "properties.resourceId", "type": "str"}, + "region": {"key": "properties.region", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource Id. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.system_data = None + self.resource_id = resource_id + self.region = None + self.provisioning_state = None + + +class StaticMemberListResult(_serialization.Model): + """Result of the request to list StaticMember. It contains a list of groups and a URL link to get + the next set of results. + + :ivar value: Gets a page of StaticMember. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.StaticMember] + :ivar next_link: Gets the URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[StaticMember]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.StaticMember"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Gets a page of StaticMember. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.StaticMember] + :keyword next_link: Gets the URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class StaticRoute(_serialization.Model): + """List of all Static Routes. + + :ivar name: The name of the StaticRoute that is unique within a VnetRoute. + :vartype name: str + :ivar address_prefixes: List of all address prefixes. + :vartype address_prefixes: list[str] + :ivar next_hop_ip_address: The ip address of the next hop. + :vartype next_hop_ip_address: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, + "next_hop_ip_address": {"key": "nextHopIpAddress", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + address_prefixes: Optional[List[str]] = None, + next_hop_ip_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the StaticRoute that is unique within a VnetRoute. + :paramtype name: str + :keyword address_prefixes: List of all address prefixes. + :paramtype address_prefixes: list[str] + :keyword next_hop_ip_address: The ip address of the next hop. + :paramtype next_hop_ip_address: str + """ + super().__init__(**kwargs) + self.name = name + self.address_prefixes = address_prefixes + self.next_hop_ip_address = next_hop_ip_address + + +class StaticRoutesConfig(_serialization.Model): + """Configuration for static routes on this HubVnetConnectionConfiguration for static routes on + this HubVnetConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar propagate_static_routes: Boolean indicating whether static routes on this connection are + automatically propagate to route tables which this connection propagates to. + :vartype propagate_static_routes: bool + :ivar vnet_local_route_override_criteria: Parameter determining whether NVA in spoke vnet is + bypassed for traffic with destination in spoke. Known values are: "Contains" and "Equal". + :vartype vnet_local_route_override_criteria: str or + ~azure.mgmt.network.v2023_09_01.models.VnetLocalRouteOverrideCriteria + """ + + _validation = { + "propagate_static_routes": {"readonly": True}, + } + + _attribute_map = { + "propagate_static_routes": {"key": "propagateStaticRoutes", "type": "bool"}, + "vnet_local_route_override_criteria": {"key": "vnetLocalRouteOverrideCriteria", "type": "str"}, + } + + def __init__( + self, + *, + vnet_local_route_override_criteria: Optional[Union[str, "_models.VnetLocalRouteOverrideCriteria"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword vnet_local_route_override_criteria: Parameter determining whether NVA in spoke vnet is + bypassed for traffic with destination in spoke. Known values are: "Contains" and "Equal". + :paramtype vnet_local_route_override_criteria: str or + ~azure.mgmt.network.v2023_09_01.models.VnetLocalRouteOverrideCriteria + """ + super().__init__(**kwargs) + self.propagate_static_routes = None + self.vnet_local_route_override_criteria = vnet_local_route_override_criteria + + +class Subnet(SubResource): # pylint: disable=too-many-instance-attributes + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar address_prefix: The address prefix for the subnet. + :vartype address_prefix: str + :ivar address_prefixes: List of address prefixes for the subnet. + :vartype address_prefixes: list[str] + :ivar network_security_group: The reference to the NetworkSecurityGroup resource. + :vartype network_security_group: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :ivar route_table: The reference to the RouteTable resource. + :vartype route_table: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :ivar nat_gateway: Nat gateway associated with this subnet. + :vartype nat_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar service_endpoints: An array of service endpoints. + :vartype service_endpoints: + list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPropertiesFormat] + :ivar service_endpoint_policies: An array of service endpoint policies. + :vartype service_endpoint_policies: + list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :ivar ip_configurations: An array of references to the network interface IP configurations + using subnet. + :vartype ip_configurations: list[~azure.mgmt.network.v2023_09_01.models.IPConfiguration] + :ivar ip_configuration_profiles: Array of IP configuration profiles which reference this + subnet. + :vartype ip_configuration_profiles: + list[~azure.mgmt.network.v2023_09_01.models.IPConfigurationProfile] + :ivar ip_allocations: Array of IpAllocation which reference this subnet. + :vartype ip_allocations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar resource_navigation_links: An array of references to the external resources using subnet. + :vartype resource_navigation_links: + list[~azure.mgmt.network.v2023_09_01.models.ResourceNavigationLink] + :ivar service_association_links: An array of references to services injecting into this subnet. + :vartype service_association_links: + list[~azure.mgmt.network.v2023_09_01.models.ServiceAssociationLink] + :ivar delegations: An array of references to the delegations on the subnet. + :vartype delegations: list[~azure.mgmt.network.v2023_09_01.models.Delegation] + :ivar purpose: A read-only string identifying the intention of use for this subnet based on + delegations and other user-defined properties. + :vartype purpose: str + :ivar provisioning_state: The provisioning state of the subnet resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar private_endpoint_network_policies: Enable or Disable apply network policies on private + end point in the subnet. Known values are: "Enabled", "Disabled", + "NetworkSecurityGroupEnabled", and "RouteTableEnabled". + :vartype private_endpoint_network_policies: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPrivateEndpointNetworkPolicies + :ivar private_link_service_network_policies: Enable or Disable apply network policies on + private link service in the subnet. Known values are: "Enabled" and "Disabled". + :vartype private_link_service_network_policies: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPrivateLinkServiceNetworkPolicies + :ivar application_gateway_ip_configurations: Application gateway IP configurations of virtual + network resource. + :vartype application_gateway_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayIPConfiguration] + :ivar default_outbound_access: Set this property to false to disable default outbound + connectivity for all VMs in the subnet. This property can only be set at the time of subnet + creation and cannot be updated for an existing subnet. + :vartype default_outbound_access: bool + """ + + _validation = { + "etag": {"readonly": True}, + "private_endpoints": {"readonly": True}, + "ip_configurations": {"readonly": True}, + "ip_configuration_profiles": {"readonly": True}, + "resource_navigation_links": {"readonly": True}, + "service_association_links": {"readonly": True}, + "purpose": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "address_prefixes": {"key": "properties.addressPrefixes", "type": "[str]"}, + "network_security_group": {"key": "properties.networkSecurityGroup", "type": "NetworkSecurityGroup"}, + "route_table": {"key": "properties.routeTable", "type": "RouteTable"}, + "nat_gateway": {"key": "properties.natGateway", "type": "SubResource"}, + "service_endpoints": {"key": "properties.serviceEndpoints", "type": "[ServiceEndpointPropertiesFormat]"}, + "service_endpoint_policies": {"key": "properties.serviceEndpointPolicies", "type": "[ServiceEndpointPolicy]"}, + "private_endpoints": {"key": "properties.privateEndpoints", "type": "[PrivateEndpoint]"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[IPConfiguration]"}, + "ip_configuration_profiles": {"key": "properties.ipConfigurationProfiles", "type": "[IPConfigurationProfile]"}, + "ip_allocations": {"key": "properties.ipAllocations", "type": "[SubResource]"}, + "resource_navigation_links": {"key": "properties.resourceNavigationLinks", "type": "[ResourceNavigationLink]"}, + "service_association_links": {"key": "properties.serviceAssociationLinks", "type": "[ServiceAssociationLink]"}, + "delegations": {"key": "properties.delegations", "type": "[Delegation]"}, + "purpose": {"key": "properties.purpose", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_endpoint_network_policies": {"key": "properties.privateEndpointNetworkPolicies", "type": "str"}, + "private_link_service_network_policies": {"key": "properties.privateLinkServiceNetworkPolicies", "type": "str"}, + "application_gateway_ip_configurations": { + "key": "properties.applicationGatewayIPConfigurations", + "type": "[ApplicationGatewayIPConfiguration]", + }, + "default_outbound_access": {"key": "properties.defaultOutboundAccess", "type": "bool"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + address_prefix: Optional[str] = None, + address_prefixes: Optional[List[str]] = None, + network_security_group: Optional["_models.NetworkSecurityGroup"] = None, + route_table: Optional["_models.RouteTable"] = None, + nat_gateway: Optional["_models.SubResource"] = None, + service_endpoints: Optional[List["_models.ServiceEndpointPropertiesFormat"]] = None, + service_endpoint_policies: Optional[List["_models.ServiceEndpointPolicy"]] = None, + ip_allocations: Optional[List["_models.SubResource"]] = None, + delegations: Optional[List["_models.Delegation"]] = None, + private_endpoint_network_policies: Union[ + str, "_models.VirtualNetworkPrivateEndpointNetworkPolicies" + ] = "Disabled", + private_link_service_network_policies: Union[ + str, "_models.VirtualNetworkPrivateLinkServiceNetworkPolicies" + ] = "Enabled", + application_gateway_ip_configurations: Optional[List["_models.ApplicationGatewayIPConfiguration"]] = None, + default_outbound_access: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type: Resource type. + :paramtype type: str + :keyword address_prefix: The address prefix for the subnet. + :paramtype address_prefix: str + :keyword address_prefixes: List of address prefixes for the subnet. + :paramtype address_prefixes: list[str] + :keyword network_security_group: The reference to the NetworkSecurityGroup resource. + :paramtype network_security_group: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :keyword route_table: The reference to the RouteTable resource. + :paramtype route_table: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :keyword nat_gateway: Nat gateway associated with this subnet. + :paramtype nat_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword service_endpoints: An array of service endpoints. + :paramtype service_endpoints: + list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPropertiesFormat] + :keyword service_endpoint_policies: An array of service endpoint policies. + :paramtype service_endpoint_policies: + list[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :keyword ip_allocations: Array of IpAllocation which reference this subnet. + :paramtype ip_allocations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword delegations: An array of references to the delegations on the subnet. + :paramtype delegations: list[~azure.mgmt.network.v2023_09_01.models.Delegation] + :keyword private_endpoint_network_policies: Enable or Disable apply network policies on private + end point in the subnet. Known values are: "Enabled", "Disabled", + "NetworkSecurityGroupEnabled", and "RouteTableEnabled". + :paramtype private_endpoint_network_policies: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPrivateEndpointNetworkPolicies + :keyword private_link_service_network_policies: Enable or Disable apply network policies on + private link service in the subnet. Known values are: "Enabled" and "Disabled". + :paramtype private_link_service_network_policies: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPrivateLinkServiceNetworkPolicies + :keyword application_gateway_ip_configurations: Application gateway IP configurations of + virtual network resource. + :paramtype application_gateway_ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayIPConfiguration] + :keyword default_outbound_access: Set this property to false to disable default outbound + connectivity for all VMs in the subnet. This property can only be set at the time of subnet + creation and cannot be updated for an existing subnet. + :paramtype default_outbound_access: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.address_prefix = address_prefix + self.address_prefixes = address_prefixes + self.network_security_group = network_security_group + self.route_table = route_table + self.nat_gateway = nat_gateway + self.service_endpoints = service_endpoints + self.service_endpoint_policies = service_endpoint_policies + self.private_endpoints = None + self.ip_configurations = None + self.ip_configuration_profiles = None + self.ip_allocations = ip_allocations + self.resource_navigation_links = None + self.service_association_links = None + self.delegations = delegations + self.purpose = None + self.provisioning_state = None + self.private_endpoint_network_policies = private_endpoint_network_policies + self.private_link_service_network_policies = private_link_service_network_policies + self.application_gateway_ip_configurations = application_gateway_ip_configurations + self.default_outbound_access = default_outbound_access + + +class SubnetAssociation(_serialization.Model): + """Subnet and it's custom security rules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :ivar security_rules: Collection of custom security rules. + :vartype security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "security_rules": {"key": "securityRules", "type": "[SecurityRule]"}, + } + + def __init__(self, *, security_rules: Optional[List["_models.SecurityRule"]] = None, **kwargs: Any) -> None: + """ + :keyword security_rules: Collection of custom security rules. + :paramtype security_rules: list[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + """ + super().__init__(**kwargs) + self.id = None + self.security_rules = security_rules + + +class SubnetListResult(_serialization.Model): + """Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual + network. + + :ivar value: The subnets in a virtual network. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[Subnet]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.Subnet"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The subnets in a virtual network. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SwapResource(_serialization.Model): + """SwapResource to represent slot type on the specified cloud service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Swap resource properties. + :vartype properties: ~azure.mgmt.network.v2023_09_01.models.SwapResourceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "SwapResourceProperties"}, + } + + def __init__(self, *, properties: Optional["_models.SwapResourceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Swap resource properties. + :paramtype properties: ~azure.mgmt.network.v2023_09_01.models.SwapResourceProperties + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class SwapResourceListResult(_serialization.Model): + """SwapResource List with single entry to represent slot type on the specified cloud service. + + :ivar value: + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.SwapResource] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SwapResource]"}, + } + + def __init__(self, *, value: Optional[List["_models.SwapResource"]] = None, **kwargs: Any) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.SwapResource] + """ + super().__init__(**kwargs) + self.value = value + + +class SwapResourceProperties(_serialization.Model): + """Swap resource properties. + + :ivar slot_type: Specifies slot info on a cloud service. Known values are: "Production" and + "Staging". + :vartype slot_type: str or ~azure.mgmt.network.v2023_09_01.models.SlotType + """ + + _attribute_map = { + "slot_type": {"key": "slotType", "type": "str"}, + } + + def __init__(self, *, slot_type: Optional[Union[str, "_models.SlotType"]] = None, **kwargs: Any) -> None: + """ + :keyword slot_type: Specifies slot info on a cloud service. Known values are: "Production" and + "Staging". + :paramtype slot_type: str or ~azure.mgmt.network.v2023_09_01.models.SlotType + """ + super().__init__(**kwargs) + self.slot_type = slot_type + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.network.v2023_09_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.network.v2023_09_01.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or ~azure.mgmt.network.v2023_09_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.network.v2023_09_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsObject(_serialization.Model): + """Tags object for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class Topology(_serialization.Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially created for the resource + group. + :vartype created_date_time: ~datetime.datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: ~datetime.datetime + :ivar resources: A list of topology resources. + :vartype resources: list[~azure.mgmt.network.v2023_09_01.models.TopologyResource] + """ + + _validation = { + "id": {"readonly": True}, + "created_date_time": {"readonly": True}, + "last_modified": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "last_modified": {"key": "lastModified", "type": "iso-8601"}, + "resources": {"key": "resources", "type": "[TopologyResource]"}, + } + + def __init__(self, *, resources: Optional[List["_models.TopologyResource"]] = None, **kwargs: Any) -> None: + """ + :keyword resources: A list of topology resources. + :paramtype resources: list[~azure.mgmt.network.v2023_09_01.models.TopologyResource] + """ + super().__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources + + +class TopologyAssociation(_serialization.Model): + """Resources that have an association with the parent resource. + + :ivar name: The name of the resource that is associated with the parent resource. + :vartype name: str + :ivar resource_id: The ID of the resource that is associated with the parent resource. + :vartype resource_id: str + :ivar association_type: The association type of the child resource to the parent resource. + Known values are: "Associated" and "Contains". + :vartype association_type: str or ~azure.mgmt.network.v2023_09_01.models.AssociationType + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "association_type": {"key": "associationType", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + resource_id: Optional[str] = None, + association_type: Optional[Union[str, "_models.AssociationType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the resource that is associated with the parent resource. + :paramtype name: str + :keyword resource_id: The ID of the resource that is associated with the parent resource. + :paramtype resource_id: str + :keyword association_type: The association type of the child resource to the parent resource. + Known values are: "Associated" and "Contains". + :paramtype association_type: str or ~azure.mgmt.network.v2023_09_01.models.AssociationType + """ + super().__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type + + +class TopologyParameters(_serialization.Model): + """Parameters that define the representation of topology. + + :ivar target_resource_group_name: The name of the target resource group to perform topology on. + :vartype target_resource_group_name: str + :ivar target_virtual_network: The reference to the Virtual Network resource. + :vartype target_virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar target_subnet: The reference to the Subnet resource. + :vartype target_subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + + _attribute_map = { + "target_resource_group_name": {"key": "targetResourceGroupName", "type": "str"}, + "target_virtual_network": {"key": "targetVirtualNetwork", "type": "SubResource"}, + "target_subnet": {"key": "targetSubnet", "type": "SubResource"}, + } + + def __init__( + self, + *, + target_resource_group_name: Optional[str] = None, + target_virtual_network: Optional["_models.SubResource"] = None, + target_subnet: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_resource_group_name: The name of the target resource group to perform topology + on. + :paramtype target_resource_group_name: str + :keyword target_virtual_network: The reference to the Virtual Network resource. + :paramtype target_virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword target_subnet: The reference to the Subnet resource. + :paramtype target_subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name + self.target_virtual_network = target_virtual_network + self.target_subnet = target_subnet + + +class TopologyResource(_serialization.Model): + """The network resource topology information for the given resource group. + + :ivar name: Name of the resource. + :vartype name: str + :ivar id: ID of the resource. + :vartype id: str + :ivar location: Resource location. + :vartype location: str + :ivar associations: Holds the associations the resource has with other resources in the + resource group. + :vartype associations: list[~azure.mgmt.network.v2023_09_01.models.TopologyAssociation] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "associations": {"key": "associations", "type": "[TopologyAssociation]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + associations: Optional[List["_models.TopologyAssociation"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the resource. + :paramtype name: str + :keyword id: ID of the resource. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword associations: Holds the associations the resource has with other resources in the + resource group. + :paramtype associations: list[~azure.mgmt.network.v2023_09_01.models.TopologyAssociation] + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations + + +class TrafficAnalyticsConfigurationProperties(_serialization.Model): + """Parameters that define the configuration of traffic analytics. + + :ivar enabled: Flag to enable/disable traffic analytics. + :vartype enabled: bool + :ivar workspace_id: The resource guid of the attached workspace. + :vartype workspace_id: str + :ivar workspace_region: The location of the attached workspace. + :vartype workspace_region: str + :ivar workspace_resource_id: Resource Id of the attached workspace. + :vartype workspace_resource_id: str + :ivar traffic_analytics_interval: The interval in minutes which would decide how frequently TA + service should do flow analytics. + :vartype traffic_analytics_interval: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "workspace_id": {"key": "workspaceId", "type": "str"}, + "workspace_region": {"key": "workspaceRegion", "type": "str"}, + "workspace_resource_id": {"key": "workspaceResourceId", "type": "str"}, + "traffic_analytics_interval": {"key": "trafficAnalyticsInterval", "type": "int"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + workspace_id: Optional[str] = None, + workspace_region: Optional[str] = None, + workspace_resource_id: Optional[str] = None, + traffic_analytics_interval: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Flag to enable/disable traffic analytics. + :paramtype enabled: bool + :keyword workspace_id: The resource guid of the attached workspace. + :paramtype workspace_id: str + :keyword workspace_region: The location of the attached workspace. + :paramtype workspace_region: str + :keyword workspace_resource_id: Resource Id of the attached workspace. + :paramtype workspace_resource_id: str + :keyword traffic_analytics_interval: The interval in minutes which would decide how frequently + TA service should do flow analytics. + :paramtype traffic_analytics_interval: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.workspace_id = workspace_id + self.workspace_region = workspace_region + self.workspace_resource_id = workspace_resource_id + self.traffic_analytics_interval = traffic_analytics_interval + + +class TrafficAnalyticsProperties(_serialization.Model): + """Parameters that define the configuration of traffic analytics. + + :ivar network_watcher_flow_analytics_configuration: Parameters that define the configuration of + traffic analytics. + :vartype network_watcher_flow_analytics_configuration: + ~azure.mgmt.network.v2023_09_01.models.TrafficAnalyticsConfigurationProperties + """ + + _attribute_map = { + "network_watcher_flow_analytics_configuration": { + "key": "networkWatcherFlowAnalyticsConfiguration", + "type": "TrafficAnalyticsConfigurationProperties", + }, + } + + def __init__( + self, + *, + network_watcher_flow_analytics_configuration: Optional[ + "_models.TrafficAnalyticsConfigurationProperties" + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_watcher_flow_analytics_configuration: Parameters that define the configuration + of traffic analytics. + :paramtype network_watcher_flow_analytics_configuration: + ~azure.mgmt.network.v2023_09_01.models.TrafficAnalyticsConfigurationProperties + """ + super().__init__(**kwargs) + self.network_watcher_flow_analytics_configuration = network_watcher_flow_analytics_configuration + + +class TrafficSelectorPolicy(_serialization.Model): + """An traffic selector policy for a virtual network gateway connection. + + All required parameters must be populated in order to send to server. + + :ivar local_address_ranges: A collection of local address spaces in CIDR format. Required. + :vartype local_address_ranges: list[str] + :ivar remote_address_ranges: A collection of remote address spaces in CIDR format. Required. + :vartype remote_address_ranges: list[str] + """ + + _validation = { + "local_address_ranges": {"required": True}, + "remote_address_ranges": {"required": True}, + } + + _attribute_map = { + "local_address_ranges": {"key": "localAddressRanges", "type": "[str]"}, + "remote_address_ranges": {"key": "remoteAddressRanges", "type": "[str]"}, + } + + def __init__(self, *, local_address_ranges: List[str], remote_address_ranges: List[str], **kwargs: Any) -> None: + """ + :keyword local_address_ranges: A collection of local address spaces in CIDR format. Required. + :paramtype local_address_ranges: list[str] + :keyword remote_address_ranges: A collection of remote address spaces in CIDR format. Required. + :paramtype remote_address_ranges: list[str] + """ + super().__init__(**kwargs) + self.local_address_ranges = local_address_ranges + self.remote_address_ranges = remote_address_ranges + + +class TroubleshootingDetails(_serialization.Model): + """Information gained from troubleshooting of specified resource. + + :ivar id: The id of the get troubleshoot operation. + :vartype id: str + :ivar reason_type: Reason type of failure. + :vartype reason_type: str + :ivar summary: A summary of troubleshooting. + :vartype summary: str + :ivar detail: Details on troubleshooting results. + :vartype detail: str + :ivar recommended_actions: List of recommended actions. + :vartype recommended_actions: + list[~azure.mgmt.network.v2023_09_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "reason_type": {"key": "reasonType", "type": "str"}, + "summary": {"key": "summary", "type": "str"}, + "detail": {"key": "detail", "type": "str"}, + "recommended_actions": {"key": "recommendedActions", "type": "[TroubleshootingRecommendedActions]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + reason_type: Optional[str] = None, + summary: Optional[str] = None, + detail: Optional[str] = None, + recommended_actions: Optional[List["_models.TroubleshootingRecommendedActions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The id of the get troubleshoot operation. + :paramtype id: str + :keyword reason_type: Reason type of failure. + :paramtype reason_type: str + :keyword summary: A summary of troubleshooting. + :paramtype summary: str + :keyword detail: Details on troubleshooting results. + :paramtype detail: str + :keyword recommended_actions: List of recommended actions. + :paramtype recommended_actions: + list[~azure.mgmt.network.v2023_09_01.models.TroubleshootingRecommendedActions] + """ + super().__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions + + +class TroubleshootingParameters(_serialization.Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The target resource to troubleshoot. Required. + :vartype target_resource_id: str + :ivar storage_id: The ID for the storage account to save the troubleshoot result. Required. + :vartype storage_id: str + :ivar storage_path: The path to the blob to save the troubleshoot result in. Required. + :vartype storage_path: str + """ + + _validation = { + "target_resource_id": {"required": True}, + "storage_id": {"required": True}, + "storage_path": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + "storage_id": {"key": "properties.storageId", "type": "str"}, + "storage_path": {"key": "properties.storagePath", "type": "str"}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs: Any) -> None: + """ + :keyword target_resource_id: The target resource to troubleshoot. Required. + :paramtype target_resource_id: str + :keyword storage_id: The ID for the storage account to save the troubleshoot result. Required. + :paramtype storage_id: str + :keyword storage_path: The path to the blob to save the troubleshoot result in. Required. + :paramtype storage_path: str + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path + + +class TroubleshootingRecommendedActions(_serialization.Model): + """Recommended actions based on discovered issues. + + :ivar action_id: ID of the recommended action. + :vartype action_id: str + :ivar action_text: Description of recommended actions. + :vartype action_text: str + :ivar action_uri: The uri linking to a documentation for the recommended troubleshooting + actions. + :vartype action_uri: str + :ivar action_uri_text: The information from the URI for the recommended troubleshooting + actions. + :vartype action_uri_text: str + """ + + _attribute_map = { + "action_id": {"key": "actionId", "type": "str"}, + "action_text": {"key": "actionText", "type": "str"}, + "action_uri": {"key": "actionUri", "type": "str"}, + "action_uri_text": {"key": "actionUriText", "type": "str"}, + } + + def __init__( + self, + *, + action_id: Optional[str] = None, + action_text: Optional[str] = None, + action_uri: Optional[str] = None, + action_uri_text: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword action_id: ID of the recommended action. + :paramtype action_id: str + :keyword action_text: Description of recommended actions. + :paramtype action_text: str + :keyword action_uri: The uri linking to a documentation for the recommended troubleshooting + actions. + :paramtype action_uri: str + :keyword action_uri_text: The information from the URI for the recommended troubleshooting + actions. + :paramtype action_uri_text: str + """ + super().__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text + + +class TroubleshootingResult(_serialization.Model): + """Troubleshooting information gained from specified resource. + + :ivar start_time: The start time of the troubleshooting. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the troubleshooting. + :vartype end_time: ~datetime.datetime + :ivar code: The result code of the troubleshooting. + :vartype code: str + :ivar results: Information from troubleshooting. + :vartype results: list[~azure.mgmt.network.v2023_09_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "code": {"key": "code", "type": "str"}, + "results": {"key": "results", "type": "[TroubleshootingDetails]"}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + code: Optional[str] = None, + results: Optional[List["_models.TroubleshootingDetails"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword start_time: The start time of the troubleshooting. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the troubleshooting. + :paramtype end_time: ~datetime.datetime + :keyword code: The result code of the troubleshooting. + :paramtype code: str + :keyword results: Information from troubleshooting. + :paramtype results: list[~azure.mgmt.network.v2023_09_01.models.TroubleshootingDetails] + """ + super().__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results + + +class TunnelConnectionHealth(_serialization.Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual Network Gateway connection status. Known values are: + "Unknown", "Connecting", "Connected", and "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this connection. + :vartype ingress_bytes_transferred: int + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this connection. + :vartype egress_bytes_transferred: int + :ivar last_connection_established_utc_time: The time at which connection was established in Utc + format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + "tunnel": {"readonly": True}, + "connection_status": {"readonly": True}, + "ingress_bytes_transferred": {"readonly": True}, + "egress_bytes_transferred": {"readonly": True}, + "last_connection_established_utc_time": {"readonly": True}, + } + + _attribute_map = { + "tunnel": {"key": "tunnel", "type": "str"}, + "connection_status": {"key": "connectionStatus", "type": "str"}, + "ingress_bytes_transferred": {"key": "ingressBytesTransferred", "type": "int"}, + "egress_bytes_transferred": {"key": "egressBytesTransferred", "type": "int"}, + "last_connection_established_utc_time": {"key": "lastConnectionEstablishedUtcTime", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None + + +class UnprepareNetworkPoliciesRequest(_serialization.Model): + """Details of UnprepareNetworkPolicies for Subnet. + + :ivar service_name: The name of the service for which subnet is being unprepared for. + :vartype service_name: str + """ + + _attribute_map = { + "service_name": {"key": "serviceName", "type": "str"}, + } + + def __init__(self, *, service_name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword service_name: The name of the service for which subnet is being unprepared for. + :paramtype service_name: str + """ + super().__init__(**kwargs) + self.service_name = service_name + + +class Usage(_serialization.Model): + """The network resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: An enum describing the unit of measurement. Required. "Count" + :vartype unit: str or ~azure.mgmt.network.v2023_09_01.models.UsageUnit + :ivar current_value: The current value of the usage. Required. + :vartype current_value: int + :ivar limit: The limit of usage. Required. + :vartype limit: int + :ivar name: The name of the type of usage. Required. + :vartype name: ~azure.mgmt.network.v2023_09_01.models.UsageName + """ + + _validation = { + "id": {"readonly": True}, + "unit": {"required": True}, + "current_value": {"required": True}, + "limit": {"required": True}, + "name": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "int"}, + "limit": {"key": "limit", "type": "int"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__( + self, + *, + unit: Union[str, "_models.UsageUnit"], + current_value: int, + limit: int, + name: "_models.UsageName", + **kwargs: Any + ) -> None: + """ + :keyword unit: An enum describing the unit of measurement. Required. "Count" + :paramtype unit: str or ~azure.mgmt.network.v2023_09_01.models.UsageUnit + :keyword current_value: The current value of the usage. Required. + :paramtype current_value: int + :keyword limit: The limit of usage. Required. + :paramtype limit: int + :keyword name: The name of the type of usage. Required. + :paramtype name: ~azure.mgmt.network.v2023_09_01.models.UsageName + """ + super().__init__(**kwargs) + self.id = None + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name + + +class UsageName(_serialization.Model): + """The usage names. + + :ivar value: A string describing the resource name. + :vartype value: str + :ivar localized_value: A localized string describing the resource name. + :vartype localized_value: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, + } + + def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: A string describing the resource name. + :paramtype value: str + :keyword localized_value: A localized string describing the resource name. + :paramtype localized_value: str + """ + super().__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class UsagesListResult(_serialization.Model): + """The list usages operation response. + + :ivar value: The list network resource usages. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.Usage] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.Usage"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list network resource usages. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.Usage] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VerificationIPFlowParameters(_serialization.Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to server. + + :ivar target_resource_id: The ID of the target resource to perform next-hop on. Required. + :vartype target_resource_id: str + :ivar direction: The direction of the packet represented as a 5-tuple. Required. Known values + are: "Inbound" and "Outbound". + :vartype direction: str or ~azure.mgmt.network.v2023_09_01.models.Direction + :ivar protocol: Protocol to be verified on. Required. Known values are: "TCP" and "UDP". + :vartype protocol: str or ~azure.mgmt.network.v2023_09_01.models.IpFlowProtocol + :ivar local_port: The local port. Acceptable values are a single integer in the range + (0-65535). Support for * for the source port, which depends on the direction. Required. + :vartype local_port: str + :ivar remote_port: The remote port. Acceptable values are a single integer in the range + (0-65535). Support for * for the source port, which depends on the direction. Required. + :vartype remote_port: str + :ivar local_ip_address: The local IP address. Acceptable values are valid IPv4 addresses. + Required. + :vartype local_ip_address: str + :ivar remote_ip_address: The remote IP address. Acceptable values are valid IPv4 addresses. + Required. + :vartype remote_ip_address: str + :ivar target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled + on any of them, then this parameter must be specified. Otherwise optional). + :vartype target_nic_resource_id: str + """ + + _validation = { + "target_resource_id": {"required": True}, + "direction": {"required": True}, + "protocol": {"required": True}, + "local_port": {"required": True}, + "remote_port": {"required": True}, + "local_ip_address": {"required": True}, + "remote_ip_address": {"required": True}, + } + + _attribute_map = { + "target_resource_id": {"key": "targetResourceId", "type": "str"}, + "direction": {"key": "direction", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "local_port": {"key": "localPort", "type": "str"}, + "remote_port": {"key": "remotePort", "type": "str"}, + "local_ip_address": {"key": "localIPAddress", "type": "str"}, + "remote_ip_address": {"key": "remoteIPAddress", "type": "str"}, + "target_nic_resource_id": {"key": "targetNicResourceId", "type": "str"}, + } + + def __init__( + self, + *, + target_resource_id: str, + direction: Union[str, "_models.Direction"], + protocol: Union[str, "_models.IpFlowProtocol"], + local_port: str, + remote_port: str, + local_ip_address: str, + remote_ip_address: str, + target_nic_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_resource_id: The ID of the target resource to perform next-hop on. Required. + :paramtype target_resource_id: str + :keyword direction: The direction of the packet represented as a 5-tuple. Required. Known + values are: "Inbound" and "Outbound". + :paramtype direction: str or ~azure.mgmt.network.v2023_09_01.models.Direction + :keyword protocol: Protocol to be verified on. Required. Known values are: "TCP" and "UDP". + :paramtype protocol: str or ~azure.mgmt.network.v2023_09_01.models.IpFlowProtocol + :keyword local_port: The local port. Acceptable values are a single integer in the range + (0-65535). Support for * for the source port, which depends on the direction. Required. + :paramtype local_port: str + :keyword remote_port: The remote port. Acceptable values are a single integer in the range + (0-65535). Support for * for the source port, which depends on the direction. Required. + :paramtype remote_port: str + :keyword local_ip_address: The local IP address. Acceptable values are valid IPv4 addresses. + Required. + :paramtype local_ip_address: str + :keyword remote_ip_address: The remote IP address. Acceptable values are valid IPv4 addresses. + Required. + :paramtype remote_ip_address: str + :keyword target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is + enabled on any of them, then this parameter must be specified. Otherwise optional). + :paramtype target_nic_resource_id: str + """ + super().__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id + + +class VerificationIPFlowResult(_serialization.Model): + """Results of IP flow verification on the target resource. + + :ivar access: Indicates whether the traffic is allowed or denied. Known values are: "Allow" and + "Deny". + :vartype access: str or ~azure.mgmt.network.v2023_09_01.models.Access + :ivar rule_name: Name of the rule. If input is not matched against any security rule, it is not + displayed. + :vartype rule_name: str + """ + + _attribute_map = { + "access": {"key": "access", "type": "str"}, + "rule_name": {"key": "ruleName", "type": "str"}, + } + + def __init__( + self, *, access: Optional[Union[str, "_models.Access"]] = None, rule_name: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword access: Indicates whether the traffic is allowed or denied. Known values are: "Allow" + and "Deny". + :paramtype access: str or ~azure.mgmt.network.v2023_09_01.models.Access + :keyword rule_name: Name of the rule. If input is not matched against any security rule, it is + not displayed. + :paramtype rule_name: str + """ + super().__init__(**kwargs) + self.access = access + self.rule_name = rule_name + + +class VirtualApplianceAdditionalNicProperties(_serialization.Model): + """Network Virtual Appliance Additional NIC properties. + + :ivar name: Name of additional nic. + :vartype name: str + :ivar has_public_ip: Flag (true or false) for Intent for Public Ip on additional nic. + :vartype has_public_ip: bool + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "has_public_ip": {"key": "hasPublicIp", "type": "bool"}, + } + + def __init__(self, *, name: Optional[str] = None, has_public_ip: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of additional nic. + :paramtype name: str + :keyword has_public_ip: Flag (true or false) for Intent for Public Ip on additional nic. + :paramtype has_public_ip: bool + """ + super().__init__(**kwargs) + self.name = name + self.has_public_ip = has_public_ip + + +class VirtualApplianceNicProperties(_serialization.Model): + """Network Virtual Appliance NIC properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: NIC name. + :vartype name: str + :ivar public_ip_address: Public IP address. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP address. + :vartype private_ip_address: str + :ivar instance_name: Instance on which nic is attached. + :vartype instance_name: str + """ + + _validation = { + "name": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "instance_name": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "instance_name": {"key": "instanceName", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.public_ip_address = None + self.private_ip_address = None + self.instance_name = None + + +class VirtualApplianceSite(SubResource): + """Virtual Appliance Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the virtual appliance site. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Site type. + :vartype type: str + :ivar address_prefix: Address Prefix. + :vartype address_prefix: str + :ivar o365_policy: Office 365 Policy. + :vartype o365_policy: ~azure.mgmt.network.v2023_09_01.models.Office365PolicyProperties + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "o365_policy": {"key": "properties.o365Policy", "type": "Office365PolicyProperties"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + address_prefix: Optional[str] = None, + o365_policy: Optional["_models.Office365PolicyProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the virtual appliance site. + :paramtype name: str + :keyword address_prefix: Address Prefix. + :paramtype address_prefix: str + :keyword o365_policy: Office 365 Policy. + :paramtype o365_policy: ~azure.mgmt.network.v2023_09_01.models.Office365PolicyProperties + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.address_prefix = address_prefix + self.o365_policy = o365_policy + self.provisioning_state = None + + +class VirtualApplianceSkuProperties(_serialization.Model): + """Network Virtual Appliance Sku Properties. + + :ivar vendor: Virtual Appliance Vendor. + :vartype vendor: str + :ivar bundled_scale_unit: Virtual Appliance Scale Unit. + :vartype bundled_scale_unit: str + :ivar market_place_version: Virtual Appliance Version. + :vartype market_place_version: str + """ + + _attribute_map = { + "vendor": {"key": "vendor", "type": "str"}, + "bundled_scale_unit": {"key": "bundledScaleUnit", "type": "str"}, + "market_place_version": {"key": "marketPlaceVersion", "type": "str"}, + } + + def __init__( + self, + *, + vendor: Optional[str] = None, + bundled_scale_unit: Optional[str] = None, + market_place_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword vendor: Virtual Appliance Vendor. + :paramtype vendor: str + :keyword bundled_scale_unit: Virtual Appliance Scale Unit. + :paramtype bundled_scale_unit: str + :keyword market_place_version: Virtual Appliance Version. + :paramtype market_place_version: str + """ + super().__init__(**kwargs) + self.vendor = vendor + self.bundled_scale_unit = bundled_scale_unit + self.market_place_version = market_place_version + + +class VirtualHub(Resource): # pylint: disable=too-many-instance-attributes + """VirtualHub Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar kind: Kind of service virtual hub. This is metadata used for the Azure portal experience + for Route Server. + :vartype kind: str + :ivar virtual_wan: The VirtualWAN to which the VirtualHub belongs. + :vartype virtual_wan: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar vpn_gateway: The VpnGateway associated with this VirtualHub. + :vartype vpn_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :vartype p2_s_vpn_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :vartype express_route_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar azure_firewall: The azureFirewall associated with this VirtualHub. + :vartype azure_firewall: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :vartype security_partner_provider: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar address_prefix: Address-prefix for this VirtualHub. + :vartype address_prefix: str + :ivar route_table: The routeTable associated with this virtual hub. + :vartype route_table: ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTable + :ivar provisioning_state: The provisioning state of the virtual hub resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar security_provider_name: The Security Provider name. + :vartype security_provider_name: str + :ivar virtual_hub_route_table_v2_s: List of all virtual hub route table v2s associated with + this VirtualHub. + :vartype virtual_hub_route_table_v2_s: + list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :ivar sku: The sku of this VirtualHub. + :vartype sku: str + :ivar routing_state: The routing state. Known values are: "None", "Provisioned", + "Provisioning", and "Failed". + :vartype routing_state: str or ~azure.mgmt.network.v2023_09_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar route_maps: List of references to RouteMaps. + :vartype route_maps: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar virtual_router_asn: VirtualRouter ASN. + :vartype virtual_router_asn: int + :ivar virtual_router_ips: VirtualRouter IPs. + :vartype virtual_router_ips: list[str] + :ivar allow_branch_to_branch_traffic: Flag to control transit for VirtualRouter hub. + :vartype allow_branch_to_branch_traffic: bool + :ivar preferred_routing_gateway: The preferred gateway to route on-prem traffic. Known values + are: "ExpressRoute", "VpnGateway", and "None". + :vartype preferred_routing_gateway: str or + ~azure.mgmt.network.v2023_09_01.models.PreferredRoutingGateway + :ivar hub_routing_preference: The hubRoutingPreference of this VirtualHub. Known values are: + "ExpressRoute", "VpnGateway", and "ASPath". + :vartype hub_routing_preference: str or + ~azure.mgmt.network.v2023_09_01.models.HubRoutingPreference + :ivar virtual_router_auto_scale_configuration: The VirtualHub Router autoscale configuration. + :vartype virtual_router_auto_scale_configuration: + ~azure.mgmt.network.v2023_09_01.models.VirtualRouterAutoScaleConfiguration + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "kind": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "routing_state": {"readonly": True}, + "bgp_connections": {"readonly": True}, + "ip_configurations": {"readonly": True}, + "route_maps": {"readonly": True}, + "virtual_router_asn": {"maximum": 4294967295, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "virtual_wan": {"key": "properties.virtualWan", "type": "SubResource"}, + "vpn_gateway": {"key": "properties.vpnGateway", "type": "SubResource"}, + "p2_s_vpn_gateway": {"key": "properties.p2SVpnGateway", "type": "SubResource"}, + "express_route_gateway": {"key": "properties.expressRouteGateway", "type": "SubResource"}, + "azure_firewall": {"key": "properties.azureFirewall", "type": "SubResource"}, + "security_partner_provider": {"key": "properties.securityPartnerProvider", "type": "SubResource"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "route_table": {"key": "properties.routeTable", "type": "VirtualHubRouteTable"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "security_provider_name": {"key": "properties.securityProviderName", "type": "str"}, + "virtual_hub_route_table_v2_s": { + "key": "properties.virtualHubRouteTableV2s", + "type": "[VirtualHubRouteTableV2]", + }, + "sku": {"key": "properties.sku", "type": "str"}, + "routing_state": {"key": "properties.routingState", "type": "str"}, + "bgp_connections": {"key": "properties.bgpConnections", "type": "[SubResource]"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[SubResource]"}, + "route_maps": {"key": "properties.routeMaps", "type": "[SubResource]"}, + "virtual_router_asn": {"key": "properties.virtualRouterAsn", "type": "int"}, + "virtual_router_ips": {"key": "properties.virtualRouterIps", "type": "[str]"}, + "allow_branch_to_branch_traffic": {"key": "properties.allowBranchToBranchTraffic", "type": "bool"}, + "preferred_routing_gateway": {"key": "properties.preferredRoutingGateway", "type": "str"}, + "hub_routing_preference": {"key": "properties.hubRoutingPreference", "type": "str"}, + "virtual_router_auto_scale_configuration": { + "key": "properties.virtualRouterAutoScaleConfiguration", + "type": "VirtualRouterAutoScaleConfiguration", + }, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_wan: Optional["_models.SubResource"] = None, + vpn_gateway: Optional["_models.SubResource"] = None, + p2_s_vpn_gateway: Optional["_models.SubResource"] = None, + express_route_gateway: Optional["_models.SubResource"] = None, + azure_firewall: Optional["_models.SubResource"] = None, + security_partner_provider: Optional["_models.SubResource"] = None, + address_prefix: Optional[str] = None, + route_table: Optional["_models.VirtualHubRouteTable"] = None, + security_provider_name: Optional[str] = None, + virtual_hub_route_table_v2_s: Optional[List["_models.VirtualHubRouteTableV2"]] = None, + sku: Optional[str] = None, + virtual_router_asn: Optional[int] = None, + virtual_router_ips: Optional[List[str]] = None, + allow_branch_to_branch_traffic: Optional[bool] = None, + preferred_routing_gateway: Optional[Union[str, "_models.PreferredRoutingGateway"]] = None, + hub_routing_preference: Optional[Union[str, "_models.HubRoutingPreference"]] = None, + virtual_router_auto_scale_configuration: Optional["_models.VirtualRouterAutoScaleConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword virtual_wan: The VirtualWAN to which the VirtualHub belongs. + :paramtype virtual_wan: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword vpn_gateway: The VpnGateway associated with this VirtualHub. + :paramtype vpn_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :paramtype p2_s_vpn_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :paramtype express_route_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword azure_firewall: The azureFirewall associated with this VirtualHub. + :paramtype azure_firewall: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword security_partner_provider: The securityPartnerProvider associated with this + VirtualHub. + :paramtype security_partner_provider: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword address_prefix: Address-prefix for this VirtualHub. + :paramtype address_prefix: str + :keyword route_table: The routeTable associated with this virtual hub. + :paramtype route_table: ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTable + :keyword security_provider_name: The Security Provider name. + :paramtype security_provider_name: str + :keyword virtual_hub_route_table_v2_s: List of all virtual hub route table v2s associated with + this VirtualHub. + :paramtype virtual_hub_route_table_v2_s: + list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :keyword sku: The sku of this VirtualHub. + :paramtype sku: str + :keyword virtual_router_asn: VirtualRouter ASN. + :paramtype virtual_router_asn: int + :keyword virtual_router_ips: VirtualRouter IPs. + :paramtype virtual_router_ips: list[str] + :keyword allow_branch_to_branch_traffic: Flag to control transit for VirtualRouter hub. + :paramtype allow_branch_to_branch_traffic: bool + :keyword preferred_routing_gateway: The preferred gateway to route on-prem traffic. Known + values are: "ExpressRoute", "VpnGateway", and "None". + :paramtype preferred_routing_gateway: str or + ~azure.mgmt.network.v2023_09_01.models.PreferredRoutingGateway + :keyword hub_routing_preference: The hubRoutingPreference of this VirtualHub. Known values are: + "ExpressRoute", "VpnGateway", and "ASPath". + :paramtype hub_routing_preference: str or + ~azure.mgmt.network.v2023_09_01.models.HubRoutingPreference + :keyword virtual_router_auto_scale_configuration: The VirtualHub Router autoscale + configuration. + :paramtype virtual_router_auto_scale_configuration: + ~azure.mgmt.network.v2023_09_01.models.VirtualRouterAutoScaleConfiguration + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.kind = None + self.virtual_wan = virtual_wan + self.vpn_gateway = vpn_gateway + self.p2_s_vpn_gateway = p2_s_vpn_gateway + self.express_route_gateway = express_route_gateway + self.azure_firewall = azure_firewall + self.security_partner_provider = security_partner_provider + self.address_prefix = address_prefix + self.route_table = route_table + self.provisioning_state = None + self.security_provider_name = security_provider_name + self.virtual_hub_route_table_v2_s = virtual_hub_route_table_v2_s + self.sku = sku + self.routing_state = None + self.bgp_connections = None + self.ip_configurations = None + self.route_maps = None + self.virtual_router_asn = virtual_router_asn + self.virtual_router_ips = virtual_router_ips + self.allow_branch_to_branch_traffic = allow_branch_to_branch_traffic + self.preferred_routing_gateway = preferred_routing_gateway + self.hub_routing_preference = hub_routing_preference + self.virtual_router_auto_scale_configuration = virtual_router_auto_scale_configuration + + +class VirtualHubEffectiveRoute(_serialization.Model): + """The effective route configured on the virtual hub or specified resource. + + :ivar address_prefixes: The list of address prefixes. + :vartype address_prefixes: list[str] + :ivar next_hops: The list of next hops. + :vartype next_hops: list[str] + :ivar next_hop_type: The type of the next hop. + :vartype next_hop_type: str + :ivar as_path: The ASPath of this route. + :vartype as_path: str + :ivar route_origin: The origin of this route. + :vartype route_origin: str + """ + + _attribute_map = { + "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, + "next_hops": {"key": "nextHops", "type": "[str]"}, + "next_hop_type": {"key": "nextHopType", "type": "str"}, + "as_path": {"key": "asPath", "type": "str"}, + "route_origin": {"key": "routeOrigin", "type": "str"}, + } + + def __init__( + self, + *, + address_prefixes: Optional[List[str]] = None, + next_hops: Optional[List[str]] = None, + next_hop_type: Optional[str] = None, + as_path: Optional[str] = None, + route_origin: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword address_prefixes: The list of address prefixes. + :paramtype address_prefixes: list[str] + :keyword next_hops: The list of next hops. + :paramtype next_hops: list[str] + :keyword next_hop_type: The type of the next hop. + :paramtype next_hop_type: str + :keyword as_path: The ASPath of this route. + :paramtype as_path: str + :keyword route_origin: The origin of this route. + :paramtype route_origin: str + """ + super().__init__(**kwargs) + self.address_prefixes = address_prefixes + self.next_hops = next_hops + self.next_hop_type = next_hop_type + self.as_path = as_path + self.route_origin = route_origin + + +class VirtualHubEffectiveRouteList(_serialization.Model): + """EffectiveRoutes List. + + :ivar value: The list of effective routes configured on the virtual hub or the specified + resource. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRoute] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualHubEffectiveRoute]"}, + } + + def __init__(self, *, value: Optional[List["_models.VirtualHubEffectiveRoute"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of effective routes configured on the virtual hub or the specified + resource. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRoute] + """ + super().__init__(**kwargs) + self.value = value + + +class VirtualHubId(_serialization.Model): + """Virtual Hub identifier. + + :ivar id: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be + deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same + subscription. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be + deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same + subscription. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class VirtualHubRoute(_serialization.Model): + """VirtualHub route. + + :ivar address_prefixes: List of all addressPrefixes. + :vartype address_prefixes: list[str] + :ivar next_hop_ip_address: NextHop ip address. + :vartype next_hop_ip_address: str + """ + + _attribute_map = { + "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, + "next_hop_ip_address": {"key": "nextHopIpAddress", "type": "str"}, + } + + def __init__( + self, *, address_prefixes: Optional[List[str]] = None, next_hop_ip_address: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword address_prefixes: List of all addressPrefixes. + :paramtype address_prefixes: list[str] + :keyword next_hop_ip_address: NextHop ip address. + :paramtype next_hop_ip_address: str + """ + super().__init__(**kwargs) + self.address_prefixes = address_prefixes + self.next_hop_ip_address = next_hop_ip_address + + +class VirtualHubRouteTable(_serialization.Model): + """VirtualHub route table. + + :ivar routes: List of all routes. + :vartype routes: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRoute] + """ + + _attribute_map = { + "routes": {"key": "routes", "type": "[VirtualHubRoute]"}, + } + + def __init__(self, *, routes: Optional[List["_models.VirtualHubRoute"]] = None, **kwargs: Any) -> None: + """ + :keyword routes: List of all routes. + :paramtype routes: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRoute] + """ + super().__init__(**kwargs) + self.routes = routes + + +class VirtualHubRouteTableV2(SubResource): + """VirtualHubRouteTableV2 Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar routes: List of all routes. + :vartype routes: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteV2] + :ivar attached_connections: List of all connections attached to this route table v2. + :vartype attached_connections: list[str] + :ivar provisioning_state: The provisioning state of the virtual hub route table v2 resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "routes": {"key": "properties.routes", "type": "[VirtualHubRouteV2]"}, + "attached_connections": {"key": "properties.attachedConnections", "type": "[str]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + routes: Optional[List["_models.VirtualHubRouteV2"]] = None, + attached_connections: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword routes: List of all routes. + :paramtype routes: list[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteV2] + :keyword attached_connections: List of all connections attached to this route table v2. + :paramtype attached_connections: list[str] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.routes = routes + self.attached_connections = attached_connections + self.provisioning_state = None + + +class VirtualHubRouteV2(_serialization.Model): + """VirtualHubRouteTableV2 route. + + :ivar destination_type: The type of destinations. + :vartype destination_type: str + :ivar destinations: List of all destinations. + :vartype destinations: list[str] + :ivar next_hop_type: The type of next hops. + :vartype next_hop_type: str + :ivar next_hops: NextHops ip address. + :vartype next_hops: list[str] + """ + + _attribute_map = { + "destination_type": {"key": "destinationType", "type": "str"}, + "destinations": {"key": "destinations", "type": "[str]"}, + "next_hop_type": {"key": "nextHopType", "type": "str"}, + "next_hops": {"key": "nextHops", "type": "[str]"}, + } + + def __init__( + self, + *, + destination_type: Optional[str] = None, + destinations: Optional[List[str]] = None, + next_hop_type: Optional[str] = None, + next_hops: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword destination_type: The type of destinations. + :paramtype destination_type: str + :keyword destinations: List of all destinations. + :paramtype destinations: list[str] + :keyword next_hop_type: The type of next hops. + :paramtype next_hop_type: str + :keyword next_hops: NextHops ip address. + :paramtype next_hops: list[str] + """ + super().__init__(**kwargs) + self.destination_type = destination_type + self.destinations = destinations + self.next_hop_type = next_hop_type + self.next_hops = next_hops + + +class VirtualNetwork(Resource): # pylint: disable=too-many-instance-attributes + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of the virtual network. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar address_space: The AddressSpace that contains an array of IP address ranges that can be + used by subnets. + :vartype address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar dhcp_options: The dhcpOptions that contains an array of DNS servers available to VMs + deployed in the virtual network. + :vartype dhcp_options: ~azure.mgmt.network.v2023_09_01.models.DhcpOptions + :ivar flow_timeout_in_minutes: The FlowTimeout value (in minutes) for the Virtual Network. + :vartype flow_timeout_in_minutes: int + :ivar subnets: A list of subnets in a Virtual Network. + :vartype subnets: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :ivar virtual_network_peerings: A list of peerings in a Virtual Network. + :vartype virtual_network_peerings: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :ivar resource_guid: The resourceGuid property of the Virtual Network resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar enable_ddos_protection: Indicates if DDoS protection is enabled for all the protected + resources in the virtual network. It requires a DDoS protection plan associated with the + resource. + :vartype enable_ddos_protection: bool + :ivar enable_vm_protection: Indicates if VM protection is enabled for all the subnets in the + virtual network. + :vartype enable_vm_protection: bool + :ivar ddos_protection_plan: The DDoS protection plan associated with the virtual network. + :vartype ddos_protection_plan: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar bgp_communities: Bgp Communities sent over ExpressRoute with each route corresponding to + a prefix in this VNET. + :vartype bgp_communities: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkBgpCommunities + :ivar encryption: Indicates if encryption is enabled on virtual network and if VM without + encryption is allowed in encrypted VNet. + :vartype encryption: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkEncryption + :ivar ip_allocations: Array of IpAllocation which reference this VNET. + :vartype ip_allocations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2023_09_01.models.FlowLog] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "flow_logs": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "etag": {"key": "etag", "type": "str"}, + "address_space": {"key": "properties.addressSpace", "type": "AddressSpace"}, + "dhcp_options": {"key": "properties.dhcpOptions", "type": "DhcpOptions"}, + "flow_timeout_in_minutes": {"key": "properties.flowTimeoutInMinutes", "type": "int"}, + "subnets": {"key": "properties.subnets", "type": "[Subnet]"}, + "virtual_network_peerings": {"key": "properties.virtualNetworkPeerings", "type": "[VirtualNetworkPeering]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "enable_ddos_protection": {"key": "properties.enableDdosProtection", "type": "bool"}, + "enable_vm_protection": {"key": "properties.enableVmProtection", "type": "bool"}, + "ddos_protection_plan": {"key": "properties.ddosProtectionPlan", "type": "SubResource"}, + "bgp_communities": {"key": "properties.bgpCommunities", "type": "VirtualNetworkBgpCommunities"}, + "encryption": {"key": "properties.encryption", "type": "VirtualNetworkEncryption"}, + "ip_allocations": {"key": "properties.ipAllocations", "type": "[SubResource]"}, + "flow_logs": {"key": "properties.flowLogs", "type": "[FlowLog]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + address_space: Optional["_models.AddressSpace"] = None, + dhcp_options: Optional["_models.DhcpOptions"] = None, + flow_timeout_in_minutes: Optional[int] = None, + subnets: Optional[List["_models.Subnet"]] = None, + virtual_network_peerings: Optional[List["_models.VirtualNetworkPeering"]] = None, + enable_ddos_protection: bool = False, + enable_vm_protection: bool = False, + ddos_protection_plan: Optional["_models.SubResource"] = None, + bgp_communities: Optional["_models.VirtualNetworkBgpCommunities"] = None, + encryption: Optional["_models.VirtualNetworkEncryption"] = None, + ip_allocations: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of the virtual network. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword address_space: The AddressSpace that contains an array of IP address ranges that can + be used by subnets. + :paramtype address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword dhcp_options: The dhcpOptions that contains an array of DNS servers available to VMs + deployed in the virtual network. + :paramtype dhcp_options: ~azure.mgmt.network.v2023_09_01.models.DhcpOptions + :keyword flow_timeout_in_minutes: The FlowTimeout value (in minutes) for the Virtual Network. + :paramtype flow_timeout_in_minutes: int + :keyword subnets: A list of subnets in a Virtual Network. + :paramtype subnets: list[~azure.mgmt.network.v2023_09_01.models.Subnet] + :keyword virtual_network_peerings: A list of peerings in a Virtual Network. + :paramtype virtual_network_peerings: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :keyword enable_ddos_protection: Indicates if DDoS protection is enabled for all the protected + resources in the virtual network. It requires a DDoS protection plan associated with the + resource. + :paramtype enable_ddos_protection: bool + :keyword enable_vm_protection: Indicates if VM protection is enabled for all the subnets in the + virtual network. + :paramtype enable_vm_protection: bool + :keyword ddos_protection_plan: The DDoS protection plan associated with the virtual network. + :paramtype ddos_protection_plan: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword bgp_communities: Bgp Communities sent over ExpressRoute with each route corresponding + to a prefix in this VNET. + :paramtype bgp_communities: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkBgpCommunities + :keyword encryption: Indicates if encryption is enabled on virtual network and if VM without + encryption is allowed in encrypted VNet. + :paramtype encryption: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkEncryption + :keyword ip_allocations: Array of IpAllocation which reference this VNET. + :paramtype ip_allocations: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.address_space = address_space + self.dhcp_options = dhcp_options + self.flow_timeout_in_minutes = flow_timeout_in_minutes + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = None + self.provisioning_state = None + self.enable_ddos_protection = enable_ddos_protection + self.enable_vm_protection = enable_vm_protection + self.ddos_protection_plan = ddos_protection_plan + self.bgp_communities = bgp_communities + self.encryption = encryption + self.ip_allocations = ip_allocations + self.flow_logs = None + + +class VirtualNetworkBgpCommunities(_serialization.Model): + """Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar virtual_network_community: The BGP community associated with the virtual network. + Required. + :vartype virtual_network_community: str + :ivar regional_community: The BGP community associated with the region of the virtual network. + :vartype regional_community: str + """ + + _validation = { + "virtual_network_community": {"required": True}, + "regional_community": {"readonly": True}, + } + + _attribute_map = { + "virtual_network_community": {"key": "virtualNetworkCommunity", "type": "str"}, + "regional_community": {"key": "regionalCommunity", "type": "str"}, + } + + def __init__(self, *, virtual_network_community: str, **kwargs: Any) -> None: + """ + :keyword virtual_network_community: The BGP community associated with the virtual network. + Required. + :paramtype virtual_network_community: str + """ + super().__init__(**kwargs) + self.virtual_network_community = virtual_network_community + self.regional_community = None + + +class VirtualNetworkConnectionGatewayReference(_serialization.Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. Required. + :vartype id: str + """ + + _validation = { + "id": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. Required. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class VirtualNetworkDdosProtectionStatusResult(_serialization.Model): + """Response for GetVirtualNetworkDdosProtectionStatusOperation. + + :ivar value: The Ddos Protection Status Result for each public ip under a virtual network. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.PublicIpDdosProtectionStatusResult] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PublicIpDdosProtectionStatusResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.PublicIpDdosProtectionStatusResult"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The Ddos Protection Status Result for each public ip under a virtual network. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.PublicIpDdosProtectionStatusResult] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkEncryption(_serialization.Model): + """Indicates if encryption is enabled on virtual network and if VM without encryption is allowed + in encrypted VNet. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Indicates if encryption is enabled on the virtual network. Required. + :vartype enabled: bool + :ivar enforcement: If the encrypted VNet allows VM that does not support encryption. Known + values are: "DropUnencrypted" and "AllowUnencrypted". + :vartype enforcement: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkEncryptionEnforcement + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "enforcement": {"key": "enforcement", "type": "str"}, + } + + def __init__( + self, + *, + enabled: bool, + enforcement: Optional[Union[str, "_models.VirtualNetworkEncryptionEnforcement"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Indicates if encryption is enabled on the virtual network. Required. + :paramtype enabled: bool + :keyword enforcement: If the encrypted VNet allows VM that does not support encryption. Known + values are: "DropUnencrypted" and "AllowUnencrypted". + :paramtype enforcement: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkEncryptionEnforcement + """ + super().__init__(**kwargs) + self.enabled = enabled + self.enforcement = enforcement + + +class VirtualNetworkGateway(Resource): # pylint: disable=too-many-instance-attributes + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar extended_location: The extended location of type local virtual network gateway. + :vartype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar auto_scale_configuration: Autoscale configuration for virutal network gateway. + :vartype auto_scale_configuration: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayAutoScaleConfiguration + :ivar ip_configurations: IP configurations for virtual network gateway. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayIPConfiguration] + :ivar gateway_type: The type of this virtual network gateway. Known values are: "Vpn", + "ExpressRoute", and "LocalGateway". + :vartype gateway_type: str or ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayType + :ivar vpn_type: The type of this virtual network gateway. Known values are: "PolicyBased" and + "RouteBased". + :vartype vpn_type: str or ~azure.mgmt.network.v2023_09_01.models.VpnType + :ivar vpn_gateway_generation: The generation for this VirtualNetworkGateway. Must be None if + gatewayType is not VPN. Known values are: "None", "Generation1", and "Generation2". + :vartype vpn_gateway_generation: str or + ~azure.mgmt.network.v2023_09_01.models.VpnGatewayGeneration + :ivar enable_bgp: Whether BGP is enabled for this virtual network gateway or not. + :vartype enable_bgp: bool + :ivar enable_private_ip_address: Whether private IP needs to be enabled on this gateway for + connections or not. + :vartype enable_private_ip_address: bool + :ivar active: ActiveActive flag. + :vartype active: bool + :ivar disable_ip_sec_replay_protection: disableIPSecReplayProtection flag. + :vartype disable_ip_sec_replay_protection: bool + :ivar gateway_default_site: The reference to the LocalNetworkGateway resource which represents + local network site having default routes. Assign Null value in case of removing existing + default site setting. + :vartype gateway_default_site: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar sku: The reference to the VirtualNetworkGatewaySku resource which represents the SKU + selected for Virtual network gateway. + :vartype sku: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewaySku + :ivar vpn_client_configuration: The reference to the VpnClientConfiguration resource which + represents the P2S VpnClient configurations. + :vartype vpn_client_configuration: + ~azure.mgmt.network.v2023_09_01.models.VpnClientConfiguration + :ivar virtual_network_gateway_policy_groups: The reference to the + VirtualNetworkGatewayPolicyGroup resource which represents the available + VirtualNetworkGatewayPolicyGroup for the gateway. + :vartype virtual_network_gateway_policy_groups: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayPolicyGroup] + :ivar bgp_settings: Virtual network gateway's BGP speaker settings. + :vartype bgp_settings: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :ivar custom_routes: The reference to the address space resource which represents the custom + routes address space specified by the customer for virtual network gateway and VpnClient. + :vartype custom_routes: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar resource_guid: The resource GUID property of the virtual network gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar enable_dns_forwarding: Whether dns forwarding is enabled or not. + :vartype enable_dns_forwarding: bool + :ivar inbound_dns_forwarding_endpoint: The IP address allocated by the gateway to which dns + requests can be sent. + :vartype inbound_dns_forwarding_endpoint: str + :ivar v_net_extended_location_resource_id: Customer vnet resource id. VirtualNetworkGateway of + type local gateway is associated with the customer vnet. + :vartype v_net_extended_location_resource_id: str + :ivar nat_rules: NatRules for virtual network gateway. + :vartype nat_rules: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :ivar enable_bgp_route_translation_for_nat: EnableBgpRouteTranslationForNat flag. + :vartype enable_bgp_route_translation_for_nat: bool + :ivar allow_virtual_wan_traffic: Configures this gateway to accept traffic from remote Virtual + WAN networks. + :vartype allow_virtual_wan_traffic: bool + :ivar allow_remote_vnet_traffic: Configure this gateway to accept traffic from other Azure + Virtual Networks. This configuration does not support connectivity to Azure Virtual WAN. + :vartype allow_remote_vnet_traffic: bool + :ivar admin_state: Property to indicate if the Express Route Gateway serves traffic when there + are multiple Express Route Gateways in the vnet. Known values are: "Enabled" and "Disabled". + :vartype admin_state: str or ~azure.mgmt.network.v2023_09_01.models.AdminState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "inbound_dns_forwarding_endpoint": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "etag": {"key": "etag", "type": "str"}, + "auto_scale_configuration": { + "key": "properties.autoScaleConfiguration", + "type": "VirtualNetworkGatewayAutoScaleConfiguration", + }, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[VirtualNetworkGatewayIPConfiguration]"}, + "gateway_type": {"key": "properties.gatewayType", "type": "str"}, + "vpn_type": {"key": "properties.vpnType", "type": "str"}, + "vpn_gateway_generation": {"key": "properties.vpnGatewayGeneration", "type": "str"}, + "enable_bgp": {"key": "properties.enableBgp", "type": "bool"}, + "enable_private_ip_address": {"key": "properties.enablePrivateIpAddress", "type": "bool"}, + "active": {"key": "properties.activeActive", "type": "bool"}, + "disable_ip_sec_replay_protection": {"key": "properties.disableIPSecReplayProtection", "type": "bool"}, + "gateway_default_site": {"key": "properties.gatewayDefaultSite", "type": "SubResource"}, + "sku": {"key": "properties.sku", "type": "VirtualNetworkGatewaySku"}, + "vpn_client_configuration": {"key": "properties.vpnClientConfiguration", "type": "VpnClientConfiguration"}, + "virtual_network_gateway_policy_groups": { + "key": "properties.virtualNetworkGatewayPolicyGroups", + "type": "[VirtualNetworkGatewayPolicyGroup]", + }, + "bgp_settings": {"key": "properties.bgpSettings", "type": "BgpSettings"}, + "custom_routes": {"key": "properties.customRoutes", "type": "AddressSpace"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "enable_dns_forwarding": {"key": "properties.enableDnsForwarding", "type": "bool"}, + "inbound_dns_forwarding_endpoint": {"key": "properties.inboundDnsForwardingEndpoint", "type": "str"}, + "v_net_extended_location_resource_id": {"key": "properties.vNetExtendedLocationResourceId", "type": "str"}, + "nat_rules": {"key": "properties.natRules", "type": "[VirtualNetworkGatewayNatRule]"}, + "enable_bgp_route_translation_for_nat": {"key": "properties.enableBgpRouteTranslationForNat", "type": "bool"}, + "allow_virtual_wan_traffic": {"key": "properties.allowVirtualWanTraffic", "type": "bool"}, + "allow_remote_vnet_traffic": {"key": "properties.allowRemoteVnetTraffic", "type": "bool"}, + "admin_state": {"key": "properties.adminState", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + auto_scale_configuration: Optional["_models.VirtualNetworkGatewayAutoScaleConfiguration"] = None, + ip_configurations: Optional[List["_models.VirtualNetworkGatewayIPConfiguration"]] = None, + gateway_type: Optional[Union[str, "_models.VirtualNetworkGatewayType"]] = None, + vpn_type: Optional[Union[str, "_models.VpnType"]] = None, + vpn_gateway_generation: Optional[Union[str, "_models.VpnGatewayGeneration"]] = None, + enable_bgp: Optional[bool] = None, + enable_private_ip_address: Optional[bool] = None, + active: Optional[bool] = None, + disable_ip_sec_replay_protection: Optional[bool] = None, + gateway_default_site: Optional["_models.SubResource"] = None, + sku: Optional["_models.VirtualNetworkGatewaySku"] = None, + vpn_client_configuration: Optional["_models.VpnClientConfiguration"] = None, + virtual_network_gateway_policy_groups: Optional[List["_models.VirtualNetworkGatewayPolicyGroup"]] = None, + bgp_settings: Optional["_models.BgpSettings"] = None, + custom_routes: Optional["_models.AddressSpace"] = None, + enable_dns_forwarding: Optional[bool] = None, + v_net_extended_location_resource_id: Optional[str] = None, + nat_rules: Optional[List["_models.VirtualNetworkGatewayNatRule"]] = None, + enable_bgp_route_translation_for_nat: Optional[bool] = None, + allow_virtual_wan_traffic: Optional[bool] = None, + allow_remote_vnet_traffic: Optional[bool] = None, + admin_state: Optional[Union[str, "_models.AdminState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword extended_location: The extended location of type local virtual network gateway. + :paramtype extended_location: ~azure.mgmt.network.v2023_09_01.models.ExtendedLocation + :keyword auto_scale_configuration: Autoscale configuration for virutal network gateway. + :paramtype auto_scale_configuration: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayAutoScaleConfiguration + :keyword ip_configurations: IP configurations for virtual network gateway. + :paramtype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayIPConfiguration] + :keyword gateway_type: The type of this virtual network gateway. Known values are: "Vpn", + "ExpressRoute", and "LocalGateway". + :paramtype gateway_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayType + :keyword vpn_type: The type of this virtual network gateway. Known values are: "PolicyBased" + and "RouteBased". + :paramtype vpn_type: str or ~azure.mgmt.network.v2023_09_01.models.VpnType + :keyword vpn_gateway_generation: The generation for this VirtualNetworkGateway. Must be None if + gatewayType is not VPN. Known values are: "None", "Generation1", and "Generation2". + :paramtype vpn_gateway_generation: str or + ~azure.mgmt.network.v2023_09_01.models.VpnGatewayGeneration + :keyword enable_bgp: Whether BGP is enabled for this virtual network gateway or not. + :paramtype enable_bgp: bool + :keyword enable_private_ip_address: Whether private IP needs to be enabled on this gateway for + connections or not. + :paramtype enable_private_ip_address: bool + :keyword active: ActiveActive flag. + :paramtype active: bool + :keyword disable_ip_sec_replay_protection: disableIPSecReplayProtection flag. + :paramtype disable_ip_sec_replay_protection: bool + :keyword gateway_default_site: The reference to the LocalNetworkGateway resource which + represents local network site having default routes. Assign Null value in case of removing + existing default site setting. + :paramtype gateway_default_site: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword sku: The reference to the VirtualNetworkGatewaySku resource which represents the SKU + selected for Virtual network gateway. + :paramtype sku: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewaySku + :keyword vpn_client_configuration: The reference to the VpnClientConfiguration resource which + represents the P2S VpnClient configurations. + :paramtype vpn_client_configuration: + ~azure.mgmt.network.v2023_09_01.models.VpnClientConfiguration + :keyword virtual_network_gateway_policy_groups: The reference to the + VirtualNetworkGatewayPolicyGroup resource which represents the available + VirtualNetworkGatewayPolicyGroup for the gateway. + :paramtype virtual_network_gateway_policy_groups: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayPolicyGroup] + :keyword bgp_settings: Virtual network gateway's BGP speaker settings. + :paramtype bgp_settings: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :keyword custom_routes: The reference to the address space resource which represents the custom + routes address space specified by the customer for virtual network gateway and VpnClient. + :paramtype custom_routes: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword enable_dns_forwarding: Whether dns forwarding is enabled or not. + :paramtype enable_dns_forwarding: bool + :keyword v_net_extended_location_resource_id: Customer vnet resource id. VirtualNetworkGateway + of type local gateway is associated with the customer vnet. + :paramtype v_net_extended_location_resource_id: str + :keyword nat_rules: NatRules for virtual network gateway. + :paramtype nat_rules: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :keyword enable_bgp_route_translation_for_nat: EnableBgpRouteTranslationForNat flag. + :paramtype enable_bgp_route_translation_for_nat: bool + :keyword allow_virtual_wan_traffic: Configures this gateway to accept traffic from remote + Virtual WAN networks. + :paramtype allow_virtual_wan_traffic: bool + :keyword allow_remote_vnet_traffic: Configure this gateway to accept traffic from other Azure + Virtual Networks. This configuration does not support connectivity to Azure Virtual WAN. + :paramtype allow_remote_vnet_traffic: bool + :keyword admin_state: Property to indicate if the Express Route Gateway serves traffic when + there are multiple Express Route Gateways in the vnet. Known values are: "Enabled" and + "Disabled". + :paramtype admin_state: str or ~azure.mgmt.network.v2023_09_01.models.AdminState + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.auto_scale_configuration = auto_scale_configuration + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.vpn_gateway_generation = vpn_gateway_generation + self.enable_bgp = enable_bgp + self.enable_private_ip_address = enable_private_ip_address + self.active = active + self.disable_ip_sec_replay_protection = disable_ip_sec_replay_protection + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.virtual_network_gateway_policy_groups = virtual_network_gateway_policy_groups + self.bgp_settings = bgp_settings + self.custom_routes = custom_routes + self.resource_guid = None + self.provisioning_state = None + self.enable_dns_forwarding = enable_dns_forwarding + self.inbound_dns_forwarding_endpoint = None + self.v_net_extended_location_resource_id = v_net_extended_location_resource_id + self.nat_rules = nat_rules + self.enable_bgp_route_translation_for_nat = enable_bgp_route_translation_for_nat + self.allow_virtual_wan_traffic = allow_virtual_wan_traffic + self.allow_remote_vnet_traffic = allow_remote_vnet_traffic + self.admin_state = admin_state + + +class VirtualNetworkGatewayAutoScaleBounds(_serialization.Model): + """VirtualNetworkGatewayAutoScaleBounds. + + :ivar min: Minimum scale Units for Autoscale configuration. + :vartype min: int + :ivar max: Maximum Scale Units for Autoscale configuration. + :vartype max: int + """ + + _attribute_map = { + "min": {"key": "min", "type": "int"}, + "max": {"key": "max", "type": "int"}, + } + + def __init__( + self, + *, + min: Optional[int] = None, # pylint: disable=redefined-builtin + max: Optional[int] = None, # pylint: disable=redefined-builtin + **kwargs: Any + ) -> None: + """ + :keyword min: Minimum scale Units for Autoscale configuration. + :paramtype min: int + :keyword max: Maximum Scale Units for Autoscale configuration. + :paramtype max: int + """ + super().__init__(**kwargs) + self.min = min + self.max = max + + +class VirtualNetworkGatewayAutoScaleConfiguration(_serialization.Model): # pylint: disable=name-too-long + """Virtual Network Gateway Autoscale Configuration details. + + :ivar bounds: The bounds of the autoscale configuration. + :vartype bounds: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayAutoScaleBounds + """ + + _attribute_map = { + "bounds": {"key": "bounds", "type": "VirtualNetworkGatewayAutoScaleBounds"}, + } + + def __init__( + self, *, bounds: Optional["_models.VirtualNetworkGatewayAutoScaleBounds"] = None, **kwargs: Any + ) -> None: + """ + :keyword bounds: The bounds of the autoscale configuration. + :paramtype bounds: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayAutoScaleBounds + """ + super().__init__(**kwargs) + self.bounds = bounds + + +class VirtualNetworkGatewayConnection(Resource): # pylint: disable=too-many-instance-attributes + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar authorization_key: The authorizationKey. + :vartype authorization_key: str + :ivar virtual_network_gateway1: The reference to virtual network gateway resource. Required. + :vartype virtual_network_gateway1: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :ivar virtual_network_gateway2: The reference to virtual network gateway resource. + :vartype virtual_network_gateway2: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :ivar local_network_gateway2: The reference to local network gateway resource. + :vartype local_network_gateway2: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :ivar ingress_nat_rules: List of ingress NatRules. + :vartype ingress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar egress_nat_rules: List of egress NatRules. + :vartype egress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar connection_type: Gateway connection type. Required. Known values are: "IPsec", + "Vnet2Vnet", "ExpressRoute", and "VPNClient". + :vartype connection_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionType + :ivar connection_protocol: Connection protocol used for this connection. Known values are: + "IKEv2" and "IKEv1". + :vartype connection_protocol: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar routing_weight: The routing weight. + :vartype routing_weight: int + :ivar dpd_timeout_seconds: The dead peer detection timeout of this connection in seconds. + :vartype dpd_timeout_seconds: int + :ivar connection_mode: The connection mode for this connection. Known values are: "Default", + "ResponderOnly", and "InitiatorOnly". + :vartype connection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionMode + :ivar shared_key: The IPSec shared key. + :vartype shared_key: str + :ivar connection_status: Virtual Network Gateway connection status. Known values are: + "Unknown", "Connecting", "Connected", and "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2023_09_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this connection. + :vartype egress_bytes_transferred: int + :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. + :vartype ingress_bytes_transferred: int + :ivar peer: The reference to peerings resource. + :vartype peer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar enable_bgp: EnableBgp flag. + :vartype enable_bgp: bool + :ivar gateway_custom_bgp_ip_addresses: GatewayCustomBgpIpAddresses to be used for virtual + network gateway Connection. + :vartype gateway_custom_bgp_ip_addresses: + list[~azure.mgmt.network.v2023_09_01.models.GatewayCustomBgpIpAddressIpConfiguration] + :ivar use_local_azure_ip_address: Use private local Azure IP for the connection. + :vartype use_local_azure_ip_address: bool + :ivar use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :vartype use_policy_based_traffic_selectors: bool + :ivar ipsec_policies: The IPSec Policies to be considered by this connection. + :vartype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :ivar traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :vartype traffic_selector_policies: + list[~azure.mgmt.network.v2023_09_01.models.TrafficSelectorPolicy] + :ivar resource_guid: The resource GUID property of the virtual network gateway connection + resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :vartype express_route_gateway_bypass: bool + :ivar enable_private_link_fast_path: Bypass the ExpressRoute gateway when accessing + private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + :vartype enable_private_link_fast_path: bool + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "virtual_network_gateway1": {"required": True}, + "connection_type": {"required": True}, + "connection_status": {"readonly": True}, + "tunnel_connection_status": {"readonly": True}, + "egress_bytes_transferred": {"readonly": True}, + "ingress_bytes_transferred": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "virtual_network_gateway1": {"key": "properties.virtualNetworkGateway1", "type": "VirtualNetworkGateway"}, + "virtual_network_gateway2": {"key": "properties.virtualNetworkGateway2", "type": "VirtualNetworkGateway"}, + "local_network_gateway2": {"key": "properties.localNetworkGateway2", "type": "LocalNetworkGateway"}, + "ingress_nat_rules": {"key": "properties.ingressNatRules", "type": "[SubResource]"}, + "egress_nat_rules": {"key": "properties.egressNatRules", "type": "[SubResource]"}, + "connection_type": {"key": "properties.connectionType", "type": "str"}, + "connection_protocol": {"key": "properties.connectionProtocol", "type": "str"}, + "routing_weight": {"key": "properties.routingWeight", "type": "int"}, + "dpd_timeout_seconds": {"key": "properties.dpdTimeoutSeconds", "type": "int"}, + "connection_mode": {"key": "properties.connectionMode", "type": "str"}, + "shared_key": {"key": "properties.sharedKey", "type": "str"}, + "connection_status": {"key": "properties.connectionStatus", "type": "str"}, + "tunnel_connection_status": {"key": "properties.tunnelConnectionStatus", "type": "[TunnelConnectionHealth]"}, + "egress_bytes_transferred": {"key": "properties.egressBytesTransferred", "type": "int"}, + "ingress_bytes_transferred": {"key": "properties.ingressBytesTransferred", "type": "int"}, + "peer": {"key": "properties.peer", "type": "SubResource"}, + "enable_bgp": {"key": "properties.enableBgp", "type": "bool"}, + "gateway_custom_bgp_ip_addresses": { + "key": "properties.gatewayCustomBgpIpAddresses", + "type": "[GatewayCustomBgpIpAddressIpConfiguration]", + }, + "use_local_azure_ip_address": {"key": "properties.useLocalAzureIpAddress", "type": "bool"}, + "use_policy_based_traffic_selectors": {"key": "properties.usePolicyBasedTrafficSelectors", "type": "bool"}, + "ipsec_policies": {"key": "properties.ipsecPolicies", "type": "[IpsecPolicy]"}, + "traffic_selector_policies": {"key": "properties.trafficSelectorPolicies", "type": "[TrafficSelectorPolicy]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "express_route_gateway_bypass": {"key": "properties.expressRouteGatewayBypass", "type": "bool"}, + "enable_private_link_fast_path": {"key": "properties.enablePrivateLinkFastPath", "type": "bool"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + virtual_network_gateway1: "_models.VirtualNetworkGateway", + connection_type: Union[str, "_models.VirtualNetworkGatewayConnectionType"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + authorization_key: Optional[str] = None, + virtual_network_gateway2: Optional["_models.VirtualNetworkGateway"] = None, + local_network_gateway2: Optional["_models.LocalNetworkGateway"] = None, + ingress_nat_rules: Optional[List["_models.SubResource"]] = None, + egress_nat_rules: Optional[List["_models.SubResource"]] = None, + connection_protocol: Optional[Union[str, "_models.VirtualNetworkGatewayConnectionProtocol"]] = None, + routing_weight: Optional[int] = None, + dpd_timeout_seconds: Optional[int] = None, + connection_mode: Optional[Union[str, "_models.VirtualNetworkGatewayConnectionMode"]] = None, + shared_key: Optional[str] = None, + peer: Optional["_models.SubResource"] = None, + enable_bgp: Optional[bool] = None, + gateway_custom_bgp_ip_addresses: Optional[List["_models.GatewayCustomBgpIpAddressIpConfiguration"]] = None, + use_local_azure_ip_address: Optional[bool] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["_models.IpsecPolicy"]] = None, + traffic_selector_policies: Optional[List["_models.TrafficSelectorPolicy"]] = None, + express_route_gateway_bypass: Optional[bool] = None, + enable_private_link_fast_path: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword authorization_key: The authorizationKey. + :paramtype authorization_key: str + :keyword virtual_network_gateway1: The reference to virtual network gateway resource. Required. + :paramtype virtual_network_gateway1: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :keyword virtual_network_gateway2: The reference to virtual network gateway resource. + :paramtype virtual_network_gateway2: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :keyword local_network_gateway2: The reference to local network gateway resource. + :paramtype local_network_gateway2: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :keyword ingress_nat_rules: List of ingress NatRules. + :paramtype ingress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword egress_nat_rules: List of egress NatRules. + :paramtype egress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword connection_type: Gateway connection type. Required. Known values are: "IPsec", + "Vnet2Vnet", "ExpressRoute", and "VPNClient". + :paramtype connection_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionType + :keyword connection_protocol: Connection protocol used for this connection. Known values are: + "IKEv2" and "IKEv1". + :paramtype connection_protocol: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :keyword routing_weight: The routing weight. + :paramtype routing_weight: int + :keyword dpd_timeout_seconds: The dead peer detection timeout of this connection in seconds. + :paramtype dpd_timeout_seconds: int + :keyword connection_mode: The connection mode for this connection. Known values are: "Default", + "ResponderOnly", and "InitiatorOnly". + :paramtype connection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionMode + :keyword shared_key: The IPSec shared key. + :paramtype shared_key: str + :keyword peer: The reference to peerings resource. + :paramtype peer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword enable_bgp: EnableBgp flag. + :paramtype enable_bgp: bool + :keyword gateway_custom_bgp_ip_addresses: GatewayCustomBgpIpAddresses to be used for virtual + network gateway Connection. + :paramtype gateway_custom_bgp_ip_addresses: + list[~azure.mgmt.network.v2023_09_01.models.GatewayCustomBgpIpAddressIpConfiguration] + :keyword use_local_azure_ip_address: Use private local Azure IP for the connection. + :paramtype use_local_azure_ip_address: bool + :keyword use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :paramtype use_policy_based_traffic_selectors: bool + :keyword ipsec_policies: The IPSec Policies to be considered by this connection. + :paramtype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :keyword traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :paramtype traffic_selector_policies: + list[~azure.mgmt.network.v2023_09_01.models.TrafficSelectorPolicy] + :keyword express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :paramtype express_route_gateway_bypass: bool + :keyword enable_private_link_fast_path: Bypass the ExpressRoute gateway when accessing + private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + :paramtype enable_private_link_fast_path: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.ingress_nat_rules = ingress_nat_rules + self.egress_nat_rules = egress_nat_rules + self.connection_type = connection_type + self.connection_protocol = connection_protocol + self.routing_weight = routing_weight + self.dpd_timeout_seconds = dpd_timeout_seconds + self.connection_mode = connection_mode + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.gateway_custom_bgp_ip_addresses = gateway_custom_bgp_ip_addresses + self.use_local_azure_ip_address = use_local_azure_ip_address + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.traffic_selector_policies = traffic_selector_policies + self.resource_guid = None + self.provisioning_state = None + self.express_route_gateway_bypass = express_route_gateway_bypass + self.enable_private_link_fast_path = enable_private_link_fast_path + + +class VirtualNetworkGatewayConnectionListEntity(Resource): # pylint: disable=too-many-instance-attributes,name-too-long + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar authorization_key: The authorizationKey. + :vartype authorization_key: str + :ivar virtual_network_gateway1: The reference to virtual network gateway resource. Required. + :vartype virtual_network_gateway1: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkConnectionGatewayReference + :ivar virtual_network_gateway2: The reference to virtual network gateway resource. + :vartype virtual_network_gateway2: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkConnectionGatewayReference + :ivar local_network_gateway2: The reference to local network gateway resource. + :vartype local_network_gateway2: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkConnectionGatewayReference + :ivar connection_type: Gateway connection type. Required. Known values are: "IPsec", + "Vnet2Vnet", "ExpressRoute", and "VPNClient". + :vartype connection_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionType + :ivar connection_protocol: Connection protocol used for this connection. Known values are: + "IKEv2" and "IKEv1". + :vartype connection_protocol: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar routing_weight: The routing weight. + :vartype routing_weight: int + :ivar connection_mode: The connection mode for this connection. Known values are: "Default", + "ResponderOnly", and "InitiatorOnly". + :vartype connection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionMode + :ivar shared_key: The IPSec shared key. + :vartype shared_key: str + :ivar connection_status: Virtual Network Gateway connection status. Known values are: + "Unknown", "Connecting", "Connected", and "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2023_09_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this connection. + :vartype egress_bytes_transferred: int + :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. + :vartype ingress_bytes_transferred: int + :ivar peer: The reference to peerings resource. + :vartype peer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar enable_bgp: EnableBgp flag. + :vartype enable_bgp: bool + :ivar gateway_custom_bgp_ip_addresses: GatewayCustomBgpIpAddresses to be used for virtual + network gateway Connection. + :vartype gateway_custom_bgp_ip_addresses: + list[~azure.mgmt.network.v2023_09_01.models.GatewayCustomBgpIpAddressIpConfiguration] + :ivar use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :vartype use_policy_based_traffic_selectors: bool + :ivar ipsec_policies: The IPSec Policies to be considered by this connection. + :vartype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :ivar traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :vartype traffic_selector_policies: + list[~azure.mgmt.network.v2023_09_01.models.TrafficSelectorPolicy] + :ivar resource_guid: The resource GUID property of the virtual network gateway connection + resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway connection + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :vartype express_route_gateway_bypass: bool + :ivar enable_private_link_fast_path: Bypass the ExpressRoute gateway when accessing + private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + :vartype enable_private_link_fast_path: bool + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "virtual_network_gateway1": {"required": True}, + "connection_type": {"required": True}, + "connection_status": {"readonly": True}, + "tunnel_connection_status": {"readonly": True}, + "egress_bytes_transferred": {"readonly": True}, + "ingress_bytes_transferred": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, + "virtual_network_gateway1": { + "key": "properties.virtualNetworkGateway1", + "type": "VirtualNetworkConnectionGatewayReference", + }, + "virtual_network_gateway2": { + "key": "properties.virtualNetworkGateway2", + "type": "VirtualNetworkConnectionGatewayReference", + }, + "local_network_gateway2": { + "key": "properties.localNetworkGateway2", + "type": "VirtualNetworkConnectionGatewayReference", + }, + "connection_type": {"key": "properties.connectionType", "type": "str"}, + "connection_protocol": {"key": "properties.connectionProtocol", "type": "str"}, + "routing_weight": {"key": "properties.routingWeight", "type": "int"}, + "connection_mode": {"key": "properties.connectionMode", "type": "str"}, + "shared_key": {"key": "properties.sharedKey", "type": "str"}, + "connection_status": {"key": "properties.connectionStatus", "type": "str"}, + "tunnel_connection_status": {"key": "properties.tunnelConnectionStatus", "type": "[TunnelConnectionHealth]"}, + "egress_bytes_transferred": {"key": "properties.egressBytesTransferred", "type": "int"}, + "ingress_bytes_transferred": {"key": "properties.ingressBytesTransferred", "type": "int"}, + "peer": {"key": "properties.peer", "type": "SubResource"}, + "enable_bgp": {"key": "properties.enableBgp", "type": "bool"}, + "gateway_custom_bgp_ip_addresses": { + "key": "properties.gatewayCustomBgpIpAddresses", + "type": "[GatewayCustomBgpIpAddressIpConfiguration]", + }, + "use_policy_based_traffic_selectors": {"key": "properties.usePolicyBasedTrafficSelectors", "type": "bool"}, + "ipsec_policies": {"key": "properties.ipsecPolicies", "type": "[IpsecPolicy]"}, + "traffic_selector_policies": {"key": "properties.trafficSelectorPolicies", "type": "[TrafficSelectorPolicy]"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "express_route_gateway_bypass": {"key": "properties.expressRouteGatewayBypass", "type": "bool"}, + "enable_private_link_fast_path": {"key": "properties.enablePrivateLinkFastPath", "type": "bool"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + virtual_network_gateway1: "_models.VirtualNetworkConnectionGatewayReference", + connection_type: Union[str, "_models.VirtualNetworkGatewayConnectionType"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + authorization_key: Optional[str] = None, + virtual_network_gateway2: Optional["_models.VirtualNetworkConnectionGatewayReference"] = None, + local_network_gateway2: Optional["_models.VirtualNetworkConnectionGatewayReference"] = None, + connection_protocol: Optional[Union[str, "_models.VirtualNetworkGatewayConnectionProtocol"]] = None, + routing_weight: Optional[int] = None, + connection_mode: Optional[Union[str, "_models.VirtualNetworkGatewayConnectionMode"]] = None, + shared_key: Optional[str] = None, + peer: Optional["_models.SubResource"] = None, + enable_bgp: Optional[bool] = None, + gateway_custom_bgp_ip_addresses: Optional[List["_models.GatewayCustomBgpIpAddressIpConfiguration"]] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["_models.IpsecPolicy"]] = None, + traffic_selector_policies: Optional[List["_models.TrafficSelectorPolicy"]] = None, + express_route_gateway_bypass: Optional[bool] = None, + enable_private_link_fast_path: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword authorization_key: The authorizationKey. + :paramtype authorization_key: str + :keyword virtual_network_gateway1: The reference to virtual network gateway resource. Required. + :paramtype virtual_network_gateway1: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkConnectionGatewayReference + :keyword virtual_network_gateway2: The reference to virtual network gateway resource. + :paramtype virtual_network_gateway2: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkConnectionGatewayReference + :keyword local_network_gateway2: The reference to local network gateway resource. + :paramtype local_network_gateway2: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkConnectionGatewayReference + :keyword connection_type: Gateway connection type. Required. Known values are: "IPsec", + "Vnet2Vnet", "ExpressRoute", and "VPNClient". + :paramtype connection_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionType + :keyword connection_protocol: Connection protocol used for this connection. Known values are: + "IKEv2" and "IKEv1". + :paramtype connection_protocol: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :keyword routing_weight: The routing weight. + :paramtype routing_weight: int + :keyword connection_mode: The connection mode for this connection. Known values are: "Default", + "ResponderOnly", and "InitiatorOnly". + :paramtype connection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionMode + :keyword shared_key: The IPSec shared key. + :paramtype shared_key: str + :keyword peer: The reference to peerings resource. + :paramtype peer: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword enable_bgp: EnableBgp flag. + :paramtype enable_bgp: bool + :keyword gateway_custom_bgp_ip_addresses: GatewayCustomBgpIpAddresses to be used for virtual + network gateway Connection. + :paramtype gateway_custom_bgp_ip_addresses: + list[~azure.mgmt.network.v2023_09_01.models.GatewayCustomBgpIpAddressIpConfiguration] + :keyword use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :paramtype use_policy_based_traffic_selectors: bool + :keyword ipsec_policies: The IPSec Policies to be considered by this connection. + :paramtype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :keyword traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :paramtype traffic_selector_policies: + list[~azure.mgmt.network.v2023_09_01.models.TrafficSelectorPolicy] + :keyword express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :paramtype express_route_gateway_bypass: bool + :keyword enable_private_link_fast_path: Bypass the ExpressRoute gateway when accessing + private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + :paramtype enable_private_link_fast_path: bool + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.connection_protocol = connection_protocol + self.routing_weight = routing_weight + self.connection_mode = connection_mode + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.gateway_custom_bgp_ip_addresses = gateway_custom_bgp_ip_addresses + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.traffic_selector_policies = traffic_selector_policies + self.resource_guid = None + self.provisioning_state = None + self.express_route_gateway_bypass = express_route_gateway_bypass + self.enable_private_link_fast_path = enable_private_link_fast_path + + +class VirtualNetworkGatewayConnectionListResult(_serialization.Model): # pylint: disable=name-too-long + """Response for the ListVirtualNetworkGatewayConnections API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkGatewayConnection]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VirtualNetworkGatewayConnection"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar private_ip_allocation_method: The private IP address allocation method. Known values are: + "Static" and "Dynamic". + :vartype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :ivar subnet: The reference to the subnet resource. + :vartype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar public_ip_address: The reference to the public IP resource. + :vartype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar private_ip_address: Private IP Address for this gateway. + :vartype private_ip_address: str + :ivar provisioning_state: The provisioning state of the virtual network gateway IP + configuration resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "private_ip_allocation_method": {"key": "properties.privateIPAllocationMethod", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "SubResource"}, + "public_ip_address": {"key": "properties.publicIPAddress", "type": "SubResource"}, + "private_ip_address": {"key": "properties.privateIPAddress", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "_models.IPAllocationMethod"]] = None, + subnet: Optional["_models.SubResource"] = None, + public_ip_address: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword private_ip_allocation_method: The private IP address allocation method. Known values + are: "Static" and "Dynamic". + :paramtype private_ip_allocation_method: str or + ~azure.mgmt.network.v2023_09_01.models.IPAllocationMethod + :keyword subnet: The reference to the subnet resource. + :paramtype subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword public_ip_address: The reference to the public IP resource. + :paramtype public_ip_address: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.private_ip_address = None + self.provisioning_state = None + + +class VirtualNetworkGatewayListConnectionsResult(_serialization.Model): # pylint: disable=name-too-long + """Response for the VirtualNetworkGatewayListConnections API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :vartype value: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionListEntity] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkGatewayConnectionListEntity]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VirtualNetworkGatewayConnectionListEntity"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :paramtype value: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionListEntity] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkGatewayListResult(_serialization.Model): + """Response for the ListVirtualNetworkGateways API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of VirtualNetworkGateway resources that exists in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkGateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.VirtualNetworkGateway"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of VirtualNetworkGateway resources that exists in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkGatewayNatRule(SubResource): + """VirtualNetworkGatewayNatRule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: The provisioning state of the NAT Rule resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar type_properties_type: The type of NAT rule for VPN NAT. Known values are: "Static" and + "Dynamic". + :vartype type_properties_type: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleType + :ivar mode: The Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and + "IngressSnat". + :vartype mode: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMode + :ivar internal_mappings: The private IP address internal mapping for NAT. + :vartype internal_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :ivar external_mappings: The private IP address external mapping for NAT. + :vartype external_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :ivar ip_configuration_id: The IP Configuration ID this NAT rule applies to. + :vartype ip_configuration_id: str + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "mode": {"key": "properties.mode", "type": "str"}, + "internal_mappings": {"key": "properties.internalMappings", "type": "[VpnNatRuleMapping]"}, + "external_mappings": {"key": "properties.externalMappings", "type": "[VpnNatRuleMapping]"}, + "ip_configuration_id": {"key": "properties.ipConfigurationId", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type_properties_type: Optional[Union[str, "_models.VpnNatRuleType"]] = None, + mode: Optional[Union[str, "_models.VpnNatRuleMode"]] = None, + internal_mappings: Optional[List["_models.VpnNatRuleMapping"]] = None, + external_mappings: Optional[List["_models.VpnNatRuleMapping"]] = None, + ip_configuration_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type_properties_type: The type of NAT rule for VPN NAT. Known values are: "Static" and + "Dynamic". + :paramtype type_properties_type: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleType + :keyword mode: The Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and + "IngressSnat". + :paramtype mode: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMode + :keyword internal_mappings: The private IP address internal mapping for NAT. + :paramtype internal_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :keyword external_mappings: The private IP address external mapping for NAT. + :paramtype external_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :keyword ip_configuration_id: The IP Configuration ID this NAT rule applies to. + :paramtype ip_configuration_id: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.provisioning_state = None + self.type_properties_type = type_properties_type + self.mode = mode + self.internal_mappings = internal_mappings + self.external_mappings = external_mappings + self.ip_configuration_id = ip_configuration_id + + +class VirtualNetworkGatewayPolicyGroup(SubResource): + """Parameters for VirtualNetworkGatewayPolicyGroup. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar is_default: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + :vartype is_default: bool + :ivar priority: Priority for VirtualNetworkGatewayPolicyGroup. + :vartype priority: int + :ivar policy_members: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + :vartype policy_members: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayPolicyGroupMember] + :ivar vng_client_connection_configurations: List of references to + vngClientConnectionConfigurations. + :vartype vng_client_connection_configurations: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the VirtualNetworkGatewayPolicyGroup + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "vng_client_connection_configurations": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "is_default": {"key": "properties.isDefault", "type": "bool"}, + "priority": {"key": "properties.priority", "type": "int"}, + "policy_members": {"key": "properties.policyMembers", "type": "[VirtualNetworkGatewayPolicyGroupMember]"}, + "vng_client_connection_configurations": { + "key": "properties.vngClientConnectionConfigurations", + "type": "[SubResource]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + is_default: Optional[bool] = None, + priority: Optional[int] = None, + policy_members: Optional[List["_models.VirtualNetworkGatewayPolicyGroupMember"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword is_default: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + :paramtype is_default: bool + :keyword priority: Priority for VirtualNetworkGatewayPolicyGroup. + :paramtype priority: int + :keyword policy_members: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + :paramtype policy_members: + list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayPolicyGroupMember] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.is_default = is_default + self.priority = priority + self.policy_members = policy_members + self.vng_client_connection_configurations = None + self.provisioning_state = None + + +class VirtualNetworkGatewayPolicyGroupMember(_serialization.Model): + """Vpn Client Connection configuration PolicyGroup member. + + :ivar name: Name of the VirtualNetworkGatewayPolicyGroupMember. + :vartype name: str + :ivar attribute_type: The Vpn Policy member attribute type. Known values are: + "CertificateGroupId", "AADGroupId", and "RadiusAzureGroupId". + :vartype attribute_type: str or + ~azure.mgmt.network.v2023_09_01.models.VpnPolicyMemberAttributeType + :ivar attribute_value: The value of Attribute used for this + VirtualNetworkGatewayPolicyGroupMember. + :vartype attribute_value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "attribute_type": {"key": "attributeType", "type": "str"}, + "attribute_value": {"key": "attributeValue", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + attribute_type: Optional[Union[str, "_models.VpnPolicyMemberAttributeType"]] = None, + attribute_value: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the VirtualNetworkGatewayPolicyGroupMember. + :paramtype name: str + :keyword attribute_type: The Vpn Policy member attribute type. Known values are: + "CertificateGroupId", "AADGroupId", and "RadiusAzureGroupId". + :paramtype attribute_type: str or + ~azure.mgmt.network.v2023_09_01.models.VpnPolicyMemberAttributeType + :keyword attribute_value: The value of Attribute used for this + VirtualNetworkGatewayPolicyGroupMember. + :paramtype attribute_value: str + """ + super().__init__(**kwargs) + self.name = name + self.attribute_type = attribute_type + self.attribute_value = attribute_value + + +class VirtualNetworkGatewaySku(_serialization.Model): + """VirtualNetworkGatewaySku details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Gateway SKU name. Known values are: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ", and "ErGwScale". + :vartype name: str or ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewaySkuName + :ivar tier: Gateway SKU tier. Known values are: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ", and "ErGwScale". + :vartype tier: str or ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewaySkuTier + :ivar capacity: The capacity. + :vartype capacity: int + """ + + _validation = { + "capacity": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.VirtualNetworkGatewaySkuName"]] = None, + tier: Optional[Union[str, "_models.VirtualNetworkGatewaySkuTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Gateway SKU name. Known values are: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ", and "ErGwScale". + :paramtype name: str or ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewaySkuName + :keyword tier: Gateway SKU tier. Known values are: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ", and "ErGwScale". + :paramtype tier: str or ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewaySkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = None + + +class VirtualNetworkListResult(_serialization.Model): + """Response for the ListVirtualNetworks API service call. + + :ivar value: A list of VirtualNetwork resources in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetwork]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VirtualNetwork"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: A list of VirtualNetwork resources in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkListUsageResult(_serialization.Model): + """Response for the virtual networks GetUsage API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: VirtualNetwork usage stats. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkUsage] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkUsage]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class VirtualNetworkPeering(SubResource): # pylint: disable=too-many-instance-attributes + """Peerings in a virtual network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar allow_virtual_network_access: Whether the VMs in the local virtual network space would be + able to access the VMs in remote virtual network space. + :vartype allow_virtual_network_access: bool + :ivar allow_forwarded_traffic: Whether the forwarded traffic from the VMs in the local virtual + network will be allowed/disallowed in remote virtual network. + :vartype allow_forwarded_traffic: bool + :ivar allow_gateway_transit: If gateway links can be used in remote virtual networking to link + to this virtual network. + :vartype allow_gateway_transit: bool + :ivar use_remote_gateways: If remote gateways can be used on this virtual network. If the flag + is set to true, and allowGatewayTransit on remote peering is also true, virtual network will + use gateways of remote virtual network for transit. Only one peering can have this flag set to + true. This flag cannot be set if virtual network already has a gateway. + :vartype use_remote_gateways: bool + :ivar remote_virtual_network: The reference to the remote virtual network. The remote virtual + network can be in the same or different region (preview). See here to register for the preview + and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :vartype remote_virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar remote_address_space: The reference to the address space peered with the remote virtual + network. + :vartype remote_address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar remote_virtual_network_address_space: The reference to the current address space of the + remote virtual network. + :vartype remote_virtual_network_address_space: + ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar remote_bgp_communities: The reference to the remote virtual network's Bgp Communities. + :vartype remote_bgp_communities: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkBgpCommunities + :ivar remote_virtual_network_encryption: The reference to the remote virtual network's + encryption. + :vartype remote_virtual_network_encryption: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkEncryption + :ivar peering_state: The status of the virtual network peering. Known values are: "Initiated", + "Connected", and "Disconnected". + :vartype peering_state: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeeringState + :ivar peering_sync_level: The peering sync status of the virtual network peering. Known values + are: "FullyInSync", "RemoteNotInSync", "LocalNotInSync", and "LocalAndRemoteNotInSync". + :vartype peering_sync_level: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeeringLevel + :ivar provisioning_state: The provisioning state of the virtual network peering resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar do_not_verify_remote_gateways: If we need to verify the provisioning state of the remote + gateway. + :vartype do_not_verify_remote_gateways: bool + :ivar resource_guid: The resourceGuid property of the Virtual Network peering resource. + :vartype resource_guid: str + """ + + _validation = { + "etag": {"readonly": True}, + "remote_virtual_network_encryption": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_guid": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "allow_virtual_network_access": {"key": "properties.allowVirtualNetworkAccess", "type": "bool"}, + "allow_forwarded_traffic": {"key": "properties.allowForwardedTraffic", "type": "bool"}, + "allow_gateway_transit": {"key": "properties.allowGatewayTransit", "type": "bool"}, + "use_remote_gateways": {"key": "properties.useRemoteGateways", "type": "bool"}, + "remote_virtual_network": {"key": "properties.remoteVirtualNetwork", "type": "SubResource"}, + "remote_address_space": {"key": "properties.remoteAddressSpace", "type": "AddressSpace"}, + "remote_virtual_network_address_space": { + "key": "properties.remoteVirtualNetworkAddressSpace", + "type": "AddressSpace", + }, + "remote_bgp_communities": {"key": "properties.remoteBgpCommunities", "type": "VirtualNetworkBgpCommunities"}, + "remote_virtual_network_encryption": { + "key": "properties.remoteVirtualNetworkEncryption", + "type": "VirtualNetworkEncryption", + }, + "peering_state": {"key": "properties.peeringState", "type": "str"}, + "peering_sync_level": {"key": "properties.peeringSyncLevel", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "do_not_verify_remote_gateways": {"key": "properties.doNotVerifyRemoteGateways", "type": "bool"}, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + allow_virtual_network_access: Optional[bool] = None, + allow_forwarded_traffic: Optional[bool] = None, + allow_gateway_transit: Optional[bool] = None, + use_remote_gateways: Optional[bool] = None, + remote_virtual_network: Optional["_models.SubResource"] = None, + remote_address_space: Optional["_models.AddressSpace"] = None, + remote_virtual_network_address_space: Optional["_models.AddressSpace"] = None, + remote_bgp_communities: Optional["_models.VirtualNetworkBgpCommunities"] = None, + peering_state: Optional[Union[str, "_models.VirtualNetworkPeeringState"]] = None, + peering_sync_level: Optional[Union[str, "_models.VirtualNetworkPeeringLevel"]] = None, + do_not_verify_remote_gateways: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type: Resource type. + :paramtype type: str + :keyword allow_virtual_network_access: Whether the VMs in the local virtual network space would + be able to access the VMs in remote virtual network space. + :paramtype allow_virtual_network_access: bool + :keyword allow_forwarded_traffic: Whether the forwarded traffic from the VMs in the local + virtual network will be allowed/disallowed in remote virtual network. + :paramtype allow_forwarded_traffic: bool + :keyword allow_gateway_transit: If gateway links can be used in remote virtual networking to + link to this virtual network. + :paramtype allow_gateway_transit: bool + :keyword use_remote_gateways: If remote gateways can be used on this virtual network. If the + flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network + will use gateways of remote virtual network for transit. Only one peering can have this flag + set to true. This flag cannot be set if virtual network already has a gateway. + :paramtype use_remote_gateways: bool + :keyword remote_virtual_network: The reference to the remote virtual network. The remote + virtual network can be in the same or different region (preview). See here to register for the + preview and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :paramtype remote_virtual_network: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword remote_address_space: The reference to the address space peered with the remote + virtual network. + :paramtype remote_address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword remote_virtual_network_address_space: The reference to the current address space of + the remote virtual network. + :paramtype remote_virtual_network_address_space: + ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword remote_bgp_communities: The reference to the remote virtual network's Bgp Communities. + :paramtype remote_bgp_communities: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkBgpCommunities + :keyword peering_state: The status of the virtual network peering. Known values are: + "Initiated", "Connected", and "Disconnected". + :paramtype peering_state: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeeringState + :keyword peering_sync_level: The peering sync status of the virtual network peering. Known + values are: "FullyInSync", "RemoteNotInSync", "LocalNotInSync", and "LocalAndRemoteNotInSync". + :paramtype peering_sync_level: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeeringLevel + :keyword do_not_verify_remote_gateways: If we need to verify the provisioning state of the + remote gateway. + :paramtype do_not_verify_remote_gateways: bool + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = type + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.remote_address_space = remote_address_space + self.remote_virtual_network_address_space = remote_virtual_network_address_space + self.remote_bgp_communities = remote_bgp_communities + self.remote_virtual_network_encryption = None + self.peering_state = peering_state + self.peering_sync_level = peering_sync_level + self.provisioning_state = None + self.do_not_verify_remote_gateways = do_not_verify_remote_gateways + self.resource_guid = None + + +class VirtualNetworkPeeringListResult(_serialization.Model): + """Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual + network. + + :ivar value: The peerings in a virtual network. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkPeering]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualNetworkPeering"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The peerings in a virtual network. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkTap(Resource): # pylint: disable=too-many-instance-attributes + """Virtual Network Tap resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar network_interface_tap_configurations: Specifies the list of resource IDs for the network + interface IP configuration that needs to be tapped. + :vartype network_interface_tap_configurations: + list[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :ivar resource_guid: The resource GUID property of the virtual network tap resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network tap resource. Known + values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar destination_network_interface_ip_configuration: The reference to the private IP Address + of the collector nic that will receive the tap. + :vartype destination_network_interface_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :ivar destination_load_balancer_front_end_ip_configuration: The reference to the private IP + address on the internal Load Balancer that will receive the tap. + :vartype destination_load_balancer_front_end_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration + :ivar destination_port: The VXLAN destination port that will receive the tapped traffic. + :vartype destination_port: int + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "network_interface_tap_configurations": {"readonly": True}, + "resource_guid": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "network_interface_tap_configurations": { + "key": "properties.networkInterfaceTapConfigurations", + "type": "[NetworkInterfaceTapConfiguration]", + }, + "resource_guid": {"key": "properties.resourceGuid", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "destination_network_interface_ip_configuration": { + "key": "properties.destinationNetworkInterfaceIPConfiguration", + "type": "NetworkInterfaceIPConfiguration", + }, + "destination_load_balancer_front_end_ip_configuration": { + "key": "properties.destinationLoadBalancerFrontEndIPConfiguration", + "type": "FrontendIPConfiguration", + }, + "destination_port": {"key": "properties.destinationPort", "type": "int"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + destination_network_interface_ip_configuration: Optional["_models.NetworkInterfaceIPConfiguration"] = None, + destination_load_balancer_front_end_ip_configuration: Optional["_models.FrontendIPConfiguration"] = None, + destination_port: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword destination_network_interface_ip_configuration: The reference to the private IP + Address of the collector nic that will receive the tap. + :paramtype destination_network_interface_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :keyword destination_load_balancer_front_end_ip_configuration: The reference to the private IP + address on the internal Load Balancer that will receive the tap. + :paramtype destination_load_balancer_front_end_ip_configuration: + ~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration + :keyword destination_port: The VXLAN destination port that will receive the tapped traffic. + :paramtype destination_port: int + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.network_interface_tap_configurations = None + self.resource_guid = None + self.provisioning_state = None + self.destination_network_interface_ip_configuration = destination_network_interface_ip_configuration + self.destination_load_balancer_front_end_ip_configuration = destination_load_balancer_front_end_ip_configuration + self.destination_port = destination_port + + +class VirtualNetworkTapListResult(_serialization.Model): + """Response for ListVirtualNetworkTap API service call. + + :ivar value: A list of VirtualNetworkTaps in a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualNetworkTap]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualNetworkTap"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: A list of VirtualNetworkTaps in a resource group. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :keyword next_link: The URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkUsage(_serialization.Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count'. + :vartype unit: str + """ + + _validation = { + "current_value": {"readonly": True}, + "id": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + "unit": {"readonly": True}, + } + + _attribute_map = { + "current_value": {"key": "currentValue", "type": "float"}, + "id": {"key": "id", "type": "str"}, + "limit": {"key": "limit", "type": "float"}, + "name": {"key": "name", "type": "VirtualNetworkUsageName"}, + "unit": {"key": "unit", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None + + +class VirtualNetworkUsageName(_serialization.Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + "localized_value": {"readonly": True}, + "value": {"readonly": True}, + } + + _attribute_map = { + "localized_value": {"key": "localizedValue", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.localized_value = None + self.value = None + + +class VirtualRouter(Resource): # pylint: disable=too-many-instance-attributes + """VirtualRouter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_router_asn: VirtualRouter ASN. + :vartype virtual_router_asn: int + :ivar virtual_router_ips: VirtualRouter IPs. + :vartype virtual_router_ips: list[str] + :ivar hosted_subnet: The Subnet on which VirtualRouter is hosted. + :vartype hosted_subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar hosted_gateway: The Gateway on which VirtualRouter is hosted. + :vartype hosted_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "virtual_router_asn": {"maximum": 4294967295, "minimum": 0}, + "peerings": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "virtual_router_asn": {"key": "properties.virtualRouterAsn", "type": "int"}, + "virtual_router_ips": {"key": "properties.virtualRouterIps", "type": "[str]"}, + "hosted_subnet": {"key": "properties.hostedSubnet", "type": "SubResource"}, + "hosted_gateway": {"key": "properties.hostedGateway", "type": "SubResource"}, + "peerings": {"key": "properties.peerings", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_router_asn: Optional[int] = None, + virtual_router_ips: Optional[List[str]] = None, + hosted_subnet: Optional["_models.SubResource"] = None, + hosted_gateway: Optional["_models.SubResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword virtual_router_asn: VirtualRouter ASN. + :paramtype virtual_router_asn: int + :keyword virtual_router_ips: VirtualRouter IPs. + :paramtype virtual_router_ips: list[str] + :keyword hosted_subnet: The Subnet on which VirtualRouter is hosted. + :paramtype hosted_subnet: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword hosted_gateway: The Gateway on which VirtualRouter is hosted. + :paramtype hosted_gateway: ~azure.mgmt.network.v2023_09_01.models.SubResource + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_router_asn = virtual_router_asn + self.virtual_router_ips = virtual_router_ips + self.hosted_subnet = hosted_subnet + self.hosted_gateway = hosted_gateway + self.peerings = None + self.provisioning_state = None + + +class VirtualRouterAutoScaleConfiguration(_serialization.Model): + """The VirtualHub Router autoscale configuration. + + :ivar min_capacity: The minimum number of scale units for VirtualHub Router. + :vartype min_capacity: int + """ + + _validation = { + "min_capacity": {"minimum": 0}, + } + + _attribute_map = { + "min_capacity": {"key": "minCapacity", "type": "int"}, + } + + def __init__(self, *, min_capacity: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword min_capacity: The minimum number of scale units for VirtualHub Router. + :paramtype min_capacity: int + """ + super().__init__(**kwargs) + self.min_capacity = min_capacity + + +class VirtualRouterListResult(_serialization.Model): + """Response for ListVirtualRouters API service call. + + :ivar value: List of Virtual Routers. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualRouter]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.VirtualRouter"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of Virtual Routers. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualRouterPeering(SubResource): + """Virtual Router Peering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Name of the virtual router peering that is unique within a virtual router. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Peering type. + :vartype type: str + :ivar peer_asn: Peer ASN. + :vartype peer_asn: int + :ivar peer_ip: Peer IP. + :vartype peer_ip: str + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "peer_asn": {"maximum": 4294967295, "minimum": 0}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "peer_asn": {"key": "properties.peerAsn", "type": "int"}, + "peer_ip": {"key": "properties.peerIp", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + peer_asn: Optional[int] = None, + peer_ip: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: Name of the virtual router peering that is unique within a virtual router. + :paramtype name: str + :keyword peer_asn: Peer ASN. + :paramtype peer_asn: int + :keyword peer_ip: Peer IP. + :paramtype peer_ip: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.peer_asn = peer_asn + self.peer_ip = peer_ip + self.provisioning_state = None + + +class VirtualRouterPeeringListResult(_serialization.Model): + """Response for ListVirtualRouterPeerings API service call. + + :ivar value: List of VirtualRouterPeerings in a VirtualRouter. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualRouterPeering]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualRouterPeering"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of VirtualRouterPeerings in a VirtualRouter. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualWAN(Resource): # pylint: disable=too-many-instance-attributes + """VirtualWAN Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar disable_vpn_encryption: Vpn encryption to be disabled or not. + :vartype disable_vpn_encryption: bool + :ivar virtual_hubs: List of VirtualHubs in the VirtualWAN. + :vartype virtual_hubs: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar allow_branch_to_branch_traffic: True if branch to branch traffic is allowed. + :vartype allow_branch_to_branch_traffic: bool + :ivar allow_vnet_to_vnet_traffic: True if Vnet to Vnet traffic is allowed. + :vartype allow_vnet_to_vnet_traffic: bool + :ivar office365_local_breakout_category: The office local breakout category. Known values are: + "Optimize", "OptimizeAndAllow", "All", and "None". + :vartype office365_local_breakout_category: str or + ~azure.mgmt.network.v2023_09_01.models.OfficeTrafficCategory + :ivar provisioning_state: The provisioning state of the virtual WAN resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar type_properties_type: The type of the VirtualWAN. + :vartype type_properties_type: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "virtual_hubs": {"readonly": True}, + "vpn_sites": {"readonly": True}, + "office365_local_breakout_category": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "disable_vpn_encryption": {"key": "properties.disableVpnEncryption", "type": "bool"}, + "virtual_hubs": {"key": "properties.virtualHubs", "type": "[SubResource]"}, + "vpn_sites": {"key": "properties.vpnSites", "type": "[SubResource]"}, + "allow_branch_to_branch_traffic": {"key": "properties.allowBranchToBranchTraffic", "type": "bool"}, + "allow_vnet_to_vnet_traffic": {"key": "properties.allowVnetToVnetTraffic", "type": "bool"}, + "office365_local_breakout_category": {"key": "properties.office365LocalBreakoutCategory", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + disable_vpn_encryption: Optional[bool] = None, + allow_branch_to_branch_traffic: Optional[bool] = None, + allow_vnet_to_vnet_traffic: Optional[bool] = None, + type_properties_type: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword disable_vpn_encryption: Vpn encryption to be disabled or not. + :paramtype disable_vpn_encryption: bool + :keyword allow_branch_to_branch_traffic: True if branch to branch traffic is allowed. + :paramtype allow_branch_to_branch_traffic: bool + :keyword allow_vnet_to_vnet_traffic: True if Vnet to Vnet traffic is allowed. + :paramtype allow_vnet_to_vnet_traffic: bool + :keyword type_properties_type: The type of the VirtualWAN. + :paramtype type_properties_type: str + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.disable_vpn_encryption = disable_vpn_encryption + self.virtual_hubs = None + self.vpn_sites = None + self.allow_branch_to_branch_traffic = allow_branch_to_branch_traffic + self.allow_vnet_to_vnet_traffic = allow_vnet_to_vnet_traffic + self.office365_local_breakout_category = None + self.provisioning_state = None + self.type_properties_type = type_properties_type + + +class VirtualWanSecurityProvider(_serialization.Model): + """Collection of SecurityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the security provider. + :vartype name: str + :ivar url: Url of the security provider. + :vartype url: str + :ivar type: Name of the security provider. Known values are: "External" and "Native". + :vartype type: str or ~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProviderType + """ + + _validation = { + "type": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "url": {"key": "url", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the security provider. + :paramtype name: str + :keyword url: Url of the security provider. + :paramtype url: str + """ + super().__init__(**kwargs) + self.name = name + self.url = url + self.type = None + + +class VirtualWanSecurityProviders(_serialization.Model): + """Collection of SecurityProviders. + + :ivar supported_providers: List of VirtualWAN security providers. + :vartype supported_providers: + list[~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProvider] + """ + + _attribute_map = { + "supported_providers": {"key": "supportedProviders", "type": "[VirtualWanSecurityProvider]"}, + } + + def __init__( + self, *, supported_providers: Optional[List["_models.VirtualWanSecurityProvider"]] = None, **kwargs: Any + ) -> None: + """ + :keyword supported_providers: List of VirtualWAN security providers. + :paramtype supported_providers: + list[~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProvider] + """ + super().__init__(**kwargs) + self.supported_providers = supported_providers + + +class VirtualWanVpnProfileParameters(_serialization.Model): + """Virtual Wan Vpn profile parameters Vpn profile generation. + + :ivar vpn_server_configuration_resource_id: VpnServerConfiguration partial resource uri with + which VirtualWan is associated to. + :vartype vpn_server_configuration_resource_id: str + :ivar authentication_method: VPN client authentication method. Known values are: "EAPTLS" and + "EAPMSCHAPv2". + :vartype authentication_method: str or + ~azure.mgmt.network.v2023_09_01.models.AuthenticationMethod + """ + + _attribute_map = { + "vpn_server_configuration_resource_id": {"key": "vpnServerConfigurationResourceId", "type": "str"}, + "authentication_method": {"key": "authenticationMethod", "type": "str"}, + } + + def __init__( + self, + *, + vpn_server_configuration_resource_id: Optional[str] = None, + authentication_method: Optional[Union[str, "_models.AuthenticationMethod"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword vpn_server_configuration_resource_id: VpnServerConfiguration partial resource uri with + which VirtualWan is associated to. + :paramtype vpn_server_configuration_resource_id: str + :keyword authentication_method: VPN client authentication method. Known values are: "EAPTLS" + and "EAPMSCHAPv2". + :paramtype authentication_method: str or + ~azure.mgmt.network.v2023_09_01.models.AuthenticationMethod + """ + super().__init__(**kwargs) + self.vpn_server_configuration_resource_id = vpn_server_configuration_resource_id + self.authentication_method = authentication_method + + +class VM(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + +class VnetRoute(_serialization.Model): + """List of routes that control routing from VirtualHub into a virtual network connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar static_routes_config: Configuration for static routes on this HubVnetConnection. + :vartype static_routes_config: ~azure.mgmt.network.v2023_09_01.models.StaticRoutesConfig + :ivar static_routes: List of all Static Routes. + :vartype static_routes: list[~azure.mgmt.network.v2023_09_01.models.StaticRoute] + :ivar bgp_connections: The list of references to HubBgpConnection objects. + :vartype bgp_connections: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "bgp_connections": {"readonly": True}, + } + + _attribute_map = { + "static_routes_config": {"key": "staticRoutesConfig", "type": "StaticRoutesConfig"}, + "static_routes": {"key": "staticRoutes", "type": "[StaticRoute]"}, + "bgp_connections": {"key": "bgpConnections", "type": "[SubResource]"}, + } + + def __init__( + self, + *, + static_routes_config: Optional["_models.StaticRoutesConfig"] = None, + static_routes: Optional[List["_models.StaticRoute"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword static_routes_config: Configuration for static routes on this HubVnetConnection. + :paramtype static_routes_config: ~azure.mgmt.network.v2023_09_01.models.StaticRoutesConfig + :keyword static_routes: List of all Static Routes. + :paramtype static_routes: list[~azure.mgmt.network.v2023_09_01.models.StaticRoute] + """ + super().__init__(**kwargs) + self.static_routes_config = static_routes_config + self.static_routes = static_routes + self.bgp_connections = None + + +class VngClientConnectionConfiguration(SubResource): + """A vpn client connection configuration for client connection configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :vartype vpn_client_address_pool: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar virtual_network_gateway_policy_groups: List of references to + virtualNetworkGatewayPolicyGroups. + :vartype virtual_network_gateway_policy_groups: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the VngClientConnectionConfiguration + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "vpn_client_address_pool": {"key": "properties.vpnClientAddressPool", "type": "AddressSpace"}, + "virtual_network_gateway_policy_groups": { + "key": "properties.virtualNetworkGatewayPolicyGroups", + "type": "[SubResource]", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + vpn_client_address_pool: Optional["_models.AddressSpace"] = None, + virtual_network_gateway_policy_groups: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :paramtype vpn_client_address_pool: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword virtual_network_gateway_policy_groups: List of references to + virtualNetworkGatewayPolicyGroups. + :paramtype virtual_network_gateway_policy_groups: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.vpn_client_address_pool = vpn_client_address_pool + self.virtual_network_gateway_policy_groups = virtual_network_gateway_policy_groups + self.provisioning_state = None + + +class VpnClientConfiguration(_serialization.Model): # pylint: disable=too-many-instance-attributes + """VpnClientConfiguration for P2S client. + + :ivar vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :vartype vpn_client_address_pool: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :vartype vpn_client_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnClientRootCertificate] + :ivar vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network gateway. + :vartype vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnClientRevokedCertificate] + :ivar vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :vartype vpn_client_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnClientProtocol] + :ivar vpn_authentication_types: VPN authentication types for the virtual network gateway.. + :vartype vpn_authentication_types: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnAuthenticationType] + :ivar vpn_client_ipsec_policies: VpnClientIpsecPolicies for virtual network gateway P2S client. + :vartype vpn_client_ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :ivar radius_server_address: The radius server address property of the VirtualNetworkGateway + resource for vpn client connection. + :vartype radius_server_address: str + :ivar radius_server_secret: The radius secret property of the VirtualNetworkGateway resource + for vpn client connection. + :vartype radius_server_secret: str + :ivar radius_servers: The radiusServers property for multiple radius server configuration. + :vartype radius_servers: list[~azure.mgmt.network.v2023_09_01.models.RadiusServer] + :ivar aad_tenant: The AADTenant property of the VirtualNetworkGateway resource for vpn client + connection used for AAD authentication. + :vartype aad_tenant: str + :ivar aad_audience: The AADAudience property of the VirtualNetworkGateway resource for vpn + client connection used for AAD authentication. + :vartype aad_audience: str + :ivar aad_issuer: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + connection used for AAD authentication. + :vartype aad_issuer: str + :ivar vng_client_connection_configurations: per ip address pool connection policy for virtual + network gateway P2S client. + :vartype vng_client_connection_configurations: + list[~azure.mgmt.network.v2023_09_01.models.VngClientConnectionConfiguration] + """ + + _attribute_map = { + "vpn_client_address_pool": {"key": "vpnClientAddressPool", "type": "AddressSpace"}, + "vpn_client_root_certificates": {"key": "vpnClientRootCertificates", "type": "[VpnClientRootCertificate]"}, + "vpn_client_revoked_certificates": { + "key": "vpnClientRevokedCertificates", + "type": "[VpnClientRevokedCertificate]", + }, + "vpn_client_protocols": {"key": "vpnClientProtocols", "type": "[str]"}, + "vpn_authentication_types": {"key": "vpnAuthenticationTypes", "type": "[str]"}, + "vpn_client_ipsec_policies": {"key": "vpnClientIpsecPolicies", "type": "[IpsecPolicy]"}, + "radius_server_address": {"key": "radiusServerAddress", "type": "str"}, + "radius_server_secret": {"key": "radiusServerSecret", "type": "str"}, + "radius_servers": {"key": "radiusServers", "type": "[RadiusServer]"}, + "aad_tenant": {"key": "aadTenant", "type": "str"}, + "aad_audience": {"key": "aadAudience", "type": "str"}, + "aad_issuer": {"key": "aadIssuer", "type": "str"}, + "vng_client_connection_configurations": { + "key": "vngClientConnectionConfigurations", + "type": "[VngClientConnectionConfiguration]", + }, + } + + def __init__( + self, + *, + vpn_client_address_pool: Optional["_models.AddressSpace"] = None, + vpn_client_root_certificates: Optional[List["_models.VpnClientRootCertificate"]] = None, + vpn_client_revoked_certificates: Optional[List["_models.VpnClientRevokedCertificate"]] = None, + vpn_client_protocols: Optional[List[Union[str, "_models.VpnClientProtocol"]]] = None, + vpn_authentication_types: Optional[List[Union[str, "_models.VpnAuthenticationType"]]] = None, + vpn_client_ipsec_policies: Optional[List["_models.IpsecPolicy"]] = None, + radius_server_address: Optional[str] = None, + radius_server_secret: Optional[str] = None, + radius_servers: Optional[List["_models.RadiusServer"]] = None, + aad_tenant: Optional[str] = None, + aad_audience: Optional[str] = None, + aad_issuer: Optional[str] = None, + vng_client_connection_configurations: Optional[List["_models.VngClientConnectionConfiguration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :paramtype vpn_client_address_pool: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :paramtype vpn_client_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnClientRootCertificate] + :keyword vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :paramtype vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnClientRevokedCertificate] + :keyword vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :paramtype vpn_client_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnClientProtocol] + :keyword vpn_authentication_types: VPN authentication types for the virtual network gateway.. + :paramtype vpn_authentication_types: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnAuthenticationType] + :keyword vpn_client_ipsec_policies: VpnClientIpsecPolicies for virtual network gateway P2S + client. + :paramtype vpn_client_ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :keyword radius_server_address: The radius server address property of the VirtualNetworkGateway + resource for vpn client connection. + :paramtype radius_server_address: str + :keyword radius_server_secret: The radius secret property of the VirtualNetworkGateway resource + for vpn client connection. + :paramtype radius_server_secret: str + :keyword radius_servers: The radiusServers property for multiple radius server configuration. + :paramtype radius_servers: list[~azure.mgmt.network.v2023_09_01.models.RadiusServer] + :keyword aad_tenant: The AADTenant property of the VirtualNetworkGateway resource for vpn + client connection used for AAD authentication. + :paramtype aad_tenant: str + :keyword aad_audience: The AADAudience property of the VirtualNetworkGateway resource for vpn + client connection used for AAD authentication. + :paramtype aad_audience: str + :keyword aad_issuer: The AADIssuer property of the VirtualNetworkGateway resource for vpn + client connection used for AAD authentication. + :paramtype aad_issuer: str + :keyword vng_client_connection_configurations: per ip address pool connection policy for + virtual network gateway P2S client. + :paramtype vng_client_connection_configurations: + list[~azure.mgmt.network.v2023_09_01.models.VngClientConnectionConfiguration] + """ + super().__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.vpn_authentication_types = vpn_authentication_types + self.vpn_client_ipsec_policies = vpn_client_ipsec_policies + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret + self.radius_servers = radius_servers + self.aad_tenant = aad_tenant + self.aad_audience = aad_audience + self.aad_issuer = aad_issuer + self.vng_client_connection_configurations = vng_client_connection_configurations + + +class VpnClientConnectionHealth(_serialization.Model): + """VpnClientConnectionHealth properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar total_ingress_bytes_transferred: Total of the Ingress Bytes Transferred in this P2S Vpn + connection. + :vartype total_ingress_bytes_transferred: int + :ivar total_egress_bytes_transferred: Total of the Egress Bytes Transferred in this connection. + :vartype total_egress_bytes_transferred: int + :ivar vpn_client_connections_count: The total of p2s vpn clients connected at this time to this + P2SVpnGateway. + :vartype vpn_client_connections_count: int + :ivar allocated_ip_addresses: List of allocated ip addresses to the connected p2s vpn clients. + :vartype allocated_ip_addresses: list[str] + """ + + _validation = { + "total_ingress_bytes_transferred": {"readonly": True}, + "total_egress_bytes_transferred": {"readonly": True}, + } + + _attribute_map = { + "total_ingress_bytes_transferred": {"key": "totalIngressBytesTransferred", "type": "int"}, + "total_egress_bytes_transferred": {"key": "totalEgressBytesTransferred", "type": "int"}, + "vpn_client_connections_count": {"key": "vpnClientConnectionsCount", "type": "int"}, + "allocated_ip_addresses": {"key": "allocatedIpAddresses", "type": "[str]"}, + } + + def __init__( + self, + *, + vpn_client_connections_count: Optional[int] = None, + allocated_ip_addresses: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword vpn_client_connections_count: The total of p2s vpn clients connected at this time to + this P2SVpnGateway. + :paramtype vpn_client_connections_count: int + :keyword allocated_ip_addresses: List of allocated ip addresses to the connected p2s vpn + clients. + :paramtype allocated_ip_addresses: list[str] + """ + super().__init__(**kwargs) + self.total_ingress_bytes_transferred = None + self.total_egress_bytes_transferred = None + self.vpn_client_connections_count = vpn_client_connections_count + self.allocated_ip_addresses = allocated_ip_addresses + + +class VpnClientConnectionHealthDetail(_serialization.Model): # pylint: disable=too-many-instance-attributes + """VPN client connection health detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vpn_connection_id: The vpn client Id. + :vartype vpn_connection_id: str + :ivar vpn_connection_duration: The duration time of a connected vpn client. + :vartype vpn_connection_duration: int + :ivar vpn_connection_time: The start time of a connected vpn client. + :vartype vpn_connection_time: str + :ivar public_ip_address: The public Ip of a connected vpn client. + :vartype public_ip_address: str + :ivar private_ip_address: The assigned private Ip of a connected vpn client. + :vartype private_ip_address: str + :ivar vpn_user_name: The user name of a connected vpn client. + :vartype vpn_user_name: str + :ivar max_bandwidth: The max band width. + :vartype max_bandwidth: int + :ivar egress_packets_transferred: The egress packets per second. + :vartype egress_packets_transferred: int + :ivar egress_bytes_transferred: The egress bytes per second. + :vartype egress_bytes_transferred: int + :ivar ingress_packets_transferred: The ingress packets per second. + :vartype ingress_packets_transferred: int + :ivar ingress_bytes_transferred: The ingress bytes per second. + :vartype ingress_bytes_transferred: int + :ivar max_packets_per_second: The max packets transferred per second. + :vartype max_packets_per_second: int + """ + + _validation = { + "vpn_connection_id": {"readonly": True}, + "vpn_connection_duration": {"readonly": True}, + "vpn_connection_time": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "vpn_user_name": {"readonly": True}, + "max_bandwidth": {"readonly": True}, + "egress_packets_transferred": {"readonly": True}, + "egress_bytes_transferred": {"readonly": True}, + "ingress_packets_transferred": {"readonly": True}, + "ingress_bytes_transferred": {"readonly": True}, + "max_packets_per_second": {"readonly": True}, + } + + _attribute_map = { + "vpn_connection_id": {"key": "vpnConnectionId", "type": "str"}, + "vpn_connection_duration": {"key": "vpnConnectionDuration", "type": "int"}, + "vpn_connection_time": {"key": "vpnConnectionTime", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "vpn_user_name": {"key": "vpnUserName", "type": "str"}, + "max_bandwidth": {"key": "maxBandwidth", "type": "int"}, + "egress_packets_transferred": {"key": "egressPacketsTransferred", "type": "int"}, + "egress_bytes_transferred": {"key": "egressBytesTransferred", "type": "int"}, + "ingress_packets_transferred": {"key": "ingressPacketsTransferred", "type": "int"}, + "ingress_bytes_transferred": {"key": "ingressBytesTransferred", "type": "int"}, + "max_packets_per_second": {"key": "maxPacketsPerSecond", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.vpn_connection_id = None + self.vpn_connection_duration = None + self.vpn_connection_time = None + self.public_ip_address = None + self.private_ip_address = None + self.vpn_user_name = None + self.max_bandwidth = None + self.egress_packets_transferred = None + self.egress_bytes_transferred = None + self.ingress_packets_transferred = None + self.ingress_bytes_transferred = None + self.max_packets_per_second = None + + +class VpnClientConnectionHealthDetailListResult(_serialization.Model): # pylint: disable=name-too-long + """List of virtual network gateway vpn client connection health. + + :ivar value: List of vpn client connection health. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.VpnClientConnectionHealthDetail] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VpnClientConnectionHealthDetail]"}, + } + + def __init__( + self, *, value: Optional[List["_models.VpnClientConnectionHealthDetail"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of vpn client connection health. + :paramtype value: list[~azure.mgmt.network.v2023_09_01.models.VpnClientConnectionHealthDetail] + """ + super().__init__(**kwargs) + self.value = value + + +class VpnClientIPsecParameters(_serialization.Model): + """An IPSec parameters for a virtual network gateway P2S connection. + + All required parameters must be populated in order to send to server. + + :ivar sa_life_time_seconds: The IPSec Security Association (also called Quick Mode or Phase 2 + SA) lifetime in seconds for P2S client. Required. + :vartype sa_life_time_seconds: int + :ivar sa_data_size_kilobytes: The IPSec Security Association (also called Quick Mode or Phase 2 + SA) payload size in KB for P2S client.. Required. + :vartype sa_data_size_kilobytes: int + :ivar ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). Required. Known values + are: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", and + "GCMAES256". + :vartype ipsec_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IpsecEncryption + :ivar ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). Required. Known values are: + "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", and "GCMAES256". + :vartype ipsec_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IpsecIntegrity + :ivar ike_encryption: The IKE encryption algorithm (IKE phase 2). Required. Known values are: + "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", and "GCMAES128". + :vartype ike_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IkeEncryption + :ivar ike_integrity: The IKE integrity algorithm (IKE phase 2). Required. Known values are: + "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", and "GCMAES128". + :vartype ike_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IkeIntegrity + :ivar dh_group: The DH Group used in IKE Phase 1 for initial SA. Required. Known values are: + "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", and + "DHGroup24". + :vartype dh_group: str or ~azure.mgmt.network.v2023_09_01.models.DhGroup + :ivar pfs_group: The Pfs Group used in IKE Phase 2 for new child SA. Required. Known values + are: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", and "PFSMM". + :vartype pfs_group: str or ~azure.mgmt.network.v2023_09_01.models.PfsGroup + """ + + _validation = { + "sa_life_time_seconds": {"required": True}, + "sa_data_size_kilobytes": {"required": True}, + "ipsec_encryption": {"required": True}, + "ipsec_integrity": {"required": True}, + "ike_encryption": {"required": True}, + "ike_integrity": {"required": True}, + "dh_group": {"required": True}, + "pfs_group": {"required": True}, + } + + _attribute_map = { + "sa_life_time_seconds": {"key": "saLifeTimeSeconds", "type": "int"}, + "sa_data_size_kilobytes": {"key": "saDataSizeKilobytes", "type": "int"}, + "ipsec_encryption": {"key": "ipsecEncryption", "type": "str"}, + "ipsec_integrity": {"key": "ipsecIntegrity", "type": "str"}, + "ike_encryption": {"key": "ikeEncryption", "type": "str"}, + "ike_integrity": {"key": "ikeIntegrity", "type": "str"}, + "dh_group": {"key": "dhGroup", "type": "str"}, + "pfs_group": {"key": "pfsGroup", "type": "str"}, + } + + def __init__( + self, + *, + sa_life_time_seconds: int, + sa_data_size_kilobytes: int, + ipsec_encryption: Union[str, "_models.IpsecEncryption"], + ipsec_integrity: Union[str, "_models.IpsecIntegrity"], + ike_encryption: Union[str, "_models.IkeEncryption"], + ike_integrity: Union[str, "_models.IkeIntegrity"], + dh_group: Union[str, "_models.DhGroup"], + pfs_group: Union[str, "_models.PfsGroup"], + **kwargs: Any + ) -> None: + """ + :keyword sa_life_time_seconds: The IPSec Security Association (also called Quick Mode or Phase + 2 SA) lifetime in seconds for P2S client. Required. + :paramtype sa_life_time_seconds: int + :keyword sa_data_size_kilobytes: The IPSec Security Association (also called Quick Mode or + Phase 2 SA) payload size in KB for P2S client.. Required. + :paramtype sa_data_size_kilobytes: int + :keyword ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). Required. Known values + are: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", and + "GCMAES256". + :paramtype ipsec_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IpsecEncryption + :keyword ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). Required. Known values + are: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", and "GCMAES256". + :paramtype ipsec_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IpsecIntegrity + :keyword ike_encryption: The IKE encryption algorithm (IKE phase 2). Required. Known values + are: "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", and "GCMAES128". + :paramtype ike_encryption: str or ~azure.mgmt.network.v2023_09_01.models.IkeEncryption + :keyword ike_integrity: The IKE integrity algorithm (IKE phase 2). Required. Known values are: + "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", and "GCMAES128". + :paramtype ike_integrity: str or ~azure.mgmt.network.v2023_09_01.models.IkeIntegrity + :keyword dh_group: The DH Group used in IKE Phase 1 for initial SA. Required. Known values are: + "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", and + "DHGroup24". + :paramtype dh_group: str or ~azure.mgmt.network.v2023_09_01.models.DhGroup + :keyword pfs_group: The Pfs Group used in IKE Phase 2 for new child SA. Required. Known values + are: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", and "PFSMM". + :paramtype pfs_group: str or ~azure.mgmt.network.v2023_09_01.models.PfsGroup + """ + super().__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group + + +class VpnClientParameters(_serialization.Model): + """Vpn Client Parameters for package generation. + + :ivar processor_architecture: VPN client Processor Architecture. Known values are: "Amd64" and + "X86". + :vartype processor_architecture: str or + ~azure.mgmt.network.v2023_09_01.models.ProcessorArchitecture + :ivar authentication_method: VPN client authentication method. Known values are: "EAPTLS" and + "EAPMSCHAPv2". + :vartype authentication_method: str or + ~azure.mgmt.network.v2023_09_01.models.AuthenticationMethod + :ivar radius_server_auth_certificate: The public certificate data for the radius server + authentication certificate as a Base-64 encoded string. Required only if external radius + authentication has been configured with EAPTLS authentication. + :vartype radius_server_auth_certificate: str + :ivar client_root_certificates: A list of client root certificates public certificate data + encoded as Base-64 strings. Optional parameter for external radius based authentication with + EAPTLS. + :vartype client_root_certificates: list[str] + """ + + _attribute_map = { + "processor_architecture": {"key": "processorArchitecture", "type": "str"}, + "authentication_method": {"key": "authenticationMethod", "type": "str"}, + "radius_server_auth_certificate": {"key": "radiusServerAuthCertificate", "type": "str"}, + "client_root_certificates": {"key": "clientRootCertificates", "type": "[str]"}, + } + + def __init__( + self, + *, + processor_architecture: Optional[Union[str, "_models.ProcessorArchitecture"]] = None, + authentication_method: Optional[Union[str, "_models.AuthenticationMethod"]] = None, + radius_server_auth_certificate: Optional[str] = None, + client_root_certificates: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword processor_architecture: VPN client Processor Architecture. Known values are: "Amd64" + and "X86". + :paramtype processor_architecture: str or + ~azure.mgmt.network.v2023_09_01.models.ProcessorArchitecture + :keyword authentication_method: VPN client authentication method. Known values are: "EAPTLS" + and "EAPMSCHAPv2". + :paramtype authentication_method: str or + ~azure.mgmt.network.v2023_09_01.models.AuthenticationMethod + :keyword radius_server_auth_certificate: The public certificate data for the radius server + authentication certificate as a Base-64 encoded string. Required only if external radius + authentication has been configured with EAPTLS authentication. + :paramtype radius_server_auth_certificate: str + :keyword client_root_certificates: A list of client root certificates public certificate data + encoded as Base-64 strings. Optional parameter for external radius based authentication with + EAPTLS. + :paramtype client_root_certificates: list[str] + """ + super().__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar thumbprint: The revoked VPN client certificate thumbprint. + :vartype thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked certificate + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "thumbprint": {"key": "properties.thumbprint", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + thumbprint: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword thumbprint: The revoked VPN client certificate thumbprint. + :paramtype thumbprint: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.thumbprint = thumbprint + self.provisioning_state = None + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar public_cert_data: The certificate public data. Required. + :vartype public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "public_cert_data": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "public_cert_data": {"key": "properties.publicCertData", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + public_cert_data: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword public_cert_data: The certificate public data. Required. + :paramtype public_cert_data: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.public_cert_data = public_cert_data + self.provisioning_state = None + + +class VpnConnection(SubResource): # pylint: disable=too-many-instance-attributes + """VpnConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar remote_vpn_site: Id of the connected vpn site. + :vartype remote_vpn_site: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar routing_weight: Routing weight for vpn connection. + :vartype routing_weight: int + :ivar dpd_timeout_seconds: DPD timeout in seconds for vpn connection. + :vartype dpd_timeout_seconds: int + :ivar connection_status: The connection status. Known values are: "Unknown", "Connecting", + "Connected", and "NotConnected". + :vartype connection_status: str or ~azure.mgmt.network.v2023_09_01.models.VpnConnectionStatus + :ivar vpn_connection_protocol_type: Connection protocol used for this connection. Known values + are: "IKEv2" and "IKEv1". + :vartype vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar ingress_bytes_transferred: Ingress bytes transferred. + :vartype ingress_bytes_transferred: int + :ivar egress_bytes_transferred: Egress bytes transferred. + :vartype egress_bytes_transferred: int + :ivar connection_bandwidth: Expected bandwidth in MBPS. + :vartype connection_bandwidth: int + :ivar shared_key: SharedKey for the vpn connection. + :vartype shared_key: str + :ivar enable_bgp: EnableBgp flag. + :vartype enable_bgp: bool + :ivar use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :vartype use_policy_based_traffic_selectors: bool + :ivar ipsec_policies: The IPSec Policies to be considered by this connection. + :vartype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :ivar traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :vartype traffic_selector_policies: + list[~azure.mgmt.network.v2023_09_01.models.TrafficSelectorPolicy] + :ivar enable_rate_limiting: EnableBgp flag. + :vartype enable_rate_limiting: bool + :ivar enable_internet_security: Enable internet security. + :vartype enable_internet_security: bool + :ivar use_local_azure_ip_address: Use local azure ip to initiate connection. + :vartype use_local_azure_ip_address: bool + :ivar provisioning_state: The provisioning state of the VPN connection resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar vpn_link_connections: List of all vpn site link connections to the gateway. + :vartype vpn_link_connections: + list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection] + :ivar routing_configuration: The Routing Configuration indicating the associated and propagated + route tables on this connection. + :vartype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + + _validation = { + "etag": {"readonly": True}, + "connection_status": {"readonly": True}, + "ingress_bytes_transferred": {"readonly": True}, + "egress_bytes_transferred": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "remote_vpn_site": {"key": "properties.remoteVpnSite", "type": "SubResource"}, + "routing_weight": {"key": "properties.routingWeight", "type": "int"}, + "dpd_timeout_seconds": {"key": "properties.dpdTimeoutSeconds", "type": "int"}, + "connection_status": {"key": "properties.connectionStatus", "type": "str"}, + "vpn_connection_protocol_type": {"key": "properties.vpnConnectionProtocolType", "type": "str"}, + "ingress_bytes_transferred": {"key": "properties.ingressBytesTransferred", "type": "int"}, + "egress_bytes_transferred": {"key": "properties.egressBytesTransferred", "type": "int"}, + "connection_bandwidth": {"key": "properties.connectionBandwidth", "type": "int"}, + "shared_key": {"key": "properties.sharedKey", "type": "str"}, + "enable_bgp": {"key": "properties.enableBgp", "type": "bool"}, + "use_policy_based_traffic_selectors": {"key": "properties.usePolicyBasedTrafficSelectors", "type": "bool"}, + "ipsec_policies": {"key": "properties.ipsecPolicies", "type": "[IpsecPolicy]"}, + "traffic_selector_policies": {"key": "properties.trafficSelectorPolicies", "type": "[TrafficSelectorPolicy]"}, + "enable_rate_limiting": {"key": "properties.enableRateLimiting", "type": "bool"}, + "enable_internet_security": {"key": "properties.enableInternetSecurity", "type": "bool"}, + "use_local_azure_ip_address": {"key": "properties.useLocalAzureIpAddress", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "vpn_link_connections": {"key": "properties.vpnLinkConnections", "type": "[VpnSiteLinkConnection]"}, + "routing_configuration": {"key": "properties.routingConfiguration", "type": "RoutingConfiguration"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + remote_vpn_site: Optional["_models.SubResource"] = None, + routing_weight: Optional[int] = None, + dpd_timeout_seconds: Optional[int] = None, + vpn_connection_protocol_type: Optional[Union[str, "_models.VirtualNetworkGatewayConnectionProtocol"]] = None, + connection_bandwidth: Optional[int] = None, + shared_key: Optional[str] = None, + enable_bgp: Optional[bool] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["_models.IpsecPolicy"]] = None, + traffic_selector_policies: Optional[List["_models.TrafficSelectorPolicy"]] = None, + enable_rate_limiting: Optional[bool] = None, + enable_internet_security: Optional[bool] = None, + use_local_azure_ip_address: Optional[bool] = None, + vpn_link_connections: Optional[List["_models.VpnSiteLinkConnection"]] = None, + routing_configuration: Optional["_models.RoutingConfiguration"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword remote_vpn_site: Id of the connected vpn site. + :paramtype remote_vpn_site: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword routing_weight: Routing weight for vpn connection. + :paramtype routing_weight: int + :keyword dpd_timeout_seconds: DPD timeout in seconds for vpn connection. + :paramtype dpd_timeout_seconds: int + :keyword vpn_connection_protocol_type: Connection protocol used for this connection. Known + values are: "IKEv2" and "IKEv1". + :paramtype vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :keyword connection_bandwidth: Expected bandwidth in MBPS. + :paramtype connection_bandwidth: int + :keyword shared_key: SharedKey for the vpn connection. + :paramtype shared_key: str + :keyword enable_bgp: EnableBgp flag. + :paramtype enable_bgp: bool + :keyword use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :paramtype use_policy_based_traffic_selectors: bool + :keyword ipsec_policies: The IPSec Policies to be considered by this connection. + :paramtype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :keyword traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :paramtype traffic_selector_policies: + list[~azure.mgmt.network.v2023_09_01.models.TrafficSelectorPolicy] + :keyword enable_rate_limiting: EnableBgp flag. + :paramtype enable_rate_limiting: bool + :keyword enable_internet_security: Enable internet security. + :paramtype enable_internet_security: bool + :keyword use_local_azure_ip_address: Use local azure ip to initiate connection. + :paramtype use_local_azure_ip_address: bool + :keyword vpn_link_connections: List of all vpn site link connections to the gateway. + :paramtype vpn_link_connections: + list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection] + :keyword routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :paramtype routing_configuration: ~azure.mgmt.network.v2023_09_01.models.RoutingConfiguration + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.remote_vpn_site = remote_vpn_site + self.routing_weight = routing_weight + self.dpd_timeout_seconds = dpd_timeout_seconds + self.connection_status = None + self.vpn_connection_protocol_type = vpn_connection_protocol_type + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.connection_bandwidth = connection_bandwidth + self.shared_key = shared_key + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.traffic_selector_policies = traffic_selector_policies + self.enable_rate_limiting = enable_rate_limiting + self.enable_internet_security = enable_internet_security + self.use_local_azure_ip_address = use_local_azure_ip_address + self.provisioning_state = None + self.vpn_link_connections = vpn_link_connections + self.routing_configuration = routing_configuration + + +class VpnConnectionPacketCaptureStartParameters(_serialization.Model): # pylint: disable=name-too-long + """Vpn Connection packet capture parameters supplied to start packet capture on gateway + connection. + + :ivar filter_data: Start Packet capture parameters on vpn connection. + :vartype filter_data: str + :ivar link_connection_names: List of site link connection names. + :vartype link_connection_names: list[str] + """ + + _attribute_map = { + "filter_data": {"key": "filterData", "type": "str"}, + "link_connection_names": {"key": "linkConnectionNames", "type": "[str]"}, + } + + def __init__( + self, *, filter_data: Optional[str] = None, link_connection_names: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword filter_data: Start Packet capture parameters on vpn connection. + :paramtype filter_data: str + :keyword link_connection_names: List of site link connection names. + :paramtype link_connection_names: list[str] + """ + super().__init__(**kwargs) + self.filter_data = filter_data + self.link_connection_names = link_connection_names + + +class VpnConnectionPacketCaptureStopParameters(_serialization.Model): + """Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + + :ivar sas_url: SAS url for packet capture on vpn connection. + :vartype sas_url: str + :ivar link_connection_names: List of site link connection names. + :vartype link_connection_names: list[str] + """ + + _attribute_map = { + "sas_url": {"key": "sasUrl", "type": "str"}, + "link_connection_names": {"key": "linkConnectionNames", "type": "[str]"}, + } + + def __init__( + self, *, sas_url: Optional[str] = None, link_connection_names: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword sas_url: SAS url for packet capture on vpn connection. + :paramtype sas_url: str + :keyword link_connection_names: List of site link connection names. + :paramtype link_connection_names: list[str] + """ + super().__init__(**kwargs) + self.sas_url = sas_url + self.link_connection_names = link_connection_names + + +class VpnDeviceScriptParameters(_serialization.Model): + """Vpn device configuration script generation parameters. + + :ivar vendor: The vendor for the vpn device. + :vartype vendor: str + :ivar device_family: The device family for the vpn device. + :vartype device_family: str + :ivar firmware_version: The firmware version for the vpn device. + :vartype firmware_version: str + """ + + _attribute_map = { + "vendor": {"key": "vendor", "type": "str"}, + "device_family": {"key": "deviceFamily", "type": "str"}, + "firmware_version": {"key": "firmwareVersion", "type": "str"}, + } + + def __init__( + self, + *, + vendor: Optional[str] = None, + device_family: Optional[str] = None, + firmware_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword vendor: The vendor for the vpn device. + :paramtype vendor: str + :keyword device_family: The device family for the vpn device. + :paramtype device_family: str + :keyword firmware_version: The firmware version for the vpn device. + :paramtype firmware_version: str + """ + super().__init__(**kwargs) + self.vendor = vendor + self.device_family = device_family + self.firmware_version = firmware_version + + +class VpnGateway(Resource): # pylint: disable=too-many-instance-attributes + """VpnGateway Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_hub: The VirtualHub to which the gateway belongs. + :vartype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar connections: List of all vpn connections to the gateway. + :vartype connections: list[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :ivar bgp_settings: Local network gateway's BGP speaker settings. + :vartype bgp_settings: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :ivar provisioning_state: The provisioning state of the VPN gateway resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar vpn_gateway_scale_unit: The scale unit for this vpn gateway. + :vartype vpn_gateway_scale_unit: int + :ivar ip_configurations: List of all IPs configured on the gateway. + :vartype ip_configurations: + list[~azure.mgmt.network.v2023_09_01.models.VpnGatewayIpConfiguration] + :ivar enable_bgp_route_translation_for_nat: Enable BGP routes translation for NAT on this + VpnGateway. + :vartype enable_bgp_route_translation_for_nat: bool + :ivar is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the VpnGateway. + :vartype is_routing_preference_internet: bool + :ivar nat_rules: List of all the nat Rules associated with the gateway. + :vartype nat_rules: list[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "ip_configurations": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "virtual_hub": {"key": "properties.virtualHub", "type": "SubResource"}, + "connections": {"key": "properties.connections", "type": "[VpnConnection]"}, + "bgp_settings": {"key": "properties.bgpSettings", "type": "BgpSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "vpn_gateway_scale_unit": {"key": "properties.vpnGatewayScaleUnit", "type": "int"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[VpnGatewayIpConfiguration]"}, + "enable_bgp_route_translation_for_nat": {"key": "properties.enableBgpRouteTranslationForNat", "type": "bool"}, + "is_routing_preference_internet": {"key": "properties.isRoutingPreferenceInternet", "type": "bool"}, + "nat_rules": {"key": "properties.natRules", "type": "[VpnGatewayNatRule]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_hub: Optional["_models.SubResource"] = None, + connections: Optional[List["_models.VpnConnection"]] = None, + bgp_settings: Optional["_models.BgpSettings"] = None, + vpn_gateway_scale_unit: Optional[int] = None, + enable_bgp_route_translation_for_nat: Optional[bool] = None, + is_routing_preference_internet: Optional[bool] = None, + nat_rules: Optional[List["_models.VpnGatewayNatRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword virtual_hub: The VirtualHub to which the gateway belongs. + :paramtype virtual_hub: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword connections: List of all vpn connections to the gateway. + :paramtype connections: list[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :keyword bgp_settings: Local network gateway's BGP speaker settings. + :paramtype bgp_settings: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :keyword vpn_gateway_scale_unit: The scale unit for this vpn gateway. + :paramtype vpn_gateway_scale_unit: int + :keyword enable_bgp_route_translation_for_nat: Enable BGP routes translation for NAT on this + VpnGateway. + :paramtype enable_bgp_route_translation_for_nat: bool + :keyword is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the VpnGateway. + :paramtype is_routing_preference_internet: bool + :keyword nat_rules: List of all the nat Rules associated with the gateway. + :paramtype nat_rules: list[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_hub = virtual_hub + self.connections = connections + self.bgp_settings = bgp_settings + self.provisioning_state = None + self.vpn_gateway_scale_unit = vpn_gateway_scale_unit + self.ip_configurations = None + self.enable_bgp_route_translation_for_nat = enable_bgp_route_translation_for_nat + self.is_routing_preference_internet = is_routing_preference_internet + self.nat_rules = nat_rules + + +class VpnGatewayIpConfiguration(_serialization.Model): + """IP Configuration of a VPN Gateway Resource. + + :ivar id: The identifier of the IP configuration for a VPN Gateway. + :vartype id: str + :ivar public_ip_address: The public IP address of this IP configuration. + :vartype public_ip_address: str + :ivar private_ip_address: The private IP address of this IP configuration. + :vartype private_ip_address: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + public_ip_address: Optional[str] = None, + private_ip_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The identifier of the IP configuration for a VPN Gateway. + :paramtype id: str + :keyword public_ip_address: The public IP address of this IP configuration. + :paramtype public_ip_address: str + :keyword private_ip_address: The private IP address of this IP configuration. + :paramtype private_ip_address: str + """ + super().__init__(**kwargs) + self.id = id + self.public_ip_address = public_ip_address + self.private_ip_address = private_ip_address + + +class VpnGatewayNatRule(SubResource): # pylint: disable=too-many-instance-attributes + """VpnGatewayNatRule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: The provisioning state of the NAT Rule resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar type_properties_type: The type of NAT rule for VPN NAT. Known values are: "Static" and + "Dynamic". + :vartype type_properties_type: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleType + :ivar mode: The Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and + "IngressSnat". + :vartype mode: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMode + :ivar internal_mappings: The private IP address internal mapping for NAT. + :vartype internal_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :ivar external_mappings: The private IP address external mapping for NAT. + :vartype external_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :ivar ip_configuration_id: The IP Configuration ID this NAT rule applies to. + :vartype ip_configuration_id: str + :ivar egress_vpn_site_link_connections: List of egress VpnSiteLinkConnections. + :vartype egress_vpn_site_link_connections: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar ingress_vpn_site_link_connections: List of ingress VpnSiteLinkConnections. + :vartype ingress_vpn_site_link_connections: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "egress_vpn_site_link_connections": {"readonly": True}, + "ingress_vpn_site_link_connections": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "mode": {"key": "properties.mode", "type": "str"}, + "internal_mappings": {"key": "properties.internalMappings", "type": "[VpnNatRuleMapping]"}, + "external_mappings": {"key": "properties.externalMappings", "type": "[VpnNatRuleMapping]"}, + "ip_configuration_id": {"key": "properties.ipConfigurationId", "type": "str"}, + "egress_vpn_site_link_connections": {"key": "properties.egressVpnSiteLinkConnections", "type": "[SubResource]"}, + "ingress_vpn_site_link_connections": { + "key": "properties.ingressVpnSiteLinkConnections", + "type": "[SubResource]", + }, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type_properties_type: Optional[Union[str, "_models.VpnNatRuleType"]] = None, + mode: Optional[Union[str, "_models.VpnNatRuleMode"]] = None, + internal_mappings: Optional[List["_models.VpnNatRuleMapping"]] = None, + external_mappings: Optional[List["_models.VpnNatRuleMapping"]] = None, + ip_configuration_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword type_properties_type: The type of NAT rule for VPN NAT. Known values are: "Static" and + "Dynamic". + :paramtype type_properties_type: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleType + :keyword mode: The Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and + "IngressSnat". + :paramtype mode: str or ~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMode + :keyword internal_mappings: The private IP address internal mapping for NAT. + :paramtype internal_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :keyword external_mappings: The private IP address external mapping for NAT. + :paramtype external_mappings: list[~azure.mgmt.network.v2023_09_01.models.VpnNatRuleMapping] + :keyword ip_configuration_id: The IP Configuration ID this NAT rule applies to. + :paramtype ip_configuration_id: str + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.provisioning_state = None + self.type_properties_type = type_properties_type + self.mode = mode + self.internal_mappings = internal_mappings + self.external_mappings = external_mappings + self.ip_configuration_id = ip_configuration_id + self.egress_vpn_site_link_connections = None + self.ingress_vpn_site_link_connections = None + + +class VpnGatewayPacketCaptureStartParameters(_serialization.Model): + """Start packet capture parameters. + + :ivar filter_data: Start Packet capture parameters on vpn gateway. + :vartype filter_data: str + """ + + _attribute_map = { + "filter_data": {"key": "filterData", "type": "str"}, + } + + def __init__(self, *, filter_data: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword filter_data: Start Packet capture parameters on vpn gateway. + :paramtype filter_data: str + """ + super().__init__(**kwargs) + self.filter_data = filter_data + + +class VpnGatewayPacketCaptureStopParameters(_serialization.Model): + """Stop packet capture parameters. + + :ivar sas_url: SAS url for packet capture on vpn gateway. + :vartype sas_url: str + """ + + _attribute_map = { + "sas_url": {"key": "sasUrl", "type": "str"}, + } + + def __init__(self, *, sas_url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword sas_url: SAS url for packet capture on vpn gateway. + :paramtype sas_url: str + """ + super().__init__(**kwargs) + self.sas_url = sas_url + + +class VpnLinkBgpSettings(_serialization.Model): + """BGP settings details for a link. + + :ivar asn: The BGP speaker's ASN. + :vartype asn: int + :ivar bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :vartype bgp_peering_address: str + """ + + _attribute_map = { + "asn": {"key": "asn", "type": "int"}, + "bgp_peering_address": {"key": "bgpPeeringAddress", "type": "str"}, + } + + def __init__(self, *, asn: Optional[int] = None, bgp_peering_address: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword asn: The BGP speaker's ASN. + :paramtype asn: int + :keyword bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :paramtype bgp_peering_address: str + """ + super().__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + + +class VpnLinkProviderProperties(_serialization.Model): + """List of properties of a link provider. + + :ivar link_provider_name: Name of the link provider. + :vartype link_provider_name: str + :ivar link_speed_in_mbps: Link speed. + :vartype link_speed_in_mbps: int + """ + + _attribute_map = { + "link_provider_name": {"key": "linkProviderName", "type": "str"}, + "link_speed_in_mbps": {"key": "linkSpeedInMbps", "type": "int"}, + } + + def __init__( + self, *, link_provider_name: Optional[str] = None, link_speed_in_mbps: Optional[int] = None, **kwargs: Any + ) -> None: + """ + :keyword link_provider_name: Name of the link provider. + :paramtype link_provider_name: str + :keyword link_speed_in_mbps: Link speed. + :paramtype link_speed_in_mbps: int + """ + super().__init__(**kwargs) + self.link_provider_name = link_provider_name + self.link_speed_in_mbps = link_speed_in_mbps + + +class VpnNatRuleMapping(_serialization.Model): + """Vpn NatRule mapping. + + :ivar address_space: Address space for Vpn NatRule mapping. + :vartype address_space: str + :ivar port_range: Port range for Vpn NatRule mapping. + :vartype port_range: str + """ + + _attribute_map = { + "address_space": {"key": "addressSpace", "type": "str"}, + "port_range": {"key": "portRange", "type": "str"}, + } + + def __init__(self, *, address_space: Optional[str] = None, port_range: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword address_space: Address space for Vpn NatRule mapping. + :paramtype address_space: str + :keyword port_range: Port range for Vpn NatRule mapping. + :paramtype port_range: str + """ + super().__init__(**kwargs) + self.address_space = address_space + self.port_range = port_range + + +class VpnPacketCaptureStartParameters(_serialization.Model): + """Start packet capture parameters on virtual network gateway. + + :ivar filter_data: Start Packet capture parameters. + :vartype filter_data: str + """ + + _attribute_map = { + "filter_data": {"key": "filterData", "type": "str"}, + } + + def __init__(self, *, filter_data: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword filter_data: Start Packet capture parameters. + :paramtype filter_data: str + """ + super().__init__(**kwargs) + self.filter_data = filter_data + + +class VpnPacketCaptureStopParameters(_serialization.Model): + """Stop packet capture parameters. + + :ivar sas_url: SAS url for packet capture on virtual network gateway. + :vartype sas_url: str + """ + + _attribute_map = { + "sas_url": {"key": "sasUrl", "type": "str"}, + } + + def __init__(self, *, sas_url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword sas_url: SAS url for packet capture on virtual network gateway. + :paramtype sas_url: str + """ + super().__init__(**kwargs) + self.sas_url = sas_url + + +class VpnProfileResponse(_serialization.Model): + """Vpn Profile Response for package generation. + + :ivar profile_url: URL to the VPN profile. + :vartype profile_url: str + """ + + _attribute_map = { + "profile_url": {"key": "profileUrl", "type": "str"}, + } + + def __init__(self, *, profile_url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword profile_url: URL to the VPN profile. + :paramtype profile_url: str + """ + super().__init__(**kwargs) + self.profile_url = profile_url + + +class VpnServerConfigRadiusClientRootCertificate(_serialization.Model): # pylint: disable=name-too-long + """Properties of the Radius client root certificate of VpnServerConfiguration. + + :ivar name: The certificate name. + :vartype name: str + :ivar thumbprint: The Radius client root certificate thumbprint. + :vartype thumbprint: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, thumbprint: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The certificate name. + :paramtype name: str + :keyword thumbprint: The Radius client root certificate thumbprint. + :paramtype thumbprint: str + """ + super().__init__(**kwargs) + self.name = name + self.thumbprint = thumbprint + + +class VpnServerConfigRadiusServerRootCertificate(_serialization.Model): # pylint: disable=name-too-long + """Properties of Radius Server root certificate of VpnServerConfiguration. + + :ivar name: The certificate name. + :vartype name: str + :ivar public_cert_data: The certificate public data. + :vartype public_cert_data: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "public_cert_data": {"key": "publicCertData", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, public_cert_data: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The certificate name. + :paramtype name: str + :keyword public_cert_data: The certificate public data. + :paramtype public_cert_data: str + """ + super().__init__(**kwargs) + self.name = name + self.public_cert_data = public_cert_data + + +class VpnServerConfiguration(Resource): # pylint: disable=too-many-instance-attributes + """VpnServerConfiguration Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar name_properties_name: The name of the VpnServerConfiguration that is unique within a + resource group. + :vartype name_properties_name: str + :ivar vpn_protocols: VPN protocols for the VpnServerConfiguration. + :vartype vpn_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnGatewayTunnelingProtocol] + :ivar vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :vartype vpn_authentication_types: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnAuthenticationType] + :ivar vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :vartype vpn_client_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigVpnClientRootCertificate] + :ivar vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :vartype vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigVpnClientRevokedCertificate] + :ivar radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :vartype radius_server_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigRadiusServerRootCertificate] + :ivar radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :vartype radius_client_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigRadiusClientRootCertificate] + :ivar vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :vartype vpn_client_ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :ivar radius_server_address: The radius server address property of the VpnServerConfiguration + resource for point to site client connection. + :vartype radius_server_address: str + :ivar radius_server_secret: The radius secret property of the VpnServerConfiguration resource + for point to site client connection. + :vartype radius_server_secret: str + :ivar radius_servers: Multiple Radius Server configuration for VpnServerConfiguration. + :vartype radius_servers: list[~azure.mgmt.network.v2023_09_01.models.RadiusServer] + :ivar aad_authentication_parameters: The set of aad vpn authentication parameters. + :vartype aad_authentication_parameters: + ~azure.mgmt.network.v2023_09_01.models.AadAuthenticationParameters + :ivar provisioning_state: The provisioning state of the VpnServerConfiguration resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar p2_s_vpn_gateways: List of references to P2SVpnGateways. + :vartype p2_s_vpn_gateways: list[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :ivar configuration_policy_groups: List of all VpnServerConfigurationPolicyGroups. + :vartype configuration_policy_groups: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :ivar etag_properties_etag: A unique read-only string that changes whenever the resource is + updated. + :vartype etag_properties_etag: str + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "p2_s_vpn_gateways": {"readonly": True}, + "etag_properties_etag": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "name_properties_name": {"key": "properties.name", "type": "str"}, + "vpn_protocols": {"key": "properties.vpnProtocols", "type": "[str]"}, + "vpn_authentication_types": {"key": "properties.vpnAuthenticationTypes", "type": "[str]"}, + "vpn_client_root_certificates": { + "key": "properties.vpnClientRootCertificates", + "type": "[VpnServerConfigVpnClientRootCertificate]", + }, + "vpn_client_revoked_certificates": { + "key": "properties.vpnClientRevokedCertificates", + "type": "[VpnServerConfigVpnClientRevokedCertificate]", + }, + "radius_server_root_certificates": { + "key": "properties.radiusServerRootCertificates", + "type": "[VpnServerConfigRadiusServerRootCertificate]", + }, + "radius_client_root_certificates": { + "key": "properties.radiusClientRootCertificates", + "type": "[VpnServerConfigRadiusClientRootCertificate]", + }, + "vpn_client_ipsec_policies": {"key": "properties.vpnClientIpsecPolicies", "type": "[IpsecPolicy]"}, + "radius_server_address": {"key": "properties.radiusServerAddress", "type": "str"}, + "radius_server_secret": {"key": "properties.radiusServerSecret", "type": "str"}, + "radius_servers": {"key": "properties.radiusServers", "type": "[RadiusServer]"}, + "aad_authentication_parameters": { + "key": "properties.aadAuthenticationParameters", + "type": "AadAuthenticationParameters", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "p2_s_vpn_gateways": {"key": "properties.p2SVpnGateways", "type": "[P2SVpnGateway]"}, + "configuration_policy_groups": { + "key": "properties.configurationPolicyGroups", + "type": "[VpnServerConfigurationPolicyGroup]", + }, + "etag_properties_etag": {"key": "properties.etag", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + name_properties_name: Optional[str] = None, + vpn_protocols: Optional[List[Union[str, "_models.VpnGatewayTunnelingProtocol"]]] = None, + vpn_authentication_types: Optional[List[Union[str, "_models.VpnAuthenticationType"]]] = None, + vpn_client_root_certificates: Optional[List["_models.VpnServerConfigVpnClientRootCertificate"]] = None, + vpn_client_revoked_certificates: Optional[List["_models.VpnServerConfigVpnClientRevokedCertificate"]] = None, + radius_server_root_certificates: Optional[List["_models.VpnServerConfigRadiusServerRootCertificate"]] = None, + radius_client_root_certificates: Optional[List["_models.VpnServerConfigRadiusClientRootCertificate"]] = None, + vpn_client_ipsec_policies: Optional[List["_models.IpsecPolicy"]] = None, + radius_server_address: Optional[str] = None, + radius_server_secret: Optional[str] = None, + radius_servers: Optional[List["_models.RadiusServer"]] = None, + aad_authentication_parameters: Optional["_models.AadAuthenticationParameters"] = None, + configuration_policy_groups: Optional[List["_models.VpnServerConfigurationPolicyGroup"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword name_properties_name: The name of the VpnServerConfiguration that is unique within a + resource group. + :paramtype name_properties_name: str + :keyword vpn_protocols: VPN protocols for the VpnServerConfiguration. + :paramtype vpn_protocols: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnGatewayTunnelingProtocol] + :keyword vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :paramtype vpn_authentication_types: list[str or + ~azure.mgmt.network.v2023_09_01.models.VpnAuthenticationType] + :keyword vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :paramtype vpn_client_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigVpnClientRootCertificate] + :keyword vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :paramtype vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigVpnClientRevokedCertificate] + :keyword radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :paramtype radius_server_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigRadiusServerRootCertificate] + :keyword radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :paramtype radius_client_root_certificates: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigRadiusClientRootCertificate] + :keyword vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :paramtype vpn_client_ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :keyword radius_server_address: The radius server address property of the + VpnServerConfiguration resource for point to site client connection. + :paramtype radius_server_address: str + :keyword radius_server_secret: The radius secret property of the VpnServerConfiguration + resource for point to site client connection. + :paramtype radius_server_secret: str + :keyword radius_servers: Multiple Radius Server configuration for VpnServerConfiguration. + :paramtype radius_servers: list[~azure.mgmt.network.v2023_09_01.models.RadiusServer] + :keyword aad_authentication_parameters: The set of aad vpn authentication parameters. + :paramtype aad_authentication_parameters: + ~azure.mgmt.network.v2023_09_01.models.AadAuthenticationParameters + :keyword configuration_policy_groups: List of all VpnServerConfigurationPolicyGroups. + :paramtype configuration_policy_groups: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.name_properties_name = name_properties_name + self.vpn_protocols = vpn_protocols + self.vpn_authentication_types = vpn_authentication_types + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.radius_server_root_certificates = radius_server_root_certificates + self.radius_client_root_certificates = radius_client_root_certificates + self.vpn_client_ipsec_policies = vpn_client_ipsec_policies + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret + self.radius_servers = radius_servers + self.aad_authentication_parameters = aad_authentication_parameters + self.provisioning_state = None + self.p2_s_vpn_gateways = None + self.configuration_policy_groups = configuration_policy_groups + self.etag_properties_etag = None + + +class VpnServerConfigurationPolicyGroup(SubResource): + """VpnServerConfigurationPolicyGroup Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar is_default: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + :vartype is_default: bool + :ivar priority: Priority for VpnServerConfigurationPolicyGroup. + :vartype priority: int + :ivar policy_members: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + :vartype policy_members: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroupMember] + :ivar p2_s_connection_configurations: List of references to P2SConnectionConfigurations. + :vartype p2_s_connection_configurations: + list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the VpnServerConfigurationPolicyGroup + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "p2_s_connection_configurations": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "is_default": {"key": "properties.isDefault", "type": "bool"}, + "priority": {"key": "properties.priority", "type": "int"}, + "policy_members": {"key": "properties.policyMembers", "type": "[VpnServerConfigurationPolicyGroupMember]"}, + "p2_s_connection_configurations": {"key": "properties.p2SConnectionConfigurations", "type": "[SubResource]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + is_default: Optional[bool] = None, + priority: Optional[int] = None, + policy_members: Optional[List["_models.VpnServerConfigurationPolicyGroupMember"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword is_default: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + :paramtype is_default: bool + :keyword priority: Priority for VpnServerConfigurationPolicyGroup. + :paramtype priority: int + :keyword policy_members: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + :paramtype policy_members: + list[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroupMember] + """ + super().__init__(id=id, **kwargs) + self.etag = None + self.name = name + self.type = None + self.is_default = is_default + self.priority = priority + self.policy_members = policy_members + self.p2_s_connection_configurations = None + self.provisioning_state = None + + +class VpnServerConfigurationPolicyGroupMember(_serialization.Model): + """VpnServerConfiguration PolicyGroup member. + + :ivar name: Name of the VpnServerConfigurationPolicyGroupMember. + :vartype name: str + :ivar attribute_type: The Vpn Policy member attribute type. Known values are: + "CertificateGroupId", "AADGroupId", and "RadiusAzureGroupId". + :vartype attribute_type: str or + ~azure.mgmt.network.v2023_09_01.models.VpnPolicyMemberAttributeType + :ivar attribute_value: The value of Attribute used for this + VpnServerConfigurationPolicyGroupMember. + :vartype attribute_value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "attribute_type": {"key": "attributeType", "type": "str"}, + "attribute_value": {"key": "attributeValue", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + attribute_type: Optional[Union[str, "_models.VpnPolicyMemberAttributeType"]] = None, + attribute_value: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the VpnServerConfigurationPolicyGroupMember. + :paramtype name: str + :keyword attribute_type: The Vpn Policy member attribute type. Known values are: + "CertificateGroupId", "AADGroupId", and "RadiusAzureGroupId". + :paramtype attribute_type: str or + ~azure.mgmt.network.v2023_09_01.models.VpnPolicyMemberAttributeType + :keyword attribute_value: The value of Attribute used for this + VpnServerConfigurationPolicyGroupMember. + :paramtype attribute_value: str + """ + super().__init__(**kwargs) + self.name = name + self.attribute_type = attribute_type + self.attribute_value = attribute_value + + +class VpnServerConfigurationsResponse(_serialization.Model): + """VpnServerConfigurations list associated with VirtualWan Response. + + :ivar vpn_server_configuration_resource_ids: List of VpnServerConfigurations associated with + VirtualWan. + :vartype vpn_server_configuration_resource_ids: list[str] + """ + + _attribute_map = { + "vpn_server_configuration_resource_ids": {"key": "vpnServerConfigurationResourceIds", "type": "[str]"}, + } + + def __init__(self, *, vpn_server_configuration_resource_ids: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword vpn_server_configuration_resource_ids: List of VpnServerConfigurations associated with + VirtualWan. + :paramtype vpn_server_configuration_resource_ids: list[str] + """ + super().__init__(**kwargs) + self.vpn_server_configuration_resource_ids = vpn_server_configuration_resource_ids + + +class VpnServerConfigVpnClientRevokedCertificate(_serialization.Model): # pylint: disable=name-too-long + """Properties of the revoked VPN client certificate of VpnServerConfiguration. + + :ivar name: The certificate name. + :vartype name: str + :ivar thumbprint: The revoked VPN client certificate thumbprint. + :vartype thumbprint: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, thumbprint: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The certificate name. + :paramtype name: str + :keyword thumbprint: The revoked VPN client certificate thumbprint. + :paramtype thumbprint: str + """ + super().__init__(**kwargs) + self.name = name + self.thumbprint = thumbprint + + +class VpnServerConfigVpnClientRootCertificate(_serialization.Model): + """Properties of VPN client root certificate of VpnServerConfiguration. + + :ivar name: The certificate name. + :vartype name: str + :ivar public_cert_data: The certificate public data. + :vartype public_cert_data: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "public_cert_data": {"key": "publicCertData", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, public_cert_data: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The certificate name. + :paramtype name: str + :keyword public_cert_data: The certificate public data. + :paramtype public_cert_data: str + """ + super().__init__(**kwargs) + self.name = name + self.public_cert_data = public_cert_data + + +class VpnSite(Resource): # pylint: disable=too-many-instance-attributes + """VpnSite Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_wan: The VirtualWAN to which the vpnSite belongs. + :vartype virtual_wan: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar device_properties: The device properties. + :vartype device_properties: ~azure.mgmt.network.v2023_09_01.models.DeviceProperties + :ivar ip_address: The ip-address for the vpn-site. + :vartype ip_address: str + :ivar site_key: The key for vpn-site that can be used for connections. + :vartype site_key: str + :ivar address_space: The AddressSpace that contains an array of IP address ranges. + :vartype address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :ivar bgp_properties: The set of bgp properties. + :vartype bgp_properties: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :ivar provisioning_state: The provisioning state of the VPN site resource. Known values are: + "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar is_security_site: IsSecuritySite flag. + :vartype is_security_site: bool + :ivar vpn_site_links: List of all vpn site links. + :vartype vpn_site_links: list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLink] + :ivar o365_policy: Office365 Policy. + :vartype o365_policy: ~azure.mgmt.network.v2023_09_01.models.O365PolicyProperties + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "virtual_wan": {"key": "properties.virtualWan", "type": "SubResource"}, + "device_properties": {"key": "properties.deviceProperties", "type": "DeviceProperties"}, + "ip_address": {"key": "properties.ipAddress", "type": "str"}, + "site_key": {"key": "properties.siteKey", "type": "str"}, + "address_space": {"key": "properties.addressSpace", "type": "AddressSpace"}, + "bgp_properties": {"key": "properties.bgpProperties", "type": "BgpSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "is_security_site": {"key": "properties.isSecuritySite", "type": "bool"}, + "vpn_site_links": {"key": "properties.vpnSiteLinks", "type": "[VpnSiteLink]"}, + "o365_policy": {"key": "properties.o365Policy", "type": "O365PolicyProperties"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_wan: Optional["_models.SubResource"] = None, + device_properties: Optional["_models.DeviceProperties"] = None, + ip_address: Optional[str] = None, + site_key: Optional[str] = None, + address_space: Optional["_models.AddressSpace"] = None, + bgp_properties: Optional["_models.BgpSettings"] = None, + is_security_site: Optional[bool] = None, + vpn_site_links: Optional[List["_models.VpnSiteLink"]] = None, + o365_policy: Optional["_models.O365PolicyProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword virtual_wan: The VirtualWAN to which the vpnSite belongs. + :paramtype virtual_wan: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword device_properties: The device properties. + :paramtype device_properties: ~azure.mgmt.network.v2023_09_01.models.DeviceProperties + :keyword ip_address: The ip-address for the vpn-site. + :paramtype ip_address: str + :keyword site_key: The key for vpn-site that can be used for connections. + :paramtype site_key: str + :keyword address_space: The AddressSpace that contains an array of IP address ranges. + :paramtype address_space: ~azure.mgmt.network.v2023_09_01.models.AddressSpace + :keyword bgp_properties: The set of bgp properties. + :paramtype bgp_properties: ~azure.mgmt.network.v2023_09_01.models.BgpSettings + :keyword is_security_site: IsSecuritySite flag. + :paramtype is_security_site: bool + :keyword vpn_site_links: List of all vpn site links. + :paramtype vpn_site_links: list[~azure.mgmt.network.v2023_09_01.models.VpnSiteLink] + :keyword o365_policy: Office365 Policy. + :paramtype o365_policy: ~azure.mgmt.network.v2023_09_01.models.O365PolicyProperties + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_wan = virtual_wan + self.device_properties = device_properties + self.ip_address = ip_address + self.site_key = site_key + self.address_space = address_space + self.bgp_properties = bgp_properties + self.provisioning_state = None + self.is_security_site = is_security_site + self.vpn_site_links = vpn_site_links + self.o365_policy = o365_policy + + +class VpnSiteId(_serialization.Model): + """VpnSite Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vpn_site: The resource-uri of the vpn-site for which config is to be fetched. + :vartype vpn_site: str + """ + + _validation = { + "vpn_site": {"readonly": True}, + } + + _attribute_map = { + "vpn_site": {"key": "vpnSite", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.vpn_site = None + + +class VpnSiteLink(SubResource): + """VpnSiteLink Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar link_properties: The link provider properties. + :vartype link_properties: ~azure.mgmt.network.v2023_09_01.models.VpnLinkProviderProperties + :ivar ip_address: The ip-address for the vpn-site-link. + :vartype ip_address: str + :ivar fqdn: FQDN of vpn-site-link. + :vartype fqdn: str + :ivar bgp_properties: The set of bgp properties. + :vartype bgp_properties: ~azure.mgmt.network.v2023_09_01.models.VpnLinkBgpSettings + :ivar provisioning_state: The provisioning state of the VPN site link resource. Known values + are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "link_properties": {"key": "properties.linkProperties", "type": "VpnLinkProviderProperties"}, + "ip_address": {"key": "properties.ipAddress", "type": "str"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "bgp_properties": {"key": "properties.bgpProperties", "type": "VpnLinkBgpSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + link_properties: Optional["_models.VpnLinkProviderProperties"] = None, + ip_address: Optional[str] = None, + fqdn: Optional[str] = None, + bgp_properties: Optional["_models.VpnLinkBgpSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword link_properties: The link provider properties. + :paramtype link_properties: ~azure.mgmt.network.v2023_09_01.models.VpnLinkProviderProperties + :keyword ip_address: The ip-address for the vpn-site-link. + :paramtype ip_address: str + :keyword fqdn: FQDN of vpn-site-link. + :paramtype fqdn: str + :keyword bgp_properties: The set of bgp properties. + :paramtype bgp_properties: ~azure.mgmt.network.v2023_09_01.models.VpnLinkBgpSettings + """ + super().__init__(id=id, **kwargs) + self.etag = None + self.name = name + self.type = None + self.link_properties = link_properties + self.ip_address = ip_address + self.fqdn = fqdn + self.bgp_properties = bgp_properties + self.provisioning_state = None + + +class VpnSiteLinkConnection(SubResource): # pylint: disable=too-many-instance-attributes + """VpnSiteLinkConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :ivar vpn_site_link: Id of the connected vpn site link. + :vartype vpn_site_link: ~azure.mgmt.network.v2023_09_01.models.SubResource + :ivar routing_weight: Routing weight for vpn connection. + :vartype routing_weight: int + :ivar vpn_link_connection_mode: Vpn link connection mode. Known values are: "Default", + "ResponderOnly", and "InitiatorOnly". + :vartype vpn_link_connection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.VpnLinkConnectionMode + :ivar connection_status: The connection status. Known values are: "Unknown", "Connecting", + "Connected", and "NotConnected". + :vartype connection_status: str or ~azure.mgmt.network.v2023_09_01.models.VpnConnectionStatus + :ivar vpn_connection_protocol_type: Connection protocol used for this connection. Known values + are: "IKEv2" and "IKEv1". + :vartype vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar ingress_bytes_transferred: Ingress bytes transferred. + :vartype ingress_bytes_transferred: int + :ivar egress_bytes_transferred: Egress bytes transferred. + :vartype egress_bytes_transferred: int + :ivar connection_bandwidth: Expected bandwidth in MBPS. + :vartype connection_bandwidth: int + :ivar shared_key: SharedKey for the vpn connection. + :vartype shared_key: str + :ivar enable_bgp: EnableBgp flag. + :vartype enable_bgp: bool + :ivar vpn_gateway_custom_bgp_addresses: vpnGatewayCustomBgpAddresses used by this connection. + :vartype vpn_gateway_custom_bgp_addresses: + list[~azure.mgmt.network.v2023_09_01.models.GatewayCustomBgpIpAddressIpConfiguration] + :ivar use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :vartype use_policy_based_traffic_selectors: bool + :ivar ipsec_policies: The IPSec Policies to be considered by this connection. + :vartype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :ivar enable_rate_limiting: EnableBgp flag. + :vartype enable_rate_limiting: bool + :ivar use_local_azure_ip_address: Use local azure ip to initiate connection. + :vartype use_local_azure_ip_address: bool + :ivar provisioning_state: The provisioning state of the VPN site link connection resource. + Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar ingress_nat_rules: List of ingress NatRules. + :vartype ingress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar egress_nat_rules: List of egress NatRules. + :vartype egress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "etag": {"readonly": True}, + "type": {"readonly": True}, + "connection_status": {"readonly": True}, + "ingress_bytes_transferred": {"readonly": True}, + "egress_bytes_transferred": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "vpn_site_link": {"key": "properties.vpnSiteLink", "type": "SubResource"}, + "routing_weight": {"key": "properties.routingWeight", "type": "int"}, + "vpn_link_connection_mode": {"key": "properties.vpnLinkConnectionMode", "type": "str"}, + "connection_status": {"key": "properties.connectionStatus", "type": "str"}, + "vpn_connection_protocol_type": {"key": "properties.vpnConnectionProtocolType", "type": "str"}, + "ingress_bytes_transferred": {"key": "properties.ingressBytesTransferred", "type": "int"}, + "egress_bytes_transferred": {"key": "properties.egressBytesTransferred", "type": "int"}, + "connection_bandwidth": {"key": "properties.connectionBandwidth", "type": "int"}, + "shared_key": {"key": "properties.sharedKey", "type": "str"}, + "enable_bgp": {"key": "properties.enableBgp", "type": "bool"}, + "vpn_gateway_custom_bgp_addresses": { + "key": "properties.vpnGatewayCustomBgpAddresses", + "type": "[GatewayCustomBgpIpAddressIpConfiguration]", + }, + "use_policy_based_traffic_selectors": {"key": "properties.usePolicyBasedTrafficSelectors", "type": "bool"}, + "ipsec_policies": {"key": "properties.ipsecPolicies", "type": "[IpsecPolicy]"}, + "enable_rate_limiting": {"key": "properties.enableRateLimiting", "type": "bool"}, + "use_local_azure_ip_address": {"key": "properties.useLocalAzureIpAddress", "type": "bool"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "ingress_nat_rules": {"key": "properties.ingressNatRules", "type": "[SubResource]"}, + "egress_nat_rules": {"key": "properties.egressNatRules", "type": "[SubResource]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + vpn_site_link: Optional["_models.SubResource"] = None, + routing_weight: Optional[int] = None, + vpn_link_connection_mode: Optional[Union[str, "_models.VpnLinkConnectionMode"]] = None, + vpn_connection_protocol_type: Optional[Union[str, "_models.VirtualNetworkGatewayConnectionProtocol"]] = None, + connection_bandwidth: Optional[int] = None, + shared_key: Optional[str] = None, + enable_bgp: Optional[bool] = None, + vpn_gateway_custom_bgp_addresses: Optional[List["_models.GatewayCustomBgpIpAddressIpConfiguration"]] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["_models.IpsecPolicy"]] = None, + enable_rate_limiting: Optional[bool] = None, + use_local_azure_ip_address: Optional[bool] = None, + ingress_nat_rules: Optional[List["_models.SubResource"]] = None, + egress_nat_rules: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword name: The name of the resource that is unique within a resource group. This name can + be used to access the resource. + :paramtype name: str + :keyword vpn_site_link: Id of the connected vpn site link. + :paramtype vpn_site_link: ~azure.mgmt.network.v2023_09_01.models.SubResource + :keyword routing_weight: Routing weight for vpn connection. + :paramtype routing_weight: int + :keyword vpn_link_connection_mode: Vpn link connection mode. Known values are: "Default", + "ResponderOnly", and "InitiatorOnly". + :paramtype vpn_link_connection_mode: str or + ~azure.mgmt.network.v2023_09_01.models.VpnLinkConnectionMode + :keyword vpn_connection_protocol_type: Connection protocol used for this connection. Known + values are: "IKEv2" and "IKEv1". + :paramtype vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionProtocol + :keyword connection_bandwidth: Expected bandwidth in MBPS. + :paramtype connection_bandwidth: int + :keyword shared_key: SharedKey for the vpn connection. + :paramtype shared_key: str + :keyword enable_bgp: EnableBgp flag. + :paramtype enable_bgp: bool + :keyword vpn_gateway_custom_bgp_addresses: vpnGatewayCustomBgpAddresses used by this + connection. + :paramtype vpn_gateway_custom_bgp_addresses: + list[~azure.mgmt.network.v2023_09_01.models.GatewayCustomBgpIpAddressIpConfiguration] + :keyword use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :paramtype use_policy_based_traffic_selectors: bool + :keyword ipsec_policies: The IPSec Policies to be considered by this connection. + :paramtype ipsec_policies: list[~azure.mgmt.network.v2023_09_01.models.IpsecPolicy] + :keyword enable_rate_limiting: EnableBgp flag. + :paramtype enable_rate_limiting: bool + :keyword use_local_azure_ip_address: Use local azure ip to initiate connection. + :paramtype use_local_azure_ip_address: bool + :keyword ingress_nat_rules: List of ingress NatRules. + :paramtype ingress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :keyword egress_nat_rules: List of egress NatRules. + :paramtype egress_nat_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + super().__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.vpn_site_link = vpn_site_link + self.routing_weight = routing_weight + self.vpn_link_connection_mode = vpn_link_connection_mode + self.connection_status = None + self.vpn_connection_protocol_type = vpn_connection_protocol_type + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.connection_bandwidth = connection_bandwidth + self.shared_key = shared_key + self.enable_bgp = enable_bgp + self.vpn_gateway_custom_bgp_addresses = vpn_gateway_custom_bgp_addresses + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.enable_rate_limiting = enable_rate_limiting + self.use_local_azure_ip_address = use_local_azure_ip_address + self.provisioning_state = None + self.ingress_nat_rules = ingress_nat_rules + self.egress_nat_rules = egress_nat_rules + + +class WebApplicationFirewallCustomRule(_serialization.Model): + """Defines contents of a web application rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the resource that is unique within a policy. This name can be used to + access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar priority: Priority of the rule. Rules with a lower value will be evaluated before rules + with a higher value. Required. + :vartype priority: int + :ivar state: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled + if not specified. Known values are: "Disabled" and "Enabled". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallState + :ivar rate_limit_duration: Duration over which Rate Limit policy will be applied. Applies only + when ruleType is RateLimitRule. Known values are: "OneMin" and "FiveMins". + :vartype rate_limit_duration: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRateLimitDuration + :ivar rate_limit_threshold: Rate Limit threshold to apply in case ruleType is RateLimitRule. + Must be greater than or equal to 1. + :vartype rate_limit_threshold: int + :ivar rule_type: The rule type. Required. Known values are: "MatchRule", "RateLimitRule", and + "Invalid". + :vartype rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallRuleType + :ivar match_conditions: List of match conditions. Required. + :vartype match_conditions: list[~azure.mgmt.network.v2023_09_01.models.MatchCondition] + :ivar group_by_user_session: List of user session identifier group by clauses. + :vartype group_by_user_session: list[~azure.mgmt.network.v2023_09_01.models.GroupByUserSession] + :ivar action: Type of Actions. Required. Known values are: "Allow", "Block", "Log", and + "JSChallenge". + :vartype action: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallAction + """ + + _validation = { + "name": {"max_length": 128}, + "etag": {"readonly": True}, + "priority": {"required": True}, + "rule_type": {"required": True}, + "match_conditions": {"required": True}, + "action": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, + "state": {"key": "state", "type": "str"}, + "rate_limit_duration": {"key": "rateLimitDuration", "type": "str"}, + "rate_limit_threshold": {"key": "rateLimitThreshold", "type": "int"}, + "rule_type": {"key": "ruleType", "type": "str"}, + "match_conditions": {"key": "matchConditions", "type": "[MatchCondition]"}, + "group_by_user_session": {"key": "groupByUserSession", "type": "[GroupByUserSession]"}, + "action": {"key": "action", "type": "str"}, + } + + def __init__( + self, + *, + priority: int, + rule_type: Union[str, "_models.WebApplicationFirewallRuleType"], + match_conditions: List["_models.MatchCondition"], + action: Union[str, "_models.WebApplicationFirewallAction"], + name: Optional[str] = None, + state: Optional[Union[str, "_models.WebApplicationFirewallState"]] = None, + rate_limit_duration: Optional[Union[str, "_models.ApplicationGatewayFirewallRateLimitDuration"]] = None, + rate_limit_threshold: Optional[int] = None, + group_by_user_session: Optional[List["_models.GroupByUserSession"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the resource that is unique within a policy. This name can be used + to access the resource. + :paramtype name: str + :keyword priority: Priority of the rule. Rules with a lower value will be evaluated before + rules with a higher value. Required. + :paramtype priority: int + :keyword state: Describes if the custom rule is in enabled or disabled state. Defaults to + Enabled if not specified. Known values are: "Disabled" and "Enabled". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallState + :keyword rate_limit_duration: Duration over which Rate Limit policy will be applied. Applies + only when ruleType is RateLimitRule. Known values are: "OneMin" and "FiveMins". + :paramtype rate_limit_duration: str or + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayFirewallRateLimitDuration + :keyword rate_limit_threshold: Rate Limit threshold to apply in case ruleType is RateLimitRule. + Must be greater than or equal to 1. + :paramtype rate_limit_threshold: int + :keyword rule_type: The rule type. Required. Known values are: "MatchRule", "RateLimitRule", + and "Invalid". + :paramtype rule_type: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallRuleType + :keyword match_conditions: List of match conditions. Required. + :paramtype match_conditions: list[~azure.mgmt.network.v2023_09_01.models.MatchCondition] + :keyword group_by_user_session: List of user session identifier group by clauses. + :paramtype group_by_user_session: + list[~azure.mgmt.network.v2023_09_01.models.GroupByUserSession] + :keyword action: Type of Actions. Required. Known values are: "Allow", "Block", "Log", and + "JSChallenge". + :paramtype action: str or ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallAction + """ + super().__init__(**kwargs) + self.name = name + self.etag = None + self.priority = priority + self.state = state + self.rate_limit_duration = rate_limit_duration + self.rate_limit_threshold = rate_limit_threshold + self.rule_type = rule_type + self.match_conditions = match_conditions + self.group_by_user_session = group_by_user_session + self.action = action + + +class WebApplicationFirewallPolicy(Resource): # pylint: disable=too-many-instance-attributes + """Defines web application firewall policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar policy_settings: The PolicySettings for policy. + :vartype policy_settings: ~azure.mgmt.network.v2023_09_01.models.PolicySettings + :ivar custom_rules: The custom rules inside the policy. + :vartype custom_rules: + list[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :ivar provisioning_state: The provisioning state of the web application firewall policy + resource. Known values are: "Succeeded", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2023_09_01.models.ProvisioningState + :ivar resource_state: Resource status of the policy. Known values are: "Creating", "Enabling", + "Enabled", "Disabling", "Disabled", and "Deleting". + :vartype resource_state: str or + ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicyResourceState + :ivar managed_rules: Describes the managedRules structure. + :vartype managed_rules: ~azure.mgmt.network.v2023_09_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + :ivar path_based_rules: A collection of references to application gateway path rules. + :vartype path_based_rules: list[~azure.mgmt.network.v2023_09_01.models.SubResource] + """ + + _validation = { + "name": {"readonly": True}, + "type": {"readonly": True}, + "etag": {"readonly": True}, + "application_gateways": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "resource_state": {"readonly": True}, + "http_listeners": {"readonly": True}, + "path_based_rules": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "etag": {"key": "etag", "type": "str"}, + "policy_settings": {"key": "properties.policySettings", "type": "PolicySettings"}, + "custom_rules": {"key": "properties.customRules", "type": "[WebApplicationFirewallCustomRule]"}, + "application_gateways": {"key": "properties.applicationGateways", "type": "[ApplicationGateway]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "resource_state": {"key": "properties.resourceState", "type": "str"}, + "managed_rules": {"key": "properties.managedRules", "type": "ManagedRulesDefinition"}, + "http_listeners": {"key": "properties.httpListeners", "type": "[SubResource]"}, + "path_based_rules": {"key": "properties.pathBasedRules", "type": "[SubResource]"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + policy_settings: Optional["_models.PolicySettings"] = None, + custom_rules: Optional[List["_models.WebApplicationFirewallCustomRule"]] = None, + managed_rules: Optional["_models.ManagedRulesDefinition"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource ID. + :paramtype id: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword policy_settings: The PolicySettings for policy. + :paramtype policy_settings: ~azure.mgmt.network.v2023_09_01.models.PolicySettings + :keyword custom_rules: The custom rules inside the policy. + :paramtype custom_rules: + list[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallCustomRule] + :keyword managed_rules: Describes the managedRules structure. + :paramtype managed_rules: ~azure.mgmt.network.v2023_09_01.models.ManagedRulesDefinition + """ + super().__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.policy_settings = policy_settings + self.custom_rules = custom_rules + self.application_gateways = None + self.provisioning_state = None + self.resource_state = None + self.managed_rules = managed_rules + self.http_listeners = None + self.path_based_rules = None + + +class WebApplicationFirewallPolicyListResult(_serialization.Model): + """Result of the request to list WebApplicationFirewallPolicies. It contains a list of + WebApplicationFirewallPolicy objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of WebApplicationFirewallPolicies within a resource group. + :vartype value: list[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy] + :ivar next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are + any. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[WebApplicationFirewallPolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class WebApplicationFirewallScrubbingRules(_serialization.Model): + """Allow certain variables to be scrubbed on WAF logs. + + All required parameters must be populated in order to send to server. + + :ivar match_variable: The variable to be scrubbed from the logs. Required. Known values are: + "RequestHeaderNames", "RequestCookieNames", "RequestArgNames", "RequestPostArgNames", + "RequestJSONArgNames", and "RequestIPAddress". + :vartype match_variable: str or + ~azure.mgmt.network.v2023_09_01.models.ScrubbingRuleEntryMatchVariable + :ivar selector_match_operator: When matchVariable is a collection, operate on the selector to + specify which elements in the collection this rule applies to. Required. Known values are: + "Equals" and "EqualsAny". + :vartype selector_match_operator: str or + ~azure.mgmt.network.v2023_09_01.models.ScrubbingRuleEntryMatchOperator + :ivar selector: When matchVariable is a collection, operator used to specify which elements in + the collection this rule applies to. + :vartype selector: str + :ivar state: Defines the state of log scrubbing rule. Default value is Enabled. Known values + are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.network.v2023_09_01.models.ScrubbingRuleEntryState + """ + + _validation = { + "match_variable": {"required": True}, + "selector_match_operator": {"required": True}, + } + + _attribute_map = { + "match_variable": {"key": "matchVariable", "type": "str"}, + "selector_match_operator": {"key": "selectorMatchOperator", "type": "str"}, + "selector": {"key": "selector", "type": "str"}, + "state": {"key": "state", "type": "str"}, + } + + def __init__( + self, + *, + match_variable: Union[str, "_models.ScrubbingRuleEntryMatchVariable"], + selector_match_operator: Union[str, "_models.ScrubbingRuleEntryMatchOperator"], + selector: Optional[str] = None, + state: Optional[Union[str, "_models.ScrubbingRuleEntryState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword match_variable: The variable to be scrubbed from the logs. Required. Known values are: + "RequestHeaderNames", "RequestCookieNames", "RequestArgNames", "RequestPostArgNames", + "RequestJSONArgNames", and "RequestIPAddress". + :paramtype match_variable: str or + ~azure.mgmt.network.v2023_09_01.models.ScrubbingRuleEntryMatchVariable + :keyword selector_match_operator: When matchVariable is a collection, operate on the selector + to specify which elements in the collection this rule applies to. Required. Known values are: + "Equals" and "EqualsAny". + :paramtype selector_match_operator: str or + ~azure.mgmt.network.v2023_09_01.models.ScrubbingRuleEntryMatchOperator + :keyword selector: When matchVariable is a collection, operator used to specify which elements + in the collection this rule applies to. + :paramtype selector: str + :keyword state: Defines the state of log scrubbing rule. Default value is Enabled. Known values + are: "Enabled" and "Disabled". + :paramtype state: str or ~azure.mgmt.network.v2023_09_01.models.ScrubbingRuleEntryState + """ + super().__init__(**kwargs) + self.match_variable = match_variable + self.selector_match_operator = selector_match_operator + self.selector = selector + self.state = state diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_network_management_client_enums.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_network_management_client_enums.py new file mode 100644 index 00000000000..84e09a2bb04 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_network_management_client_enums.py @@ -0,0 +1,1933 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class Access(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Access to be allowed or denied.""" + + ALLOW = "Allow" + DENY = "Deny" + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the action to take on rule match.""" + + ANOMALY_SCORING = "AnomalyScoring" + ALLOW = "Allow" + BLOCK = "Block" + LOG = "Log" + JS_CHALLENGE = "JSChallenge" + + +class AddressPrefixType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Address prefix type.""" + + IP_PREFIX = "IPPrefix" + SERVICE_TAG = "ServiceTag" + + +class AdminRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the rule is custom or default.""" + + CUSTOM = "Custom" + DEFAULT = "Default" + + +class AdminState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Property to indicate if the Express Route Gateway serves traffic when there are multiple + Express Route Gateways in the vnet. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class ApplicationGatewayBackendHealthServerHealth(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Health of backend server.""" + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + PARTIAL = "Partial" + DRAINING = "Draining" + + +class ApplicationGatewayClientRevocationOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Verify client certificate revocation status.""" + + NONE = "None" + OCSP = "OCSP" + + +class ApplicationGatewayCookieBasedAffinity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Cookie based affinity.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class ApplicationGatewayCustomErrorStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status code of the application gateway custom error.""" + + HTTP_STATUS400 = "HttpStatus400" + HTTP_STATUS403 = "HttpStatus403" + HTTP_STATUS404 = "HttpStatus404" + HTTP_STATUS405 = "HttpStatus405" + HTTP_STATUS408 = "HttpStatus408" + HTTP_STATUS500 = "HttpStatus500" + HTTP_STATUS502 = "HttpStatus502" + HTTP_STATUS503 = "HttpStatus503" + HTTP_STATUS504 = "HttpStatus504" + + +class ApplicationGatewayFirewallMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Web application firewall mode.""" + + DETECTION = "Detection" + PREVENTION = "Prevention" + + +class ApplicationGatewayFirewallRateLimitDuration(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Duration over which Rate Limit policy will be applied. Applies only when ruleType is + RateLimitRule. + """ + + ONE_MIN = "OneMin" + FIVE_MINS = "FiveMins" + + +class ApplicationGatewayFirewallUserSessionVariable(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """User Session clause variable.""" + + CLIENT_ADDR = "ClientAddr" + GEO_LOCATION = "GeoLocation" + NONE = "None" + + +class ApplicationGatewayLoadDistributionAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Load Distribution Algorithm enums.""" + + ROUND_ROBIN = "RoundRobin" + LEAST_CONNECTIONS = "LeastConnections" + IP_HASH = "IpHash" + + +class ApplicationGatewayOperationalState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Operational state of the application gateway resource.""" + + STOPPED = "Stopped" + STARTING = "Starting" + RUNNING = "Running" + STOPPING = "Stopping" + + +class ApplicationGatewayProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Application Gateway protocol.""" + + HTTP = "Http" + """Supported for httpListeners and backendHttpSettingsCollection properties.""" + HTTPS = "Https" + """Supported for httpListeners and backendHttpSettingsCollection properties.""" + TCP = "Tcp" + """Supported for listeners and backendSettingsCollection properties.""" + TLS = "Tls" + """Supported for listeners and backendSettingsCollection properties.""" + + +class ApplicationGatewayRedirectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Redirect type enum.""" + + PERMANENT = "Permanent" + FOUND = "Found" + SEE_OTHER = "SeeOther" + TEMPORARY = "Temporary" + + +class ApplicationGatewayRequestRoutingRuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Rule type.""" + + BASIC = "Basic" + PATH_BASED_ROUTING = "PathBasedRouting" + + +class ApplicationGatewayRuleSetStatusOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The rule set status.""" + + PREVIEW = "Preview" + GA = "GA" + SUPPORTED = "Supported" + DEPRECATED = "Deprecated" + + +class ApplicationGatewaySkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of an application gateway SKU.""" + + STANDARD_SMALL = "Standard_Small" + STANDARD_MEDIUM = "Standard_Medium" + STANDARD_LARGE = "Standard_Large" + WAF_MEDIUM = "WAF_Medium" + WAF_LARGE = "WAF_Large" + STANDARD_V2 = "Standard_v2" + WAF_V2 = "WAF_v2" + BASIC = "Basic" + + +class ApplicationGatewaySslCipherSuite(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Ssl cipher suites enums.""" + + TLS_ECDHE_RSA_WITH_AES256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + TLS_ECDHE_RSA_WITH_AES128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + TLS_ECDHE_RSA_WITH_AES256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + TLS_ECDHE_RSA_WITH_AES128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + TLS_DHE_RSA_WITH_AES256_GCM_SHA384 = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + TLS_DHE_RSA_WITH_AES128_GCM_SHA256 = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + TLS_DHE_RSA_WITH_AES256_CBC_SHA = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + TLS_DHE_RSA_WITH_AES128_CBC_SHA = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + TLS_RSA_WITH_AES256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" + TLS_RSA_WITH_AES128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" + TLS_RSA_WITH_AES256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" + TLS_RSA_WITH_AES128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" + TLS_RSA_WITH_AES256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" + TLS_RSA_WITH_AES128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" + TLS_ECDHE_ECDSA_WITH_AES256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + TLS_ECDHE_ECDSA_WITH_AES128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + TLS_ECDHE_ECDSA_WITH_AES256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + TLS_ECDHE_ECDSA_WITH_AES256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + TLS_DHE_DSS_WITH_AES256_CBC_SHA256 = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + TLS_DHE_DSS_WITH_AES128_CBC_SHA256 = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + TLS_DHE_DSS_WITH_AES256_CBC_SHA = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + TLS_DHE_DSS_WITH_AES128_CBC_SHA = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + TLS_RSA_WITH3_DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + TLS_DHE_DSS_WITH3_DES_EDE_CBC_SHA = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + TLS_ECDHE_RSA_WITH_AES128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + TLS_ECDHE_RSA_WITH_AES256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + + +class ApplicationGatewaySslPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Ssl predefined policy name enums.""" + + APP_GW_SSL_POLICY20150501 = "AppGwSslPolicy20150501" + APP_GW_SSL_POLICY20170401 = "AppGwSslPolicy20170401" + APP_GW_SSL_POLICY20170401_S = "AppGwSslPolicy20170401S" + APP_GW_SSL_POLICY20220101 = "AppGwSslPolicy20220101" + APP_GW_SSL_POLICY20220101_S = "AppGwSslPolicy20220101S" + + +class ApplicationGatewaySslPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of Ssl Policy.""" + + PREDEFINED = "Predefined" + CUSTOM = "Custom" + CUSTOM_V2 = "CustomV2" + + +class ApplicationGatewaySslProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Ssl protocol enums.""" + + TL_SV1_0 = "TLSv1_0" + TL_SV1_1 = "TLSv1_1" + TL_SV1_2 = "TLSv1_2" + TL_SV1_3 = "TLSv1_3" + + +class ApplicationGatewayTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tier of an application gateway.""" + + STANDARD = "Standard" + WAF = "WAF" + STANDARD_V2 = "Standard_v2" + WAF_V2 = "WAF_v2" + BASIC = "Basic" + + +class ApplicationGatewayTierTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ApplicationGatewayTierTypes.""" + + STANDARD = "Standard" + WAF = "WAF" + STANDARD_V2 = "Standard_v2" + WAF_V2 = "WAF_v2" + + +class ApplicationGatewayWafRuleActionTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The string representation of the web application firewall rule action.""" + + NONE = "None" + ANOMALY_SCORING = "AnomalyScoring" + ALLOW = "Allow" + BLOCK = "Block" + LOG = "Log" + + +class ApplicationGatewayWafRuleStateTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The string representation of the web application firewall rule state.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class AssociationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The association type of the child resource to the parent resource.""" + + ASSOCIATED = "Associated" + CONTAINS = "Contains" + + +class AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VPN client authentication method.""" + + EAPTLS = "EAPTLS" + EAPMSCHA_PV2 = "EAPMSCHAPv2" + + +class AuthorizationUseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The authorization use status.""" + + AVAILABLE = "Available" + IN_USE = "InUse" + + +class AutoLearnPrivateRangesMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operation mode for automatically learning private ranges to not be SNAT.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class AzureFirewallApplicationRuleProtocolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol type of a Application Rule resource.""" + + HTTP = "Http" + HTTPS = "Https" + MSSQL = "Mssql" + + +class AzureFirewallNatRCActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The action type of a NAT rule collection.""" + + SNAT = "Snat" + DNAT = "Dnat" + + +class AzureFirewallNetworkRuleProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol of a Network Rule resource.""" + + TCP = "TCP" + UDP = "UDP" + ANY = "Any" + ICMP = "ICMP" + + +class AzureFirewallPacketCaptureFlagsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The flags type to be captured.""" + + FIN = "fin" + SYN = "syn" + RST = "rst" + PUSH = "push" + ACK = "ack" + URG = "urg" + + +class AzureFirewallRCActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The action type of a rule collection.""" + + ALLOW = "Allow" + DENY = "Deny" + + +class AzureFirewallSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of an Azure Firewall SKU.""" + + AZFW_VNET = "AZFW_VNet" + AZFW_HUB = "AZFW_Hub" + + +class AzureFirewallSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tier of an Azure Firewall.""" + + STANDARD = "Standard" + PREMIUM = "Premium" + BASIC = "Basic" + + +class AzureFirewallThreatIntelMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operation mode for Threat Intel.""" + + ALERT = "Alert" + DENY = "Deny" + OFF = "Off" + + +class BastionConnectProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol used to connect to the target.""" + + SSH = "SSH" + RDP = "RDP" + + +class BastionHostSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of this Bastion Host.""" + + BASIC = "Basic" + STANDARD = "Standard" + DEVELOPER = "Developer" + + +class BgpPeerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The BGP peer state.""" + + UNKNOWN = "Unknown" + STOPPED = "Stopped" + IDLE = "Idle" + CONNECTING = "Connecting" + CONNECTED = "Connected" + + +class CircuitConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Express Route Circuit connection state.""" + + CONNECTED = "Connected" + CONNECTING = "Connecting" + DISCONNECTED = "Disconnected" + + +class CommissionedState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The commissioned state of the Custom IP Prefix.""" + + PROVISIONING = "Provisioning" + PROVISIONED = "Provisioned" + COMMISSIONING = "Commissioning" + COMMISSIONED_NO_INTERNET_ADVERTISE = "CommissionedNoInternetAdvertise" + COMMISSIONED = "Commissioned" + DECOMMISSIONING = "Decommissioning" + DEPROVISIONING = "Deprovisioning" + DEPROVISIONED = "Deprovisioned" + + +class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Configuration Deployment Type.""" + + SECURITY_ADMIN = "SecurityAdmin" + CONNECTIVITY = "Connectivity" + + +class ConnectionMonitorEndpointFilterItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of item included in the filter. Currently only 'AgentAddress' is supported.""" + + AGENT_ADDRESS = "AgentAddress" + + +class ConnectionMonitorEndpointFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The behavior of the endpoint filter. Currently only 'Include' is supported.""" + + INCLUDE = "Include" + + +class ConnectionMonitorSourceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of connection monitor source.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + INACTIVE = "Inactive" + + +class ConnectionMonitorTestConfigurationProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol to use in test evaluation.""" + + TCP = "Tcp" + HTTP = "Http" + ICMP = "Icmp" + + +class ConnectionMonitorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of connection monitor.""" + + MULTI_ENDPOINT = "MultiEndpoint" + SINGLE_SOURCE_DESTINATION = "SingleSourceDestination" + + +class ConnectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The connection state.""" + + REACHABLE = "Reachable" + UNREACHABLE = "Unreachable" + UNKNOWN = "Unknown" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The connection status.""" + + UNKNOWN = "Unknown" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DEGRADED = "Degraded" + + +class ConnectivityTopology(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Connectivity topology type.""" + + HUB_AND_SPOKE = "HubAndSpoke" + MESH = "Mesh" + + +class CoverageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Test coverage for the endpoint.""" + + DEFAULT = "Default" + LOW = "Low" + BELOW_AVERAGE = "BelowAverage" + AVERAGE = "Average" + ABOVE_AVERAGE = "AboveAverage" + FULL = "Full" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class CustomIpPrefixType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of custom IP prefix. Should be Singular, Parent, or Child.""" + + SINGULAR = "Singular" + PARENT = "Parent" + CHILD = "Child" + + +class DdosSettingsProtectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The DDoS protection mode of the public IP.""" + + VIRTUAL_NETWORK_INHERITED = "VirtualNetworkInherited" + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class DeleteExistingPeering(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Flag if need to remove current existing peerings.""" + + FALSE = "False" + TRUE = "True" + + +class DeleteOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify what happens to the public IP address when the VM using it is deleted.""" + + DELETE = "Delete" + DETACH = "Detach" + + +class DeploymentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Deployment Status.""" + + NOT_STARTED = "NotStarted" + DEPLOYING = "Deploying" + DEPLOYED = "Deployed" + FAILED = "Failed" + + +class DestinationPortBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Destination port behavior.""" + + NONE = "None" + LISTEN_IF_AVAILABLE = "ListenIfAvailable" + + +class DhGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The DH Groups used in IKE Phase 1 for initial SA.""" + + NONE = "None" + DH_GROUP1 = "DHGroup1" + DH_GROUP2 = "DHGroup2" + DH_GROUP14 = "DHGroup14" + DH_GROUP2048 = "DHGroup2048" + ECP256 = "ECP256" + ECP384 = "ECP384" + DH_GROUP24 = "DHGroup24" + + +class Direction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The direction of the traffic.""" + + INBOUND = "Inbound" + OUTBOUND = "Outbound" + + +class EffectiveAdminRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the rule is custom or default.""" + + CUSTOM = "Custom" + DEFAULT = "Default" + + +class EffectiveRouteSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Who created the route.""" + + UNKNOWN = "Unknown" + USER = "User" + VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" + DEFAULT = "Default" + + +class EffectiveRouteState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The value of effective route.""" + + ACTIVE = "Active" + INVALID = "Invalid" + + +class EffectiveSecurityRuleProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network protocol this rule applies to.""" + + TCP = "Tcp" + UDP = "Udp" + ALL = "All" + + +class EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The endpoint type.""" + + AZURE_VM = "AzureVM" + AZURE_V_NET = "AzureVNet" + AZURE_SUBNET = "AzureSubnet" + EXTERNAL_ADDRESS = "ExternalAddress" + MMA_WORKSPACE_MACHINE = "MMAWorkspaceMachine" + MMA_WORKSPACE_NETWORK = "MMAWorkspaceNetwork" + AZURE_ARC_VM = "AzureArcVM" + AZURE_VMSS = "AzureVMSS" + + +class EvaluationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Connectivity analysis evaluation state.""" + + NOT_STARTED = "NotStarted" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + + +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The advertised public prefix state of the Peering resource.""" + + NOT_CONFIGURED = "NotConfigured" + CONFIGURING = "Configuring" + CONFIGURED = "Configured" + VALIDATION_NEEDED = "ValidationNeeded" + + +class ExpressRouteCircuitPeeringState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state of peering.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class ExpressRouteCircuitSkuFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The family of the SKU.""" + + UNLIMITED_DATA = "UnlimitedData" + METERED_DATA = "MeteredData" + + +class ExpressRouteCircuitSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The tier of the SKU.""" + + STANDARD = "Standard" + PREMIUM = "Premium" + BASIC = "Basic" + LOCAL = "Local" + + +class ExpressRouteLinkAdminState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Administrative state of the physical port.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class ExpressRouteLinkConnectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Physical fiber port type.""" + + LC = "LC" + SC = "SC" + + +class ExpressRouteLinkMacSecCipher(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mac security cipher.""" + + GCM_AES256 = "GcmAes256" + GCM_AES128 = "GcmAes128" + GCM_AES_XPN128 = "GcmAesXpn128" + GCM_AES_XPN256 = "GcmAesXpn256" + + +class ExpressRouteLinkMacSecSciState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Sci mode enabled/disabled.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class ExpressRoutePeeringState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state of peering.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class ExpressRoutePeeringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The peering type.""" + + AZURE_PUBLIC_PEERING = "AzurePublicPeering" + AZURE_PRIVATE_PEERING = "AzurePrivatePeering" + MICROSOFT_PEERING = "MicrosoftPeering" + + +class ExpressRoutePortAuthorizationUseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The authorization use status.""" + + AVAILABLE = "Available" + IN_USE = "InUse" + + +class ExpressRoutePortsBillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The billing type of the ExpressRoutePort resource.""" + + METERED_DATA = "MeteredData" + UNLIMITED_DATA = "UnlimitedData" + + +class ExpressRoutePortsEncapsulation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Encapsulation method on physical ports.""" + + DOT1_Q = "Dot1Q" + QIN_Q = "QinQ" + + +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The supported ExtendedLocation types. Currently only EdgeZone is supported in Microsoft.Network + resources. + """ + + EDGE_ZONE = "EdgeZone" + + +class FirewallPolicyFilterRuleCollectionActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The action type of a rule.""" + + ALLOW = "Allow" + DENY = "Deny" + + +class FirewallPolicyIDPSQuerySortOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes if results should be in ascending/descending order.""" + + ASCENDING = "Ascending" + DESCENDING = "Descending" + + +class FirewallPolicyIDPSSignatureDirection(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes in which direction signature is being enforced: 0 - OutBound, 1 - InBound, 2 - Any, 3 + - Internal, 4 - InternalOutbound. + """ + + ZERO = 0 + ONE = 1 + TWO = 2 + THREE = 3 + FOUR = 4 + + +class FirewallPolicyIDPSSignatureMode(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny.""" + + ZERO = 0 + ONE = 1 + TWO = 2 + + +class FirewallPolicyIDPSSignatureSeverity(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low.""" + + ONE = 1 + TWO = 2 + THREE = 3 + + +class FirewallPolicyIntrusionDetectionProfileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Possible Intrusion Detection profile values.""" + + BASIC = "Basic" + STANDARD = "Standard" + ADVANCED = "Advanced" + EXTENDED = "Extended" + + +class FirewallPolicyIntrusionDetectionProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Possible intrusion detection bypass traffic protocols.""" + + TCP = "TCP" + UDP = "UDP" + ICMP = "ICMP" + ANY = "ANY" + + +class FirewallPolicyIntrusionDetectionStateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Possible state values.""" + + OFF = "Off" + ALERT = "Alert" + DENY = "Deny" + + +class FirewallPolicyNatRuleCollectionActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The action type of a rule.""" + + DNAT = "DNAT" + + +class FirewallPolicyRuleApplicationProtocolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The application protocol type of a Rule.""" + + HTTP = "Http" + HTTPS = "Https" + + +class FirewallPolicyRuleCollectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the rule collection.""" + + FIREWALL_POLICY_NAT_RULE_COLLECTION = "FirewallPolicyNatRuleCollection" + FIREWALL_POLICY_FILTER_RULE_COLLECTION = "FirewallPolicyFilterRuleCollection" + + +class FirewallPolicyRuleNetworkProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Network protocol of a Rule.""" + + TCP = "TCP" + UDP = "UDP" + ANY = "Any" + ICMP = "ICMP" + + +class FirewallPolicyRuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Rule Type.""" + + APPLICATION_RULE = "ApplicationRule" + NETWORK_RULE = "NetworkRule" + NAT_RULE = "NatRule" + + +class FirewallPolicySkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tier of Firewall Policy.""" + + STANDARD = "Standard" + PREMIUM = "Premium" + BASIC = "Basic" + + +class FlowLogFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The file type of flow log.""" + + JSON = "JSON" + + +class GatewayLoadBalancerTunnelInterfaceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Traffic type of gateway load balancer tunnel interface.""" + + NONE = "None" + INTERNAL = "Internal" + EXTERNAL = "External" + + +class GatewayLoadBalancerTunnelProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Protocol of gateway load balancer tunnel interface.""" + + NONE = "None" + NATIVE = "Native" + VXLAN = "VXLAN" + + +class Geo(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Geo for CIDR advertising. Should be an Geo code.""" + + GLOBAL_ENUM = "GLOBAL" + AFRI = "AFRI" + APAC = "APAC" + EURO = "EURO" + LATAM = "LATAM" + NAM = "NAM" + ME = "ME" + OCEANIA = "OCEANIA" + AQ = "AQ" + + +class GroupConnectivity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Group connectivity type.""" + + NONE = "None" + DIRECTLY_CONNECTED = "DirectlyConnected" + + +class HTTPConfigurationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The HTTP method to use.""" + + GET = "Get" + POST = "Post" + + +class HTTPMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """HTTP method.""" + + GET = "Get" + + +class HubBgpConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the VirtualHub to Peer.""" + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + + +class HubRoutingPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The hub routing preference gateway types.""" + + EXPRESS_ROUTE = "ExpressRoute" + VPN_GATEWAY = "VpnGateway" + AS_PATH = "ASPath" + + +class HubVirtualNetworkConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the VirtualHub to vnet connection.""" + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + + +class IkeEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IKE encryption algorithm (IKE phase 2).""" + + DES = "DES" + DES3 = "DES3" + AES128 = "AES128" + AES192 = "AES192" + AES256 = "AES256" + GCMAES256 = "GCMAES256" + GCMAES128 = "GCMAES128" + + +class IkeIntegrity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IKE integrity algorithm (IKE phase 2).""" + + MD5 = "MD5" + SHA1 = "SHA1" + SHA256 = "SHA256" + SHA384 = "SHA384" + GCMAES256 = "GCMAES256" + GCMAES128 = "GCMAES128" + + +class InboundSecurityRulesProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Protocol. This should be either TCP or UDP.""" + + TCP = "TCP" + UDP = "UDP" + + +class IPAllocationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IP address allocation method.""" + + STATIC = "Static" + DYNAMIC = "Dynamic" + + +class IpAllocationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IpAllocation type.""" + + UNDEFINED = "Undefined" + HYPERNET = "Hypernet" + + +class IpFlowProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Protocol to be verified on.""" + + TCP = "TCP" + UDP = "UDP" + + +class IpsecEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IPSec encryption algorithm (IKE phase 1).""" + + NONE = "None" + DES = "DES" + DES3 = "DES3" + AES128 = "AES128" + AES192 = "AES192" + AES256 = "AES256" + GCMAES128 = "GCMAES128" + GCMAES192 = "GCMAES192" + GCMAES256 = "GCMAES256" + + +class IpsecIntegrity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IPSec integrity algorithm (IKE phase 1).""" + + MD5 = "MD5" + SHA1 = "SHA1" + SHA256 = "SHA256" + GCMAES128 = "GCMAES128" + GCMAES192 = "GCMAES192" + GCMAES256 = "GCMAES256" + + +class IPVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IP address version.""" + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + + +class IsGlobal(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Flag if global mesh is supported.""" + + FALSE = "False" + TRUE = "True" + + +class IssueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of issue.""" + + UNKNOWN = "Unknown" + AGENT_STOPPED = "AgentStopped" + GUEST_FIREWALL = "GuestFirewall" + DNS_RESOLUTION = "DnsResolution" + SOCKET_BIND = "SocketBind" + NETWORK_SECURITY_RULE = "NetworkSecurityRule" + USER_DEFINED_ROUTE = "UserDefinedRoute" + PORT_THROTTLED = "PortThrottled" + PLATFORM = "Platform" + + +class IsWorkloadProtected(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Value indicating whether the IP address is DDoS workload protected or not.""" + + FALSE = "False" + TRUE = "True" + + +class LoadBalancerBackendAddressAdminState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A list of administrative states which once set can override health probe so that Load Balancer + will always forward new connections to backend, or deny new connections and reset existing + connections. + """ + + NONE = "None" + UP = "Up" + DOWN = "Down" + + +class LoadBalancerOutboundRuleProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol for the outbound rule in load balancer.""" + + TCP = "Tcp" + UDP = "Udp" + ALL = "All" + + +class LoadBalancerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of a load balancer SKU.""" + + BASIC = "Basic" + STANDARD = "Standard" + GATEWAY = "Gateway" + + +class LoadBalancerSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tier of a load balancer SKU.""" + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + + +class LoadDistribution(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The load distribution policy for this rule.""" + + DEFAULT = "Default" + SOURCE_IP = "SourceIP" + SOURCE_IP_PROTOCOL = "SourceIPProtocol" + + +class ManagedRuleEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state of the managed rule. Defaults to Disabled if not specified.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class NatGatewaySkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of Nat Gateway SKU.""" + + STANDARD = "Standard" + + +class NetworkIntentPolicyBasedService(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network intent policy based services.""" + + NONE = "None" + ALL = "All" + ALLOW_RULES_ONLY = "AllowRulesOnly" + + +class NetworkInterfaceAuxiliaryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Auxiliary mode of Network Interface resource.""" + + NONE = "None" + MAX_CONNECTIONS = "MaxConnections" + FLOATING = "Floating" + ACCELERATED_CONNECTIONS = "AcceleratedConnections" + + +class NetworkInterfaceAuxiliarySku(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Auxiliary sku of Network Interface resource.""" + + NONE = "None" + A1 = "A1" + A2 = "A2" + A4 = "A4" + A8 = "A8" + + +class NetworkInterfaceMigrationPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Migration phase of Network Interface resource.""" + + NONE = "None" + PREPARE = "Prepare" + COMMIT = "Commit" + ABORT = "Abort" + COMMITTED = "Committed" + + +class NetworkInterfaceNicType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of Network Interface resource.""" + + STANDARD = "Standard" + ELASTIC = "Elastic" + + +class NetworkOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the Azure async operation.""" + + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + + +class NextHopType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Next hop type.""" + + INTERNET = "Internet" + VIRTUAL_APPLIANCE = "VirtualAppliance" + VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" + VNET_LOCAL = "VnetLocal" + HYPER_NET_GATEWAY = "HyperNetGateway" + NONE = "None" + + +class NextStep(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Supported next step behaviors after a rule is applied to a matched route.""" + + UNKNOWN = "Unknown" + CONTINUE_ENUM = "Continue" + TERMINATE = "Terminate" + + +class OfficeTrafficCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The office traffic category.""" + + OPTIMIZE = "Optimize" + OPTIMIZE_AND_ALLOW = "OptimizeAndAllow" + ALL = "All" + NONE = "None" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The origin of the issue.""" + + LOCAL = "Local" + INBOUND = "Inbound" + OUTBOUND = "Outbound" + + +class OutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Connection monitor output destination type. Currently, only "Workspace" is supported.""" + + WORKSPACE = "Workspace" + + +class OwaspCrsExclusionEntryMatchVariable(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The variable to be excluded.""" + + REQUEST_HEADER_NAMES = "RequestHeaderNames" + REQUEST_COOKIE_NAMES = "RequestCookieNames" + REQUEST_ARG_NAMES = "RequestArgNames" + REQUEST_HEADER_KEYS = "RequestHeaderKeys" + REQUEST_HEADER_VALUES = "RequestHeaderValues" + REQUEST_COOKIE_KEYS = "RequestCookieKeys" + REQUEST_COOKIE_VALUES = "RequestCookieValues" + REQUEST_ARG_KEYS = "RequestArgKeys" + REQUEST_ARG_VALUES = "RequestArgValues" + + +class OwaspCrsExclusionEntrySelectorMatchOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """When matchVariable is a collection, operate on the selector to specify which elements in the + collection this exclusion applies to. + """ + + EQUALS = "Equals" + CONTAINS = "Contains" + STARTS_WITH = "StartsWith" + ENDS_WITH = "EndsWith" + EQUALS_ANY = "EqualsAny" + + +class PacketCaptureTargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Target type of the resource provided.""" + + AZURE_VM = "AzureVM" + AZURE_VMSS = "AzureVMSS" + + +class PcError(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """PcError.""" + + INTERNAL_ERROR = "InternalError" + AGENT_STOPPED = "AgentStopped" + CAPTURE_FAILED = "CaptureFailed" + LOCAL_FILE_FAILED = "LocalFileFailed" + STORAGE_FAILED = "StorageFailed" + + +class PcProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Protocol to be filtered on.""" + + TCP = "TCP" + UDP = "UDP" + ANY = "Any" + + +class PcStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of the packet capture session.""" + + NOT_STARTED = "NotStarted" + RUNNING = "Running" + STOPPED = "Stopped" + ERROR = "Error" + UNKNOWN = "Unknown" + + +class PfsGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Pfs Groups used in IKE Phase 2 for new child SA.""" + + NONE = "None" + PFS1 = "PFS1" + PFS2 = "PFS2" + PFS2048 = "PFS2048" + ECP256 = "ECP256" + ECP384 = "ECP384" + PFS24 = "PFS24" + PFS14 = "PFS14" + PFSMM = "PFSMM" + + +class PreferredIPVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The preferred IP version to use in test evaluation. The connection monitor may choose to use a + different version depending on other parameters. + """ + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + + +class PreferredRoutingGateway(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The preferred routing gateway types.""" + + EXPRESS_ROUTE = "ExpressRoute" + VPN_GATEWAY = "VpnGateway" + NONE = "None" + + +class ProbeProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe + to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI + is required for the probe to be successful. + """ + + HTTP = "Http" + TCP = "Tcp" + HTTPS = "Https" + + +class ProcessorArchitecture(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VPN client Processor Architecture.""" + + AMD64 = "Amd64" + X86 = "X86" + + +class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network protocol.""" + + TCP = "Tcp" + HTTP = "Http" + HTTPS = "Https" + ICMP = "Icmp" + + +class ProtocolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """RNM supported protocol types.""" + + DO_NOT_USE = "DoNotUse" + ICMP = "Icmp" + TCP = "Tcp" + UDP = "Udp" + GRE = "Gre" + ESP = "Esp" + AH = "Ah" + VXLAN = "Vxlan" + ALL = "All" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + DELETING = "Deleting" + FAILED = "Failed" + + +class PublicIpAddressDnsSettingsDomainNameLabelScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The domain name label scope. If a domain name label and a domain name label scope are + specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system with + a hashed value includes in FQDN. + """ + + TENANT_REUSE = "TenantReuse" + SUBSCRIPTION_REUSE = "SubscriptionReuse" + RESOURCE_GROUP_REUSE = "ResourceGroupReuse" + NO_REUSE = "NoReuse" + + +class PublicIPAddressMigrationPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Migration phase of Public IP Address.""" + + NONE = "None" + PREPARE = "Prepare" + COMMIT = "Commit" + ABORT = "Abort" + COMMITTED = "Committed" + + +class PublicIPAddressSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of a public IP address SKU.""" + + BASIC = "Basic" + STANDARD = "Standard" + + +class PublicIPAddressSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tier of a public IP address SKU.""" + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + + +class PublicIPPrefixSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of a public IP prefix SKU.""" + + STANDARD = "Standard" + + +class PublicIPPrefixSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tier of a public IP prefix SKU.""" + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + + +class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes + both an implicitly created identity and a set of user assigned identities. The type 'None' will + remove any identities from the virtual machine. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + + +class RouteFilterRuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The rule type of the rule.""" + + COMMUNITY = "Community" + + +class RouteMapActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Kind of actions which can be taken on a matched route. Add, Replace, Remove refer to parameters + on the route, like community or prefix. + """ + + UNKNOWN = "Unknown" + REMOVE = "Remove" + ADD = "Add" + REPLACE = "Replace" + DROP = "Drop" + + +class RouteMapMatchCondition(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Match condition to apply RouteMap rules.""" + + UNKNOWN = "Unknown" + CONTAINS = "Contains" + EQUALS = "Equals" + NOT_CONTAINS = "NotContains" + NOT_EQUALS = "NotEquals" + + +class RouteNextHopType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of Azure hop the packet should be sent to.""" + + VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" + VNET_LOCAL = "VnetLocal" + INTERNET = "Internet" + VIRTUAL_APPLIANCE = "VirtualAppliance" + NONE = "None" + + +class RoutingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current routing state of the VirtualHub.""" + + NONE = "None" + PROVISIONED = "Provisioned" + PROVISIONING = "Provisioning" + FAILED = "Failed" + + +class ScopeConnectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current scope connection state.""" + + CONNECTED = "Connected" + PENDING = "Pending" + CONFLICT = "Conflict" + REVOKED = "Revoked" + REJECTED = "Rejected" + + +class ScrubbingRuleEntryMatchOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """When matchVariable is a collection, operate on the selector to specify which elements in the + collection this rule applies to. + """ + + EQUALS = "Equals" + EQUALS_ANY = "EqualsAny" + + +class ScrubbingRuleEntryMatchVariable(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The variable to be scrubbed from the logs.""" + + REQUEST_HEADER_NAMES = "RequestHeaderNames" + REQUEST_COOKIE_NAMES = "RequestCookieNames" + REQUEST_ARG_NAMES = "RequestArgNames" + REQUEST_POST_ARG_NAMES = "RequestPostArgNames" + REQUEST_JSON_ARG_NAMES = "RequestJSONArgNames" + REQUEST_IP_ADDRESS = "RequestIPAddress" + + +class ScrubbingRuleEntryState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the state of log scrubbing rule. Default value is Enabled.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class SecurityConfigurationRuleAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether network traffic is allowed or denied.""" + + ALLOW = "Allow" + DENY = "Deny" + ALWAYS_ALLOW = "AlwaysAllow" + + +class SecurityConfigurationRuleDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The direction of the rule. The direction specifies if the rule will be evaluated on incoming or + outgoing traffic. + """ + + INBOUND = "Inbound" + OUTBOUND = "Outbound" + + +class SecurityConfigurationRuleProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network protocol this rule applies to.""" + + TCP = "Tcp" + UDP = "Udp" + ICMP = "Icmp" + ESP = "Esp" + ANY = "Any" + AH = "Ah" + + +class SecurityPartnerProviderConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the connection with Security Partner Provider.""" + + UNKNOWN = "Unknown" + PARTIALLY_CONNECTED = "PartiallyConnected" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + + +class SecurityProviderName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Security Providers.""" + + Z_SCALER = "ZScaler" + I_BOSS = "IBoss" + CHECKPOINT = "Checkpoint" + + +class SecurityRuleAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether network traffic is allowed or denied.""" + + ALLOW = "Allow" + DENY = "Deny" + + +class SecurityRuleDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The direction of the rule. The direction specifies if rule will be evaluated on incoming or + outgoing traffic. + """ + + INBOUND = "Inbound" + OUTBOUND = "Outbound" + + +class SecurityRuleProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network protocol this rule applies to.""" + + TCP = "Tcp" + UDP = "Udp" + ICMP = "Icmp" + ESP = "Esp" + ASTERISK = "*" + AH = "Ah" + + +class ServiceProviderProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The ServiceProviderProvisioningState state of the resource.""" + + NOT_PROVISIONED = "NotProvisioned" + PROVISIONING = "Provisioning" + PROVISIONED = "Provisioned" + DEPROVISIONING = "Deprovisioning" + + +class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The severity of the issue.""" + + ERROR = "Error" + WARNING = "Warning" + + +class SlotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies slot info on a cloud service.""" + + PRODUCTION = "Production" + STAGING = "Staging" + + +class SyncMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Backend address synchronous mode for the backend pool.""" + + AUTOMATIC = "Automatic" + MANUAL = "Manual" + + +class SyncRemoteAddressSpace(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SyncRemoteAddressSpace.""" + + TRUE = "true" + + +class TransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The transport protocol for the endpoint.""" + + UDP = "Udp" + TCP = "Tcp" + ALL = "All" + + +class TunnelConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the tunnel.""" + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + + +class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An enum describing the unit of measurement.""" + + COUNT = "Count" + + +class UseHubGateway(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Flag if need to use hub gateway.""" + + FALSE = "False" + TRUE = "True" + + +class VerbosityLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Verbosity level.""" + + NORMAL = "Normal" + MINIMUM = "Minimum" + FULL = "Full" + + +class VirtualNetworkEncryptionEnforcement(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If the encrypted VNet allows VM that does not support encryption.""" + + DROP_UNENCRYPTED = "DropUnencrypted" + ALLOW_UNENCRYPTED = "AllowUnencrypted" + + +class VirtualNetworkGatewayConnectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gateway connection type.""" + + DEFAULT = "Default" + RESPONDER_ONLY = "ResponderOnly" + INITIATOR_ONLY = "InitiatorOnly" + + +class VirtualNetworkGatewayConnectionProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gateway connection protocol.""" + + IK_EV2 = "IKEv2" + IK_EV1 = "IKEv1" + + +class VirtualNetworkGatewayConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Virtual Network Gateway connection status.""" + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + + +class VirtualNetworkGatewayConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gateway connection type.""" + + I_PSEC = "IPsec" + VNET2_VNET = "Vnet2Vnet" + EXPRESS_ROUTE = "ExpressRoute" + VPN_CLIENT = "VPNClient" + + +class VirtualNetworkGatewaySkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gateway SKU name.""" + + BASIC = "Basic" + HIGH_PERFORMANCE = "HighPerformance" + STANDARD = "Standard" + ULTRA_PERFORMANCE = "UltraPerformance" + VPN_GW1 = "VpnGw1" + VPN_GW2 = "VpnGw2" + VPN_GW3 = "VpnGw3" + VPN_GW4 = "VpnGw4" + VPN_GW5 = "VpnGw5" + VPN_GW1_AZ = "VpnGw1AZ" + VPN_GW2_AZ = "VpnGw2AZ" + VPN_GW3_AZ = "VpnGw3AZ" + VPN_GW4_AZ = "VpnGw4AZ" + VPN_GW5_AZ = "VpnGw5AZ" + ER_GW1_AZ = "ErGw1AZ" + ER_GW2_AZ = "ErGw2AZ" + ER_GW3_AZ = "ErGw3AZ" + ER_GW_SCALE = "ErGwScale" + + +class VirtualNetworkGatewaySkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gateway SKU tier.""" + + BASIC = "Basic" + HIGH_PERFORMANCE = "HighPerformance" + STANDARD = "Standard" + ULTRA_PERFORMANCE = "UltraPerformance" + VPN_GW1 = "VpnGw1" + VPN_GW2 = "VpnGw2" + VPN_GW3 = "VpnGw3" + VPN_GW4 = "VpnGw4" + VPN_GW5 = "VpnGw5" + VPN_GW1_AZ = "VpnGw1AZ" + VPN_GW2_AZ = "VpnGw2AZ" + VPN_GW3_AZ = "VpnGw3AZ" + VPN_GW4_AZ = "VpnGw4AZ" + VPN_GW5_AZ = "VpnGw5AZ" + ER_GW1_AZ = "ErGw1AZ" + ER_GW2_AZ = "ErGw2AZ" + ER_GW3_AZ = "ErGw3AZ" + ER_GW_SCALE = "ErGwScale" + + +class VirtualNetworkGatewayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of this virtual network gateway.""" + + VPN = "Vpn" + EXPRESS_ROUTE = "ExpressRoute" + LOCAL_GATEWAY = "LocalGateway" + + +class VirtualNetworkPeeringLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The peering sync status of the virtual network peering.""" + + FULLY_IN_SYNC = "FullyInSync" + REMOTE_NOT_IN_SYNC = "RemoteNotInSync" + LOCAL_NOT_IN_SYNC = "LocalNotInSync" + LOCAL_AND_REMOTE_NOT_IN_SYNC = "LocalAndRemoteNotInSync" + + +class VirtualNetworkPeeringState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of the virtual network peering.""" + + INITIATED = "Initiated" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + + +class VirtualNetworkPrivateEndpointNetworkPolicies(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enable or Disable apply network policies on private end point in the subnet.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + NETWORK_SECURITY_GROUP_ENABLED = "NetworkSecurityGroupEnabled" + ROUTE_TABLE_ENABLED = "RouteTableEnabled" + + +class VirtualNetworkPrivateLinkServiceNetworkPolicies(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enable or Disable apply network policies on private link service in the subnet.""" + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class VirtualWanSecurityProviderType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The virtual wan security provider type.""" + + EXTERNAL = "External" + NATIVE = "Native" + + +class VnetLocalRouteOverrideCriteria(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in + spoke vnet. + """ + + CONTAINS = "Contains" + EQUAL = "Equal" + + +class VpnAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VPN authentication types enabled for the virtual network gateway.""" + + CERTIFICATE = "Certificate" + RADIUS = "Radius" + AAD = "AAD" + + +class VpnClientProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VPN client protocol enabled for the virtual network gateway.""" + + IKE_V2 = "IkeV2" + SSTP = "SSTP" + OPEN_VPN = "OpenVPN" + + +class VpnConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the vpn connection.""" + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + + +class VpnGatewayGeneration(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN.""" + + NONE = "None" + GENERATION1 = "Generation1" + GENERATION2 = "Generation2" + + +class VpnGatewayTunnelingProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VPN protocol enabled for the VpnServerConfiguration.""" + + IKE_V2 = "IkeV2" + OPEN_VPN = "OpenVPN" + + +class VpnLinkConnectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Vpn link connection mode.""" + + DEFAULT = "Default" + RESPONDER_ONLY = "ResponderOnly" + INITIATOR_ONLY = "InitiatorOnly" + + +class VpnNatRuleMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Source NAT direction of a VPN NAT.""" + + EGRESS_SNAT = "EgressSnat" + INGRESS_SNAT = "IngressSnat" + + +class VpnNatRuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of NAT rule for VPN NAT.""" + + STATIC = "Static" + DYNAMIC = "Dynamic" + + +class VpnPolicyMemberAttributeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Vpn Policy member attribute type.""" + + CERTIFICATE_GROUP_ID = "CertificateGroupId" + AAD_GROUP_ID = "AADGroupId" + RADIUS_AZURE_GROUP_ID = "RadiusAzureGroupId" + + +class VpnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of this virtual network gateway.""" + + POLICY_BASED = "PolicyBased" + ROUTE_BASED = "RouteBased" + + +class WebApplicationFirewallAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of Actions.""" + + ALLOW = "Allow" + BLOCK = "Block" + LOG = "Log" + JS_CHALLENGE = "JSChallenge" + + +class WebApplicationFirewallEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state of the policy.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class WebApplicationFirewallMatchVariable(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Match Variable.""" + + REMOTE_ADDR = "RemoteAddr" + REQUEST_METHOD = "RequestMethod" + QUERY_STRING = "QueryString" + POST_ARGS = "PostArgs" + REQUEST_URI = "RequestUri" + REQUEST_HEADERS = "RequestHeaders" + REQUEST_BODY = "RequestBody" + REQUEST_COOKIES = "RequestCookies" + + +class WebApplicationFirewallMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode of the policy.""" + + PREVENTION = "Prevention" + DETECTION = "Detection" + + +class WebApplicationFirewallOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operator to be matched.""" + + IP_MATCH = "IPMatch" + EQUAL = "Equal" + CONTAINS = "Contains" + LESS_THAN = "LessThan" + GREATER_THAN = "GreaterThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + BEGINS_WITH = "BeginsWith" + ENDS_WITH = "EndsWith" + REGEX = "Regex" + GEO_MATCH = "GeoMatch" + ANY = "Any" + + +class WebApplicationFirewallPolicyResourceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Resource status of the policy.""" + + CREATING = "Creating" + ENABLING = "Enabling" + ENABLED = "Enabled" + DISABLING = "Disabling" + DISABLED = "Disabled" + DELETING = "Deleting" + + +class WebApplicationFirewallRuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The rule type.""" + + MATCH_RULE = "MatchRule" + RATE_LIMIT_RULE = "RateLimitRule" + INVALID = "Invalid" + + +class WebApplicationFirewallScrubbingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the log scrubbing config. Default value is Enabled.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class WebApplicationFirewallState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not + specified. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class WebApplicationFirewallTransform(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transforms applied before matching.""" + + UPPERCASE = "Uppercase" + LOWERCASE = "Lowercase" + TRIM = "Trim" + URL_DECODE = "UrlDecode" + URL_ENCODE = "UrlEncode" + REMOVE_NULLS = "RemoveNulls" + HTML_ENTITY_DECODE = "HtmlEntityDecode" diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/__init__.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/__init__.py new file mode 100644 index 00000000000..475c77afc39 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/__init__.py @@ -0,0 +1,283 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import ApplicationGatewaysOperations +from ._operations import ApplicationGatewayPrivateLinkResourcesOperations +from ._operations import ApplicationGatewayPrivateEndpointConnectionsOperations +from ._operations import ApplicationGatewayWafDynamicManifestsDefaultOperations +from ._operations import ApplicationGatewayWafDynamicManifestsOperations +from ._operations import ApplicationSecurityGroupsOperations +from ._operations import AvailableDelegationsOperations +from ._operations import AvailableResourceGroupDelegationsOperations +from ._operations import AvailableServiceAliasesOperations +from ._operations import AzureFirewallsOperations +from ._operations import AzureFirewallFqdnTagsOperations +from ._operations import WebCategoriesOperations +from ._operations import BastionHostsOperations +from ._operations import NetworkManagementClientOperationsMixin +from ._operations import NetworkInterfacesOperations +from ._operations import PublicIPAddressesOperations +from ._operations import VipSwapOperations +from ._operations import CustomIPPrefixesOperations +from ._operations import DdosCustomPoliciesOperations +from ._operations import DdosProtectionPlansOperations +from ._operations import DscpConfigurationOperations +from ._operations import AvailableEndpointServicesOperations +from ._operations import ExpressRouteCircuitAuthorizationsOperations +from ._operations import ExpressRouteCircuitPeeringsOperations +from ._operations import ExpressRouteCircuitConnectionsOperations +from ._operations import PeerExpressRouteCircuitConnectionsOperations +from ._operations import ExpressRouteCircuitsOperations +from ._operations import ExpressRouteServiceProvidersOperations +from ._operations import ExpressRouteCrossConnectionsOperations +from ._operations import ExpressRouteCrossConnectionPeeringsOperations +from ._operations import ExpressRoutePortsLocationsOperations +from ._operations import ExpressRoutePortsOperations +from ._operations import ExpressRouteLinksOperations +from ._operations import ExpressRoutePortAuthorizationsOperations +from ._operations import ExpressRouteProviderPortsLocationOperations +from ._operations import FirewallPoliciesOperations +from ._operations import FirewallPolicyRuleCollectionGroupsOperations +from ._operations import FirewallPolicyIdpsSignaturesOperations +from ._operations import FirewallPolicyIdpsSignaturesOverridesOperations +from ._operations import FirewallPolicyIdpsSignaturesFilterValuesOperations +from ._operations import IpAllocationsOperations +from ._operations import IpGroupsOperations +from ._operations import LoadBalancersOperations +from ._operations import LoadBalancerBackendAddressPoolsOperations +from ._operations import LoadBalancerFrontendIPConfigurationsOperations +from ._operations import InboundNatRulesOperations +from ._operations import LoadBalancerLoadBalancingRulesOperations +from ._operations import LoadBalancerOutboundRulesOperations +from ._operations import LoadBalancerNetworkInterfacesOperations +from ._operations import LoadBalancerProbesOperations +from ._operations import NatGatewaysOperations +from ._operations import NetworkInterfaceIPConfigurationsOperations +from ._operations import NetworkInterfaceLoadBalancersOperations +from ._operations import NetworkInterfaceTapConfigurationsOperations +from ._operations import NetworkManagersOperations +from ._operations import NetworkManagerCommitsOperations +from ._operations import NetworkManagerDeploymentStatusOperations +from ._operations import SubscriptionNetworkManagerConnectionsOperations +from ._operations import ManagementGroupNetworkManagerConnectionsOperations +from ._operations import ConnectivityConfigurationsOperations +from ._operations import NetworkGroupsOperations +from ._operations import StaticMembersOperations +from ._operations import ScopeConnectionsOperations +from ._operations import SecurityAdminConfigurationsOperations +from ._operations import AdminRuleCollectionsOperations +from ._operations import AdminRulesOperations +from ._operations import NetworkProfilesOperations +from ._operations import NetworkSecurityGroupsOperations +from ._operations import SecurityRulesOperations +from ._operations import DefaultSecurityRulesOperations +from ._operations import NetworkVirtualAppliancesOperations +from ._operations import VirtualApplianceSitesOperations +from ._operations import VirtualApplianceSkusOperations +from ._operations import InboundSecurityRuleOperations +from ._operations import NetworkWatchersOperations +from ._operations import PacketCapturesOperations +from ._operations import ConnectionMonitorsOperations +from ._operations import FlowLogsOperations +from ._operations import Operations +from ._operations import PrivateEndpointsOperations +from ._operations import AvailablePrivateEndpointTypesOperations +from ._operations import PrivateDnsZoneGroupsOperations +from ._operations import PrivateLinkServicesOperations +from ._operations import PublicIPPrefixesOperations +from ._operations import RouteFiltersOperations +from ._operations import RouteFilterRulesOperations +from ._operations import RouteTablesOperations +from ._operations import RoutesOperations +from ._operations import SecurityPartnerProvidersOperations +from ._operations import BgpServiceCommunitiesOperations +from ._operations import ServiceEndpointPoliciesOperations +from ._operations import ServiceEndpointPolicyDefinitionsOperations +from ._operations import ServiceTagsOperations +from ._operations import ServiceTagInformationOperations +from ._operations import UsagesOperations +from ._operations import VirtualNetworksOperations +from ._operations import SubnetsOperations +from ._operations import ResourceNavigationLinksOperations +from ._operations import ServiceAssociationLinksOperations +from ._operations import VirtualNetworkPeeringsOperations +from ._operations import VirtualNetworkGatewaysOperations +from ._operations import VirtualNetworkGatewayConnectionsOperations +from ._operations import LocalNetworkGatewaysOperations +from ._operations import VirtualNetworkGatewayNatRulesOperations +from ._operations import VirtualNetworkTapsOperations +from ._operations import VirtualRoutersOperations +from ._operations import VirtualRouterPeeringsOperations +from ._operations import VirtualWansOperations +from ._operations import VpnSitesOperations +from ._operations import VpnSiteLinksOperations +from ._operations import VpnSitesConfigurationOperations +from ._operations import VpnServerConfigurationsOperations +from ._operations import ConfigurationPolicyGroupsOperations +from ._operations import VirtualHubsOperations +from ._operations import RouteMapsOperations +from ._operations import HubVirtualNetworkConnectionsOperations +from ._operations import VpnGatewaysOperations +from ._operations import VpnLinkConnectionsOperations +from ._operations import VpnConnectionsOperations +from ._operations import VpnSiteLinkConnectionsOperations +from ._operations import NatRulesOperations +from ._operations import P2SVpnGatewaysOperations +from ._operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from ._operations import VirtualHubRouteTableV2SOperations +from ._operations import ExpressRouteGatewaysOperations +from ._operations import ExpressRouteConnectionsOperations +from ._operations import NetworkVirtualApplianceConnectionsOperations +from ._operations import VirtualHubBgpConnectionOperations +from ._operations import VirtualHubBgpConnectionsOperations +from ._operations import VirtualHubIpConfigurationOperations +from ._operations import HubRouteTablesOperations +from ._operations import RoutingIntentOperations +from ._operations import WebApplicationFirewallPoliciesOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ApplicationGatewaysOperations", + "ApplicationGatewayPrivateLinkResourcesOperations", + "ApplicationGatewayPrivateEndpointConnectionsOperations", + "ApplicationGatewayWafDynamicManifestsDefaultOperations", + "ApplicationGatewayWafDynamicManifestsOperations", + "ApplicationSecurityGroupsOperations", + "AvailableDelegationsOperations", + "AvailableResourceGroupDelegationsOperations", + "AvailableServiceAliasesOperations", + "AzureFirewallsOperations", + "AzureFirewallFqdnTagsOperations", + "WebCategoriesOperations", + "BastionHostsOperations", + "NetworkManagementClientOperationsMixin", + "NetworkInterfacesOperations", + "PublicIPAddressesOperations", + "VipSwapOperations", + "CustomIPPrefixesOperations", + "DdosCustomPoliciesOperations", + "DdosProtectionPlansOperations", + "DscpConfigurationOperations", + "AvailableEndpointServicesOperations", + "ExpressRouteCircuitAuthorizationsOperations", + "ExpressRouteCircuitPeeringsOperations", + "ExpressRouteCircuitConnectionsOperations", + "PeerExpressRouteCircuitConnectionsOperations", + "ExpressRouteCircuitsOperations", + "ExpressRouteServiceProvidersOperations", + "ExpressRouteCrossConnectionsOperations", + "ExpressRouteCrossConnectionPeeringsOperations", + "ExpressRoutePortsLocationsOperations", + "ExpressRoutePortsOperations", + "ExpressRouteLinksOperations", + "ExpressRoutePortAuthorizationsOperations", + "ExpressRouteProviderPortsLocationOperations", + "FirewallPoliciesOperations", + "FirewallPolicyRuleCollectionGroupsOperations", + "FirewallPolicyIdpsSignaturesOperations", + "FirewallPolicyIdpsSignaturesOverridesOperations", + "FirewallPolicyIdpsSignaturesFilterValuesOperations", + "IpAllocationsOperations", + "IpGroupsOperations", + "LoadBalancersOperations", + "LoadBalancerBackendAddressPoolsOperations", + "LoadBalancerFrontendIPConfigurationsOperations", + "InboundNatRulesOperations", + "LoadBalancerLoadBalancingRulesOperations", + "LoadBalancerOutboundRulesOperations", + "LoadBalancerNetworkInterfacesOperations", + "LoadBalancerProbesOperations", + "NatGatewaysOperations", + "NetworkInterfaceIPConfigurationsOperations", + "NetworkInterfaceLoadBalancersOperations", + "NetworkInterfaceTapConfigurationsOperations", + "NetworkManagersOperations", + "NetworkManagerCommitsOperations", + "NetworkManagerDeploymentStatusOperations", + "SubscriptionNetworkManagerConnectionsOperations", + "ManagementGroupNetworkManagerConnectionsOperations", + "ConnectivityConfigurationsOperations", + "NetworkGroupsOperations", + "StaticMembersOperations", + "ScopeConnectionsOperations", + "SecurityAdminConfigurationsOperations", + "AdminRuleCollectionsOperations", + "AdminRulesOperations", + "NetworkProfilesOperations", + "NetworkSecurityGroupsOperations", + "SecurityRulesOperations", + "DefaultSecurityRulesOperations", + "NetworkVirtualAppliancesOperations", + "VirtualApplianceSitesOperations", + "VirtualApplianceSkusOperations", + "InboundSecurityRuleOperations", + "NetworkWatchersOperations", + "PacketCapturesOperations", + "ConnectionMonitorsOperations", + "FlowLogsOperations", + "Operations", + "PrivateEndpointsOperations", + "AvailablePrivateEndpointTypesOperations", + "PrivateDnsZoneGroupsOperations", + "PrivateLinkServicesOperations", + "PublicIPPrefixesOperations", + "RouteFiltersOperations", + "RouteFilterRulesOperations", + "RouteTablesOperations", + "RoutesOperations", + "SecurityPartnerProvidersOperations", + "BgpServiceCommunitiesOperations", + "ServiceEndpointPoliciesOperations", + "ServiceEndpointPolicyDefinitionsOperations", + "ServiceTagsOperations", + "ServiceTagInformationOperations", + "UsagesOperations", + "VirtualNetworksOperations", + "SubnetsOperations", + "ResourceNavigationLinksOperations", + "ServiceAssociationLinksOperations", + "VirtualNetworkPeeringsOperations", + "VirtualNetworkGatewaysOperations", + "VirtualNetworkGatewayConnectionsOperations", + "LocalNetworkGatewaysOperations", + "VirtualNetworkGatewayNatRulesOperations", + "VirtualNetworkTapsOperations", + "VirtualRoutersOperations", + "VirtualRouterPeeringsOperations", + "VirtualWansOperations", + "VpnSitesOperations", + "VpnSiteLinksOperations", + "VpnSitesConfigurationOperations", + "VpnServerConfigurationsOperations", + "ConfigurationPolicyGroupsOperations", + "VirtualHubsOperations", + "RouteMapsOperations", + "HubVirtualNetworkConnectionsOperations", + "VpnGatewaysOperations", + "VpnLinkConnectionsOperations", + "VpnConnectionsOperations", + "VpnSiteLinkConnectionsOperations", + "NatRulesOperations", + "P2SVpnGatewaysOperations", + "VpnServerConfigurationsAssociatedWithVirtualWanOperations", + "VirtualHubRouteTableV2SOperations", + "ExpressRouteGatewaysOperations", + "ExpressRouteConnectionsOperations", + "NetworkVirtualApplianceConnectionsOperations", + "VirtualHubBgpConnectionOperations", + "VirtualHubBgpConnectionsOperations", + "VirtualHubIpConfigurationOperations", + "HubRouteTablesOperations", + "RoutingIntentOperations", + "WebApplicationFirewallPoliciesOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/_operations.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/_operations.py new file mode 100644 index 00000000000..dc73215e738 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/_operations.py @@ -0,0 +1,90443 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, List, Literal, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import NetworkManagementClientMixinABC, _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_application_gateways_delete_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_get_request( + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_request( + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_start_request( + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_stop_request( + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_backend_health_request( # pylint: disable=name-too-long + resource_group_name: str, + application_gateway_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_backend_health_on_demand_request( # pylint: disable=name-too-long + resource_group_name: str, + application_gateway_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_available_server_variables_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_available_request_headers_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_available_response_headers_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_available_waf_rule_sets_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_available_ssl_options_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_list_available_ssl_predefined_policies_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateways_get_ssl_predefined_policy_request( # pylint: disable=name-too-long + predefined_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "predefinedPolicyName": _SERIALIZER.url("predefined_policy_name", predefined_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_private_link_resources_list_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_private_endpoint_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_private_endpoint_connections_update_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_private_endpoint_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_private_endpoint_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, application_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_waf_dynamic_manifests_default_get_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_gateway_waf_dynamic_manifests_get_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_security_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, application_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationSecurityGroupName": _SERIALIZER.url( + "application_security_group_name", application_security_group_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_security_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, application_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationSecurityGroupName": _SERIALIZER.url( + "application_security_group_name", application_security_group_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_security_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, application_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationSecurityGroupName": _SERIALIZER.url( + "application_security_group_name", application_security_group_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_security_groups_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, application_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "applicationSecurityGroupName": _SERIALIZER.url( + "application_security_group_name", application_security_group_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_security_groups_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_application_security_groups_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_delegations_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_resource_group_delegations_list_request( # pylint: disable=name-too-long + location: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_service_aliases_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_service_aliases_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_delete_request( + resource_group_name: str, azure_firewall_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "azureFirewallName": _SERIALIZER.url("azure_firewall_name", azure_firewall_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_get_request( + resource_group_name: str, azure_firewall_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "azureFirewallName": _SERIALIZER.url("azure_firewall_name", azure_firewall_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, azure_firewall_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "azureFirewallName": _SERIALIZER.url( + "azure_firewall_name", azure_firewall_name, "str", max_length=56, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, azure_firewall_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "azureFirewallName": _SERIALIZER.url("azure_firewall_name", azure_firewall_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_list_learned_prefixes_request( # pylint: disable=name-too-long + resource_group_name: str, azure_firewall_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "azureFirewallName": _SERIALIZER.url("azure_firewall_name", azure_firewall_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewalls_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, azure_firewall_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/packetCapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "azureFirewallName": _SERIALIZER.url( + "azure_firewall_name", azure_firewall_name, "str", max_length=56, min_length=1, pattern=r"^[a-zA-Z0-9]" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_azure_firewall_fqdn_tags_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_categories_get_request( + name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}" + ) # pylint: disable=line-too-long + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_categories_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bastion_hosts_delete_request( + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bastion_hosts_get_request( + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bastion_hosts_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bastion_hosts_update_tags_request( + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bastion_hosts_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bastion_hosts_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_put_bastion_shareable_link_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_delete_bastion_shareable_link_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_delete_bastion_shareable_link_by_token_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinksByToken", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_get_bastion_shareable_link_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_get_active_sessions_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_disconnect_active_sessions_request( # pylint: disable=name-too-long + resource_group_name: str, bastion_host_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "bastionHostName": _SERIALIZER.url("bastion_host_name", bastion_host_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_check_dns_name_availability_request( # pylint: disable=name-too-long + location: str, subscription_id: str, *, domain_name_label: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["domainNameLabel"] = _SERIALIZER.query("domain_name_label", domain_name_label, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_express_route_provider_port_request( # pylint: disable=name-too-long + providerport: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "providerport": _SERIALIZER.url("providerport", providerport, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_list_active_connectivity_configurations_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_list_active_security_admin_rules_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_list_network_manager_effective_connectivity_configurations_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_list_network_manager_effective_security_admin_rules_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_supported_security_providers_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_management_generatevirtualwanvpnserverconfigurationvpnprofile_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_cloud_service_role_instance_network_interfaces_request( # pylint: disable=name-too-long + resource_group_name: str, cloud_service_name: str, role_instance_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudServiceName": _SERIALIZER.url("cloud_service_name", cloud_service_name, "str"), + "roleInstanceName": _SERIALIZER.url("role_instance_name", role_instance_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_cloud_service_network_interfaces_request( # pylint: disable=name-too-long + resource_group_name: str, cloud_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudServiceName": _SERIALIZER.url("cloud_service_name", cloud_service_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_get_cloud_service_network_interface_request( # pylint: disable=name-too-long + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudServiceName": _SERIALIZER.url("cloud_service_name", cloud_service_name, "str"), + "roleInstanceName": _SERIALIZER.url("role_instance_name", role_instance_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_delete_request( + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_get_request( + resource_group_name: str, + network_interface_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_get_effective_route_table_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_effective_network_security_groups_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_machine_scale_set_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_get_virtual_machine_scale_set_network_interface_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_list_virtual_machine_scale_set_ip_configurations_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interfaces_get_virtual_machine_scale_set_ip_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "ipConfigurationName": _SERIALIZER.url("ip_configuration_name", ip_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_list_cloud_service_public_ip_addresses_request( # pylint: disable=name-too-long + resource_group_name: str, cloud_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudServiceName": _SERIALIZER.url("cloud_service_name", cloud_service_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_list_cloud_service_role_instance_public_ip_addresses_request( # pylint: disable=name-too-long + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudServiceName": _SERIALIZER.url("cloud_service_name", cloud_service_name, "str"), + "roleInstanceName": _SERIALIZER.url("role_instance_name", role_instance_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "ipConfigurationName": _SERIALIZER.url("ip_configuration_name", ip_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_get_cloud_service_public_ip_address_request( # pylint: disable=name-too-long + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudServiceName": _SERIALIZER.url("cloud_service_name", cloud_service_name, "str"), + "roleInstanceName": _SERIALIZER.url("role_instance_name", role_instance_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "ipConfigurationName": _SERIALIZER.url("ip_configuration_name", ip_configuration_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_delete_request( + resource_group_name: str, public_ip_address_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_get_request( + resource_group_name: str, + public_ip_address_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, public_ip_address_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, public_ip_address_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_list_request( + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_ddos_protection_status_request( # pylint: disable=name-too-long + resource_group_name: str, public_ip_address_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_list_virtual_machine_scale_set_public_ip_addresses_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_machine_scale_set_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_list_virtual_machine_scale_set_vm_public_ip_addresses_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "ipConfigurationName": _SERIALIZER.url("ip_configuration_name", ip_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_addresses_get_virtual_machine_scale_set_public_ip_address_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualMachineScaleSetName": _SERIALIZER.url( + "virtual_machine_scale_set_name", virtual_machine_scale_set_name, "str" + ), + "virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "ipConfigurationName": _SERIALIZER.url("ip_configuration_name", ip_configuration_name, "str"), + "publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vip_swap_get_request(group_name: str, resource_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "groupName": _SERIALIZER.url("group_name", group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "singletonResource": _SERIALIZER.url("singleton_resource", singleton_resource, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vip_swap_create_request( + group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "groupName": _SERIALIZER.url("group_name", group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "singletonResource": _SERIALIZER.url("singleton_resource", singleton_resource, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vip_swap_list_request( + group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots", + ) # pylint: disable=line-too-long + path_format_arguments = { + "groupName": _SERIALIZER.url("group_name", group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_custom_ip_prefixes_delete_request( + resource_group_name: str, custom_ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customIpPrefixName": _SERIALIZER.url("custom_ip_prefix_name", custom_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_custom_ip_prefixes_get_request( + resource_group_name: str, + custom_ip_prefix_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customIpPrefixName": _SERIALIZER.url("custom_ip_prefix_name", custom_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_custom_ip_prefixes_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, custom_ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customIpPrefixName": _SERIALIZER.url("custom_ip_prefix_name", custom_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_custom_ip_prefixes_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, custom_ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customIpPrefixName": _SERIALIZER.url("custom_ip_prefix_name", custom_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_custom_ip_prefixes_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_custom_ip_prefixes_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_custom_policies_delete_request( # pylint: disable=name-too-long + resource_group_name: str, ddos_custom_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosCustomPolicyName": _SERIALIZER.url("ddos_custom_policy_name", ddos_custom_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_custom_policies_get_request( + resource_group_name: str, ddos_custom_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosCustomPolicyName": _SERIALIZER.url("ddos_custom_policy_name", ddos_custom_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_custom_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, ddos_custom_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosCustomPolicyName": _SERIALIZER.url("ddos_custom_policy_name", ddos_custom_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_custom_policies_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, ddos_custom_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosCustomPolicyName": _SERIALIZER.url("ddos_custom_policy_name", ddos_custom_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_protection_plans_delete_request( # pylint: disable=name-too-long + resource_group_name: str, ddos_protection_plan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosProtectionPlanName": _SERIALIZER.url("ddos_protection_plan_name", ddos_protection_plan_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_protection_plans_get_request( + resource_group_name: str, ddos_protection_plan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosProtectionPlanName": _SERIALIZER.url("ddos_protection_plan_name", ddos_protection_plan_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_protection_plans_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, ddos_protection_plan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosProtectionPlanName": _SERIALIZER.url("ddos_protection_plan_name", ddos_protection_plan_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_protection_plans_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, ddos_protection_plan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ddosProtectionPlanName": _SERIALIZER.url("ddos_protection_plan_name", ddos_protection_plan_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_protection_plans_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ddos_protection_plans_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_dscp_configuration_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, dscp_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dscpConfigurationName": _SERIALIZER.url("dscp_configuration_name", dscp_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_dscp_configuration_delete_request( + resource_group_name: str, dscp_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dscpConfigurationName": _SERIALIZER.url("dscp_configuration_name", dscp_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_dscp_configuration_get_request( + resource_group_name: str, dscp_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dscpConfigurationName": _SERIALIZER.url("dscp_configuration_name", dscp_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_dscp_configuration_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_dscp_configuration_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_endpoint_services_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_authorizations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, authorization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_authorizations_get_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, authorization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_authorizations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, authorization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_authorizations_list_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_peerings_delete_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_peerings_get_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_peerings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_peerings_list_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuit_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_peer_express_route_circuit_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_peer_express_route_circuit_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_delete_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_get_request( + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_list_arp_table_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "devicePath": _SERIALIZER.url("device_path", device_path, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_list_routes_table_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "devicePath": _SERIALIZER.url("device_path", device_path, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_list_routes_table_summary_request( # pylint: disable=name-too-long + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "devicePath": _SERIALIZER.url("device_path", device_path, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_get_stats_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_get_peering_stats_request( # pylint: disable=name-too-long + resource_group_name: str, circuit_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "circuitName": _SERIALIZER.url("circuit_name", circuit_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_circuits_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_service_providers_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_list_arp_table_request( # pylint: disable=name-too-long + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "devicePath": _SERIALIZER.url("device_path", device_path, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_list_routes_table_summary_request( # pylint: disable=name-too-long + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "devicePath": _SERIALIZER.url("device_path", device_path, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connections_list_routes_table_request( # pylint: disable=name-too-long + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "devicePath": _SERIALIZER.url("device_path", device_path, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connection_peerings_list_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connection_peerings_delete_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connection_peerings_get_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_cross_connection_peerings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cross_connection_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "crossConnectionName": _SERIALIZER.url("cross_connection_name", cross_connection_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_locations_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_locations_get_request( # pylint: disable=name-too-long + location_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_delete_request( + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_get_request( + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_ports_generate_loa_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_links_get_request( + resource_group_name: str, express_route_port_name: str, link_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + "linkName": _SERIALIZER.url("link_name", link_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_links_list_request( + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_port_authorizations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, authorization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_port_authorizations_get_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, authorization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_port_authorizations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, authorization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_port_authorizations_list_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_port_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRoutePortName": _SERIALIZER.url("express_route_port_name", express_route_port_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_provider_ports_location_list_request( # pylint: disable=name-too-long + subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policies_delete_request( + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policies_get_request( + resource_group_name: str, + firewall_policy_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policies_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policies_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policies_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_rule_collection_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "ruleCollectionGroupName": _SERIALIZER.url("rule_collection_group_name", rule_collection_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_rule_collection_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "ruleCollectionGroupName": _SERIALIZER.url("rule_collection_group_name", rule_collection_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_rule_collection_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "ruleCollectionGroupName": _SERIALIZER.url("rule_collection_group_name", rule_collection_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_rule_collection_groups_list_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_idps_signatures_list_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_idps_signatures_overrides_patch_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_idps_signatures_overrides_put_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_idps_signatures_overrides_get_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_idps_signatures_overrides_list_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_policy_idps_signatures_filter_values_list_request( # pylint: disable=name-too-long + resource_group_name: str, firewall_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "firewallPolicyName": _SERIALIZER.url("firewall_policy_name", firewall_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_allocations_delete_request( + resource_group_name: str, ip_allocation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipAllocationName": _SERIALIZER.url("ip_allocation_name", ip_allocation_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_allocations_get_request( + resource_group_name: str, + ip_allocation_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipAllocationName": _SERIALIZER.url("ip_allocation_name", ip_allocation_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_allocations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, ip_allocation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipAllocationName": _SERIALIZER.url("ip_allocation_name", ip_allocation_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_allocations_update_tags_request( + resource_group_name: str, ip_allocation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipAllocationName": _SERIALIZER.url("ip_allocation_name", ip_allocation_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_allocations_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_allocations_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_groups_get_request( + resource_group_name: str, ip_groups_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipGroupsName": _SERIALIZER.url("ip_groups_name", ip_groups_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_groups_create_or_update_request( + resource_group_name: str, ip_groups_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipGroupsName": _SERIALIZER.url("ip_groups_name", ip_groups_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_groups_update_groups_request( + resource_group_name: str, ip_groups_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipGroupsName": _SERIALIZER.url("ip_groups_name", ip_groups_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_groups_delete_request( + resource_group_name: str, ip_groups_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipGroupsName": _SERIALIZER.url("ip_groups_name", ip_groups_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_groups_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ip_groups_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_delete_request( + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_get_request( + resource_group_name: str, + load_balancer_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_update_tags_request( + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_swap_public_ip_addresses_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_list_inbound_nat_rule_port_mappings_request( # pylint: disable=name-too-long + group_name: str, load_balancer_name: str, backend_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping", + ) # pylint: disable=line-too-long + path_format_arguments = { + "groupName": _SERIALIZER.url("group_name", group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "backendPoolName": _SERIALIZER.url("backend_pool_name", backend_pool_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_migrate_to_ip_based_request( # pylint: disable=name-too-long + group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/migrateToIpBased", + ) # pylint: disable=line-too-long + path_format_arguments = { + "groupName": _SERIALIZER.url("group_name", group_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", load_balancer_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_backend_address_pools_list_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_backend_address_pools_get_request( # pylint: disable=name-too-long + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "backendAddressPoolName": _SERIALIZER.url("backend_address_pool_name", backend_address_pool_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_backend_address_pools_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "backendAddressPoolName": _SERIALIZER.url("backend_address_pool_name", backend_address_pool_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_backend_address_pools_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "backendAddressPoolName": _SERIALIZER.url("backend_address_pool_name", backend_address_pool_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_frontend_ip_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_frontend_ip_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, + load_balancer_name: str, + frontend_ip_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "frontendIPConfigurationName": _SERIALIZER.url( + "frontend_ip_configuration_name", frontend_ip_configuration_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_inbound_nat_rules_list_request( + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_inbound_nat_rules_delete_request( + resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "inboundNatRuleName": _SERIALIZER.url("inbound_nat_rule_name", inbound_nat_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_inbound_nat_rules_get_request( + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "inboundNatRuleName": _SERIALIZER.url("inbound_nat_rule_name", inbound_nat_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_inbound_nat_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "inboundNatRuleName": _SERIALIZER.url("inbound_nat_rule_name", inbound_nat_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_load_balancing_rules_list_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_load_balancing_rules_get_request( # pylint: disable=name-too-long + resource_group_name: str, + load_balancer_name: str, + load_balancing_rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "loadBalancingRuleName": _SERIALIZER.url("load_balancing_rule_name", load_balancing_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_outbound_rules_list_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_outbound_rules_get_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, outbound_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "outboundRuleName": _SERIALIZER.url("outbound_rule_name", outbound_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_network_interfaces_list_request( # pylint: disable=name-too-long + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_probes_list_request( + resource_group_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancer_probes_get_request( + resource_group_name: str, load_balancer_name: str, probe_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + "probeName": _SERIALIZER.url("probe_name", probe_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_gateways_delete_request( + resource_group_name: str, nat_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "natGatewayName": _SERIALIZER.url("nat_gateway_name", nat_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_gateways_get_request( + resource_group_name: str, + nat_gateway_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "natGatewayName": _SERIALIZER.url("nat_gateway_name", nat_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, nat_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "natGatewayName": _SERIALIZER.url("nat_gateway_name", nat_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_gateways_update_tags_request( + resource_group_name: str, nat_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "natGatewayName": _SERIALIZER.url("nat_gateway_name", nat_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_gateways_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_gateways_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_ip_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_ip_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_interface_name: str, + ip_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "ipConfigurationName": _SERIALIZER.url("ip_configuration_name", ip_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_load_balancers_list_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_tap_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "tapConfigurationName": _SERIALIZER.url("tap_configuration_name", tap_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_tap_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "tapConfigurationName": _SERIALIZER.url("tap_configuration_name", tap_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_tap_configurations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "tapConfigurationName": _SERIALIZER.url("tap_configuration_name", tap_configuration_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_interface_tap_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_managers_get_request( + resource_group_name: str, network_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_managers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_managers_delete_request( + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force is not None: + _params["force"] = _SERIALIZER.query("force", force, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_managers_patch_request( + resource_group_name: str, network_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_managers_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_managers_list_request( + resource_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_manager_commits_post_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_manager_deployment_status_list_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subscription_network_manager_connections_create_or_update_request( # pylint: disable=name-too-long + network_manager_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "networkManagerConnectionName": _SERIALIZER.url( + "network_manager_connection_name", network_manager_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subscription_network_manager_connections_get_request( # pylint: disable=name-too-long + network_manager_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "networkManagerConnectionName": _SERIALIZER.url( + "network_manager_connection_name", network_manager_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subscription_network_manager_connections_delete_request( # pylint: disable=name-too-long + network_manager_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "networkManagerConnectionName": _SERIALIZER.url( + "network_manager_connection_name", network_manager_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subscription_network_manager_connections_list_request( # pylint: disable=name-too-long + subscription_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_management_group_network_manager_connections_create_or_update_request( # pylint: disable=name-too-long + management_group_id: str, network_manager_connection_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "networkManagerConnectionName": _SERIALIZER.url( + "network_manager_connection_name", network_manager_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_management_group_network_manager_connections_get_request( # pylint: disable=name-too-long + management_group_id: str, network_manager_connection_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "networkManagerConnectionName": _SERIALIZER.url( + "network_manager_connection_name", network_manager_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_management_group_network_manager_connections_delete_request( # pylint: disable=name-too-long + management_group_id: str, network_manager_connection_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "networkManagerConnectionName": _SERIALIZER.url( + "network_manager_connection_name", network_manager_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_management_group_network_manager_connections_list_request( # pylint: disable=name-too-long + management_group_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connectivity_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connectivity_configurations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connectivity_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force is not None: + _params["force"] = _SERIALIZER.query("force", force, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connectivity_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_groups_get_request( + resource_group_name: str, network_manager_name: str, network_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_groups_delete_request( + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force is not None: + _params["force"] = _SERIALIZER.query("force", force, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_groups_list_request( + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_static_members_get_request( + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + "staticMemberName": _SERIALIZER.url("static_member_name", static_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_static_members_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + "staticMemberName": _SERIALIZER.url("static_member_name", static_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_static_members_delete_request( + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + "staticMemberName": _SERIALIZER.url("static_member_name", static_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_static_members_list_request( + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "networkGroupName": _SERIALIZER.url("network_group_name", network_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_scope_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, scope_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "scopeConnectionName": _SERIALIZER.url("scope_connection_name", scope_connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_scope_connections_get_request( + resource_group_name: str, network_manager_name: str, scope_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "scopeConnectionName": _SERIALIZER.url("scope_connection_name", scope_connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_scope_connections_delete_request( + resource_group_name: str, network_manager_name: str, scope_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "scopeConnectionName": _SERIALIZER.url("scope_connection_name", scope_connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_scope_connections_list_request( + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_admin_configurations_list_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_admin_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_admin_configurations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_manager_name: str, configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_admin_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force is not None: + _params["force"] = _SERIALIZER.query("force", force, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rule_collections_list_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rule_collections_get_request( + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rule_collections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rule_collections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force is not None: + _params["force"] = _SERIALIZER.query("force", force, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rules_list_request( + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=20, minimum=1) + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rules_get_request( + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_admin_rules_delete_request( + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkManagerName": _SERIALIZER.url("network_manager_name", network_manager_name, "str"), + "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if force is not None: + _params["force"] = _SERIALIZER.query("force", force, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_profiles_delete_request( + resource_group_name: str, network_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkProfileName": _SERIALIZER.url("network_profile_name", network_profile_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_profiles_get_request( + resource_group_name: str, + network_profile_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkProfileName": _SERIALIZER.url("network_profile_name", network_profile_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_profiles_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkProfileName": _SERIALIZER.url("network_profile_name", network_profile_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_profiles_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, network_profile_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkProfileName": _SERIALIZER.url("network_profile_name", network_profile_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_profiles_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_profiles_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, network_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_security_group_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_groups_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, network_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_groups_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_groups_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_rules_delete_request( + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "securityRuleName": _SERIALIZER.url("security_rule_name", security_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_rules_get_request( + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "securityRuleName": _SERIALIZER.url("security_rule_name", security_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "securityRuleName": _SERIALIZER.url("security_rule_name", security_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_rules_list_request( + resource_group_name: str, network_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_default_security_rules_list_request( # pylint: disable=name-too-long + resource_group_name: str, network_security_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_default_security_rules_get_request( + resource_group_name: str, + network_security_group_name: str, + default_security_rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, "str"), + "defaultSecurityRuleName": _SERIALIZER.url("default_security_rule_name", default_security_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliances_delete_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliances_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_virtual_appliance_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliances_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliances_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliances_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliances_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_appliance_sites_delete_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "siteName": _SERIALIZER.url("site_name", site_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_appliance_sites_get_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "siteName": _SERIALIZER.url("site_name", site_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_appliance_sites_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "siteName": _SERIALIZER.url("site_name", site_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_appliance_sites_list_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_appliance_skus_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_appliance_skus_get_request(sku_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "skuName": _SERIALIZER.url("sku_name", sku_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_inbound_security_rule_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "ruleCollectionName": _SERIALIZER.url("rule_collection_name", rule_collection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_request( + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_delete_request( + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_topology_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_verify_ip_flow_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_next_hop_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_vm_security_rules_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_troubleshooting_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_troubleshooting_result_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_set_flow_log_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_flow_log_status_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_check_connectivity_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_azure_reachability_report_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_list_available_providers_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_watchers_get_network_configuration_diagnostic_request( # pylint: disable=name-too-long + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_packet_captures_create_request( + resource_group_name: str, network_watcher_name: str, packet_capture_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "packetCaptureName": _SERIALIZER.url("packet_capture_name", packet_capture_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_packet_captures_get_request( + resource_group_name: str, network_watcher_name: str, packet_capture_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "packetCaptureName": _SERIALIZER.url("packet_capture_name", packet_capture_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_packet_captures_delete_request( + resource_group_name: str, network_watcher_name: str, packet_capture_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "packetCaptureName": _SERIALIZER.url("packet_capture_name", packet_capture_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_packet_captures_stop_request( + resource_group_name: str, network_watcher_name: str, packet_capture_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "packetCaptureName": _SERIALIZER.url("packet_capture_name", packet_capture_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_packet_captures_get_status_request( + resource_group_name: str, network_watcher_name: str, packet_capture_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "packetCaptureName": _SERIALIZER.url("packet_capture_name", packet_capture_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_packet_captures_list_request( + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + *, + migrate: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if migrate is not None: + _params["migrate"] = _SERIALIZER.query("migrate", migrate, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_get_request( + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_delete_request( + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_stop_request( + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_start_request( + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_query_request( + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "connectionMonitorName": _SERIALIZER.url("connection_monitor_name", connection_monitor_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connection_monitors_list_request( + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_logs_create_or_update_request( + resource_group_name: str, network_watcher_name: str, flow_log_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "flowLogName": _SERIALIZER.url("flow_log_name", flow_log_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_logs_update_tags_request( + resource_group_name: str, network_watcher_name: str, flow_log_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "flowLogName": _SERIALIZER.url("flow_log_name", flow_log_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_logs_get_request( + resource_group_name: str, network_watcher_name: str, flow_log_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "flowLogName": _SERIALIZER.url("flow_log_name", flow_log_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_logs_delete_request( + resource_group_name: str, network_watcher_name: str, flow_log_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "flowLogName": _SERIALIZER.url("flow_log_name", flow_log_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flow_logs_list_request( + resource_group_name: str, network_watcher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkWatcherName": _SERIALIZER.url("network_watcher_name", network_watcher_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Network/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoints_delete_request( + resource_group_name: str, private_endpoint_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoints_get_request( + resource_group_name: str, + private_endpoint_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoints_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, private_endpoint_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoints_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoints_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_private_endpoint_types_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_available_private_endpoint_types_list_by_resource_group_request( # pylint: disable=name-too-long + location: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_dns_zone_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "privateDnsZoneGroupName": _SERIALIZER.url("private_dns_zone_group_name", private_dns_zone_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_dns_zone_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "privateDnsZoneGroupName": _SERIALIZER.url("private_dns_zone_group_name", private_dns_zone_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_dns_zone_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "privateDnsZoneGroupName": _SERIALIZER.url("private_dns_zone_group_name", private_dns_zone_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_dns_zone_groups_list_request( # pylint: disable=name-too-long + private_endpoint_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_delete_request( # pylint: disable=name-too-long + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_get_request( + resource_group_name: str, service_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_list_request( + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_get_private_endpoint_connection_request( # pylint: disable=name-too-long + resource_group_name: str, + service_name: str, + pe_connection_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "peConnectionName": _SERIALIZER.url("pe_connection_name", pe_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_update_private_endpoint_connection_request( # pylint: disable=name-too-long + resource_group_name: str, service_name: str, pe_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "peConnectionName": _SERIALIZER.url("pe_connection_name", pe_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_delete_private_endpoint_connection_request( # pylint: disable=name-too-long + resource_group_name: str, service_name: str, pe_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "peConnectionName": _SERIALIZER.url("pe_connection_name", pe_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_list_private_endpoint_connections_request( # pylint: disable=name-too-long + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_check_private_link_service_visibility_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_check_private_link_service_visibility_by_resource_group_request( # pylint: disable=name-too-long + location: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_list_auto_approved_private_link_services_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_services_list_auto_approved_private_link_services_by_resource_group_request( # pylint: disable=name-too-long + location: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_prefixes_delete_request( + resource_group_name: str, public_ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpPrefixName": _SERIALIZER.url("public_ip_prefix_name", public_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_prefixes_get_request( + resource_group_name: str, + public_ip_prefix_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpPrefixName": _SERIALIZER.url("public_ip_prefix_name", public_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_prefixes_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, public_ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpPrefixName": _SERIALIZER.url("public_ip_prefix_name", public_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_prefixes_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, public_ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "publicIpPrefixName": _SERIALIZER.url("public_ip_prefix_name", public_ip_prefix_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_prefixes_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_ip_prefixes_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filters_delete_request( + resource_group_name: str, route_filter_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filters_get_request( + resource_group_name: str, + route_filter_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filters_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, route_filter_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filters_update_tags_request( + resource_group_name: str, route_filter_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filters_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filters_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filter_rules_delete_request( + resource_group_name: str, route_filter_name: str, rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filter_rules_get_request( + resource_group_name: str, route_filter_name: str, rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filter_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, route_filter_name: str, rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_filter_rules_list_by_route_filter_request( # pylint: disable=name-too-long + resource_group_name: str, route_filter_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeFilterName": _SERIALIZER.url("route_filter_name", route_filter_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_tables_delete_request( + resource_group_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_tables_get_request( + resource_group_name: str, + route_table_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_tables_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_tables_update_tags_request( + resource_group_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_tables_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_tables_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routes_delete_request( + resource_group_name: str, route_table_name: str, route_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "routeName": _SERIALIZER.url("route_name", route_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routes_get_request( + resource_group_name: str, route_table_name: str, route_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "routeName": _SERIALIZER.url("route_name", route_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routes_create_or_update_request( + resource_group_name: str, route_table_name: str, route_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "routeName": _SERIALIZER.url("route_name", route_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routes_list_request( + resource_group_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_partner_providers_delete_request( # pylint: disable=name-too-long + resource_group_name: str, security_partner_provider_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "securityPartnerProviderName": _SERIALIZER.url( + "security_partner_provider_name", security_partner_provider_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_partner_providers_get_request( # pylint: disable=name-too-long + resource_group_name: str, security_partner_provider_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "securityPartnerProviderName": _SERIALIZER.url( + "security_partner_provider_name", security_partner_provider_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_partner_providers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, security_partner_provider_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "securityPartnerProviderName": _SERIALIZER.url( + "security_partner_provider_name", security_partner_provider_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_partner_providers_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, security_partner_provider_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "securityPartnerProviderName": _SERIALIZER.url( + "security_partner_provider_name", security_partner_provider_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_partner_providers_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_partner_providers_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_bgp_service_communities_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policies_delete_request( # pylint: disable=name-too-long + resource_group_name: str, service_endpoint_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + service_endpoint_policy_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, service_endpoint_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policies_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, service_endpoint_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policies_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policies_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policy_definitions_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "serviceEndpointPolicyDefinitionName": _SERIALIZER.url( + "service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policy_definitions_get_request( # pylint: disable=name-too-long + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "serviceEndpointPolicyDefinitionName": _SERIALIZER.url( + "service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policy_definitions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "serviceEndpointPolicyDefinitionName": _SERIALIZER.url( + "service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_endpoint_policy_definitions_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, service_endpoint_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceEndpointPolicyName": _SERIALIZER.url( + "service_endpoint_policy_name", service_endpoint_policy_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_tags_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags" + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_tag_information_list_request( # pylint: disable=name-too-long + location: str, + subscription_id: str, + *, + no_address_prefixes: Optional[bool] = None, + tag_name: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if no_address_prefixes is not None: + _params["noAddressPrefixes"] = _SERIALIZER.query("no_address_prefixes", no_address_prefixes, "bool") + if tag_name is not None: + _params["tagName"] = _SERIALIZER.query("tag_name", tag_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_usages_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages" + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", pattern=r"^[-\w\._ ]+$"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_delete_request( + resource_group_name: str, virtual_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_get_request( + resource_group_name: str, + virtual_network_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_list_all_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_check_ip_address_availability_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subscription_id: str, *, ip_address: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["ipAddress"] = _SERIALIZER.query("ip_address", ip_address, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_list_usage_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_networks_list_ddos_protection_status_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if top is not None: + _params["top"] = _SERIALIZER.query("top", top, "int") + if skip_token is not None: + _params["skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subnets_delete_request( + resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subnets_get_request( + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subnets_create_or_update_request( + resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subnets_prepare_network_policies_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subnets_unprepare_network_policies_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subnets_list_request( + resource_group_name: str, virtual_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_resource_navigation_links_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_association_links_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subnetName": _SERIALIZER.url("subnet_name", subnet_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_peerings_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "virtualNetworkPeeringName": _SERIALIZER.url( + "virtual_network_peering_name", virtual_network_peering_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_peerings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "virtualNetworkPeeringName": _SERIALIZER.url( + "virtual_network_peering_name", virtual_network_peering_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_peerings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + subscription_id: str, + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "virtualNetworkPeeringName": _SERIALIZER.url( + "virtual_network_peering_name", virtual_network_peering_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if sync_remote_address_space is not None: + _params["syncRemoteAddressSpace"] = _SERIALIZER.query( + "sync_remote_address_space", sync_remote_address_space, "str" + ) + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_peerings_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_list_connections_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_reset_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_gateway_name: str, + subscription_id: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if gateway_vip is not None: + _params["gatewayVip"] = _SERIALIZER.query("gateway_vip", gateway_vip, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_reset_vpn_client_shared_key_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_generatevpnclientpackage_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_generate_vpn_profile_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_vpn_profile_package_url_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_bgp_peer_status_request( # pylint: disable=name-too-long + resource_group_name: str, + virtual_network_gateway_name: str, + subscription_id: str, + *, + peer: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if peer is not None: + _params["peer"] = _SERIALIZER.query("peer", peer, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_supported_vpn_devices_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_learned_routes_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_advertised_routes_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, *, peer: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["peer"] = _SERIALIZER.query("peer", peer, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_set_vpnclient_ipsec_parameters_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_vpnclient_ipsec_parameters_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_vpn_device_configuration_script_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_start_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_stop_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_get_vpnclient_connection_health_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateways_disconnect_virtual_network_gateway_vpn_connections_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_set_shared_key_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_get_shared_key_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_reset_shared_key_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_start_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_stop_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_get_ike_sas_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_connections_reset_connection_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayConnectionName": _SERIALIZER.url( + "virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, "str" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_local_network_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, local_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "localNetworkGatewayName": _SERIALIZER.url( + "local_network_gateway_name", local_network_gateway_name, "str", min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_local_network_gateways_get_request( + resource_group_name: str, local_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "localNetworkGatewayName": _SERIALIZER.url( + "local_network_gateway_name", local_network_gateway_name, "str", min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_local_network_gateways_delete_request( # pylint: disable=name-too-long + resource_group_name: str, local_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "localNetworkGatewayName": _SERIALIZER.url( + "local_network_gateway_name", local_network_gateway_name, "str", min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_local_network_gateways_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, local_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "localNetworkGatewayName": _SERIALIZER.url( + "local_network_gateway_name", local_network_gateway_name, "str", min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_local_network_gateways_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_nat_rules_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "natRuleName": _SERIALIZER.url("nat_rule_name", nat_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_nat_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "natRuleName": _SERIALIZER.url("nat_rule_name", nat_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_nat_rules_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + "natRuleName": _SERIALIZER.url("nat_rule_name", nat_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_gateway_nat_rules_list_by_virtual_network_gateway_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_network_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualNetworkGatewayName": _SERIALIZER.url( + "virtual_network_gateway_name", virtual_network_gateway_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_taps_delete_request( # pylint: disable=name-too-long + resource_group_name: str, tap_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "tapName": _SERIALIZER.url("tap_name", tap_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_taps_get_request( + resource_group_name: str, tap_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "tapName": _SERIALIZER.url("tap_name", tap_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_taps_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, tap_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "tapName": _SERIALIZER.url("tap_name", tap_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_taps_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, tap_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "tapName": _SERIALIZER.url("tap_name", tap_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_taps_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_taps_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_routers_delete_request( + resource_group_name: str, virtual_router_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_routers_get_request( + resource_group_name: str, + virtual_router_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_routers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_router_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_routers_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_routers_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_router_peerings_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_router_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_router_peerings_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_router_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_router_peerings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_router_name: str, peering_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "peeringName": _SERIALIZER.url("peering_name", peering_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_router_peerings_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_router_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualRouterName": _SERIALIZER.url("virtual_router_name", virtual_router_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_wans_get_request( + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "VirtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_wans_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "VirtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_wans_update_tags_request( + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "VirtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_wans_delete_request( + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "VirtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_wans_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_wans_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_get_request( + resource_group_name: str, vpn_site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnSiteName": _SERIALIZER.url("vpn_site_name", vpn_site_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_create_or_update_request( + resource_group_name: str, vpn_site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnSiteName": _SERIALIZER.url("vpn_site_name", vpn_site_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_update_tags_request( + resource_group_name: str, vpn_site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnSiteName": _SERIALIZER.url("vpn_site_name", vpn_site_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_delete_request( + resource_group_name: str, vpn_site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnSiteName": _SERIALIZER.url("vpn_site_name", vpn_site_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_site_links_get_request( + resource_group_name: str, vpn_site_name: str, vpn_site_link_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnSiteName": _SERIALIZER.url("vpn_site_name", vpn_site_name, "str"), + "vpnSiteLinkName": _SERIALIZER.url("vpn_site_link_name", vpn_site_link_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_site_links_list_by_vpn_site_request( # pylint: disable=name-too-long + resource_group_name: str, vpn_site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnSiteName": _SERIALIZER.url("vpn_site_name", vpn_site_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_sites_configuration_download_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, vpn_server_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, vpn_server_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, vpn_server_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, vpn_server_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_policy_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + "configurationPolicyGroupName": _SERIALIZER.url( + "configuration_policy_group_name", configuration_policy_group_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_policy_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + "configurationPolicyGroupName": _SERIALIZER.url( + "configuration_policy_group_name", configuration_policy_group_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_policy_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + "configurationPolicyGroupName": _SERIALIZER.url( + "configuration_policy_group_name", configuration_policy_group_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_policy_groups_list_by_vpn_server_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, vpn_server_configuration_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "vpnServerConfigurationName": _SERIALIZER.url( + "vpn_server_configuration_name", vpn_server_configuration_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_get_request( + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_update_tags_request( + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_delete_request( + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_get_effective_virtual_hub_routes_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_get_inbound_routes_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hubs_get_outbound_routes_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_maps_get_request( + resource_group_name: str, virtual_hub_name: str, route_map_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeMapName": _SERIALIZER.url("route_map_name", route_map_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_maps_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, route_map_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeMapName": _SERIALIZER.url("route_map_name", route_map_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_maps_delete_request( + resource_group_name: str, virtual_hub_name: str, route_map_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeMapName": _SERIALIZER.url("route_map_name", route_map_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_maps_list_request( + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_virtual_network_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_virtual_network_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_virtual_network_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_virtual_network_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_get_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_update_tags_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_delete_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_reset_request( + resource_group_name: str, + gateway_name: str, + subscription_id: str, + *, + ip_configuration_id: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if ip_configuration_id is not None: + _params["ipConfigurationId"] = _SERIALIZER.query("ip_configuration_id", ip_configuration_id, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_start_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_stop_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_gateways_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_link_connections_reset_connection_request( # pylint: disable=name-too-long + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_link_connections_get_ike_sas_request( # pylint: disable=name-too-long + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_link_connections_list_by_vpn_connection_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_connections_get_request( + resource_group_name: str, gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_connections_delete_request( + resource_group_name: str, gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_connections_start_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, vpn_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "vpnConnectionName": _SERIALIZER.url("vpn_connection_name", vpn_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_connections_stop_packet_capture_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, vpn_connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "vpnConnectionName": _SERIALIZER.url("vpn_connection_name", vpn_connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_connections_list_by_vpn_gateway_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_site_link_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_rules_get_request( + resource_group_name: str, gateway_name: str, nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "natRuleName": _SERIALIZER.url("nat_rule_name", nat_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_rules_create_or_update_request( + resource_group_name: str, gateway_name: str, nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "natRuleName": _SERIALIZER.url("nat_rule_name", nat_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_rules_delete_request( + resource_group_name: str, gateway_name: str, nat_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "natRuleName": _SERIALIZER.url("nat_rule_name", nat_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_nat_rules_list_by_vpn_gateway_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_get_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_delete_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_reset_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_generate_vpn_profile_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_get_p2_s_vpn_connection_health_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_get_p2_s_vpn_connection_health_detailed_request( # pylint: disable=name-too-long + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_p2_svpn_gateways_disconnect_p2_s_vpn_connections_request( # pylint: disable=name-too-long + resource_group_name: str, p2_s_vpn_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "p2sVpnGatewayName": _SERIALIZER.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_vpn_server_configurations_associated_with_virtual_wan_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_wan_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualWANName": _SERIALIZER.url("virtual_wan_name", virtual_wan_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_route_table_v2_s_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_route_table_v2_s_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_route_table_v2_s_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_route_table_v2_s_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_gateways_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_gateways_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_gateways_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_gateways_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_gateways_get_request( + resource_group_name: str, express_route_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_gateways_delete_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_express_route_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, express_route_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "expressRouteGatewayName": _SERIALIZER.url("express_route_gateway_name", express_route_gateway_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliance_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str", pattern=r"^[A-Za-z0-9_]+" + ), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str", pattern=r"^[A-Za-z0-9_]+"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliance_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliance_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str" + ), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_virtual_appliance_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, network_virtual_appliance_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkVirtualApplianceName": _SERIALIZER.url( + "network_virtual_appliance_name", network_virtual_appliance_name, "str", pattern=r"^[A-Za-z0-9_]+" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_bgp_connection_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_bgp_connection_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_bgp_connection_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_bgp_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_bgp_connections_list_learned_routes_request( # pylint: disable=name-too-long + resource_group_name: str, hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "hubName": _SERIALIZER.url("hub_name", hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_bgp_connections_list_advertised_routes_request( # pylint: disable=name-too-long + resource_group_name: str, hub_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "hubName": _SERIALIZER.url("hub_name", hub_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_ip_configuration_get_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, ip_config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "ipConfigName": _SERIALIZER.url("ip_config_name", ip_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_ip_configuration_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, ip_config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "ipConfigName": _SERIALIZER.url("ip_config_name", ip_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_ip_configuration_delete_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, ip_config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "ipConfigName": _SERIALIZER.url("ip_config_name", ip_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_hub_ip_configuration_list_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_route_tables_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_route_tables_get_request( + resource_group_name: str, virtual_hub_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_route_tables_delete_request( + resource_group_name: str, virtual_hub_name: str, route_table_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routeTableName": _SERIALIZER.url("route_table_name", route_table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_hub_route_tables_list_request( + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routing_intent_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routingIntentName": _SERIALIZER.url("routing_intent_name", routing_intent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routing_intent_get_request( + resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routingIntentName": _SERIALIZER.url("routing_intent_name", routing_intent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routing_intent_delete_request( + resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + "routingIntentName": _SERIALIZER.url("routing_intent_name", routing_intent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_routing_intent_list_request( + resource_group_name: str, virtual_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualHubName": _SERIALIZER.url("virtual_hub_name", virtual_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_application_firewall_policies_list_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_application_firewall_policies_list_all_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_application_firewall_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str", max_length=128), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_application_firewall_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str", max_length=128), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_web_application_firewall_policies_delete_request( # pylint: disable=name-too-long + resource_group_name: str, policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str", max_length=128), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class ApplicationGatewaysOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`application_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_delete_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, application_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, application_gateway_name: str, **kwargs: Any) -> _models.ApplicationGateway: + """Gets the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + _request = build_application_gateways_get_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.ApplicationGateway, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationGateway") + + _request = build_application_gateways_create_or_update_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: _models.ApplicationGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.ApplicationGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApplicationGateway]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + Is either a ApplicationGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway or IO[bytes] + :return: An instance of LROPoller that returns either ApplicationGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationGateway: + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ApplicationGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_gateways_update_tags_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ApplicationGateway"]: + """Lists all application gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.ApplicationGateway"]: + """Gets all the application gateways in a subscription. + + :return: An iterator like instance of either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_start_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_start(self, resource_group_name: str, application_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Starts the specified application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateways_stop_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_stop(self, resource_group_name: str, application_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Stops the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _backend_health_initial( + self, resource_group_name: str, application_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.ApplicationGatewayBackendHealth]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ApplicationGatewayBackendHealth]] = kwargs.pop("cls", None) + + _request = build_application_gateways_backend_health_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayBackendHealth", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_backend_health( + self, resource_group_name: str, application_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayBackendHealth]: + """Gets the backend health of the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealth or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayBackendHealth] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._backend_health_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + expand=expand, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayBackendHealth", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationGatewayBackendHealth].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationGatewayBackendHealth]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _backend_health_on_demand_initial( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: Union[_models.ApplicationGatewayOnDemandProbe, IO[bytes]], + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.ApplicationGatewayBackendHealthOnDemand]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ApplicationGatewayBackendHealthOnDemand]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(probe_request, (IOBase, bytes)): + _content = probe_request + else: + _json = self._serialize.body(probe_request, "ApplicationGatewayOnDemandProbe") + + _request = build_application_gateways_backend_health_on_demand_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayBackendHealthOnDemand", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: _models.ApplicationGatewayOnDemandProbe, + *, + expand: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Required. + :type probe_request: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayOnDemandProbe + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealthOnDemand + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: IO[bytes], + *, + expand: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Required. + :type probe_request: IO[bytes] + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealthOnDemand + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: Union[_models.ApplicationGatewayOnDemandProbe, IO[bytes]], + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayBackendHealthOnDemand]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. Is either a + ApplicationGatewayOnDemandProbe type or a IO[bytes] type. Required. + :type probe_request: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayOnDemandProbe or + IO[bytes] + :keyword expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend + health. Default value is None. + :paramtype expand: str + :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealthOnDemand + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGatewayBackendHealthOnDemand] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._backend_health_on_demand_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + probe_request=probe_request, + expand=expand, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayBackendHealthOnDemand", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationGatewayBackendHealthOnDemand].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationGatewayBackendHealthOnDemand]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_available_server_variables(self, **kwargs: Any) -> List[str]: + """Lists all available server variables. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_server_variables_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_available_request_headers(self, **kwargs: Any) -> List[str]: + """Lists all available request headers. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_request_headers_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_available_response_headers(self, **kwargs: Any) -> List[str]: + """Lists all available response headers. + + :return: list of str or the result of cls(response) + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_response_headers_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("[str]", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_available_waf_rule_sets(self, **kwargs: Any) -> _models.ApplicationGatewayAvailableWafRuleSetsResult: + """Lists all available web application firewall rule sets. + + :return: ApplicationGatewayAvailableWafRuleSetsResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayAvailableWafRuleSetsResult] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_waf_rule_sets_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayAvailableWafRuleSetsResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_available_ssl_options(self, **kwargs: Any) -> _models.ApplicationGatewayAvailableSslOptions: + """Lists available Ssl options for configuring Ssl policy. + + :return: ApplicationGatewayAvailableSslOptions or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayAvailableSslOptions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayAvailableSslOptions] = kwargs.pop("cls", None) + + _request = build_application_gateways_list_available_ssl_options_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayAvailableSslOptions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_available_ssl_predefined_policies( + self, **kwargs: Any + ) -> Iterable["_models.ApplicationGatewaySslPredefinedPolicy"]: + """Lists all SSL predefined policies for configuring Ssl policy. + + :return: An iterator like instance of either ApplicationGatewaySslPredefinedPolicy or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPredefinedPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayAvailableSslPredefinedPolicies] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateways_list_available_ssl_predefined_policies_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayAvailableSslPredefinedPolicies", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_ssl_predefined_policy( + self, predefined_policy_name: str, **kwargs: Any + ) -> _models.ApplicationGatewaySslPredefinedPolicy: + """Gets Ssl predefined policy with the specified policy name. + + :param predefined_policy_name: Name of Ssl predefined policy. Required. + :type predefined_policy_name: str + :return: ApplicationGatewaySslPredefinedPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewaySslPredefinedPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewaySslPredefinedPolicy] = kwargs.pop("cls", None) + + _request = build_application_gateways_get_ssl_predefined_policy_request( + predefined_policy_name=predefined_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewaySslPredefinedPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ApplicationGatewayPrivateLinkResourcesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`application_gateway_private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> Iterable["_models.ApplicationGatewayPrivateLinkResource"]: + """Lists all private link resources on an application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An iterator like instance of either ApplicationGatewayPrivateLinkResource or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayPrivateLinkResourceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_private_link_resources_list_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateLinkResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ApplicationGatewayPrivateEndpointConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`application_gateway_private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_gateway_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: Union[_models.ApplicationGatewayPrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ApplicationGatewayPrivateEndpointConnection]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ApplicationGatewayPrivateEndpointConnection]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationGatewayPrivateEndpointConnection") + + _request = build_application_gateway_private_endpoint_connections_update_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: _models.ApplicationGatewayPrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: Union[_models.ApplicationGatewayPrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApplicationGatewayPrivateEndpointConnection]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. Is either a ApplicationGatewayPrivateEndpointConnection type or a + IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection or IO[bytes] + :return: An instance of LROPoller that returns either + ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationGatewayPrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationGatewayPrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, application_gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.ApplicationGatewayPrivateEndpointConnection: + """Gets the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + Required. + :type connection_name: str + :return: ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_application_gateway_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, application_gateway_name: str, **kwargs: Any + ) -> Iterable["_models.ApplicationGatewayPrivateEndpointConnection"]: + """Lists all private endpoint connections on an application gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. Required. + :type application_gateway_name: str + :return: An iterator like instance of either ApplicationGatewayPrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayPrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayPrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ApplicationGatewayWafDynamicManifestsDefaultOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`application_gateway_waf_dynamic_manifests_default` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, location: str, **kwargs: Any) -> _models.ApplicationGatewayWafDynamicManifestResult: + """Gets the regional application gateway waf manifest. + + :param location: The region where the nrp are located at. Required. + :type location: str + :return: ApplicationGatewayWafDynamicManifestResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafDynamicManifestResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayWafDynamicManifestResult] = kwargs.pop("cls", None) + + _request = build_application_gateway_waf_dynamic_manifests_default_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationGatewayWafDynamicManifestResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ApplicationGatewayWafDynamicManifestsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`application_gateway_waf_dynamic_manifests` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, location: str, **kwargs: Any) -> Iterable["_models.ApplicationGatewayWafDynamicManifestResult"]: + """Gets the regional application gateway waf manifest. + + :param location: The region where the nrp are located at. Required. + :type location: str + :return: An iterator like instance of either ApplicationGatewayWafDynamicManifestResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationGatewayWafDynamicManifestResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationGatewayWafDynamicManifestResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_gateway_waf_dynamic_manifests_get_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationGatewayWafDynamicManifestResultList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ApplicationSecurityGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`application_security_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_application_security_groups_delete_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, application_security_group_name: str, **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Gets information about the specified application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + _request = build_application_security_groups_get_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.ApplicationSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ApplicationSecurityGroup") + + _request = build_application_security_groups_create_or_update_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: _models.ApplicationSecurityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.ApplicationSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApplicationSecurityGroup]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. Is either a ApplicationSecurityGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup or IO[bytes] + :return: An instance of LROPoller that returns either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationSecurityGroup: + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. Required. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_application_security_groups_update_tags_request( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.ApplicationSecurityGroup"]: + """Gets all application security groups in a subscription. + + :return: An iterator like instance of either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_security_groups_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ApplicationSecurityGroup"]: + """Gets all the application security groups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ApplicationSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ApplicationSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_application_security_groups_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AvailableDelegationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`available_delegations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.AvailableDelegation"]: + """Gets all of the available subnet delegations for this subscription in this region. + + :param location: The location of the subnet. Required. + :type location: str + :return: An iterator like instance of either AvailableDelegation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableDelegation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableDelegationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_delegations_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableDelegationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AvailableResourceGroupDelegationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`available_resource_group_delegations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, resource_group_name: str, **kwargs: Any) -> Iterable["_models.AvailableDelegation"]: + """Gets all of the available subnet delegations for this resource group in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AvailableDelegation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableDelegation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableDelegationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_resource_group_delegations_list_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableDelegationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AvailableServiceAliasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`available_service_aliases` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.AvailableServiceAlias"]: + """Gets all available service aliases for this subscription in this region. + + :param location: The location. Required. + :type location: str + :return: An iterator like instance of either AvailableServiceAlias or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableServiceAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableServiceAliasesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_service_aliases_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableServiceAliasesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, location: str, **kwargs: Any + ) -> Iterable["_models.AvailableServiceAlias"]: + """Gets all available service aliases for this resource group in this region. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param location: The location. Required. + :type location: str + :return: An iterator like instance of either AvailableServiceAlias or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailableServiceAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailableServiceAliasesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_service_aliases_list_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableServiceAliasesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AzureFirewallsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`azure_firewalls` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_delete_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any) -> _models.AzureFirewall: + """Gets the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :return: AzureFirewall or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AzureFirewall + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_get_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.AzureFirewall, IO[bytes]], + **kwargs: Any + ) -> _models.AzureFirewall: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AzureFirewall") + + _request = build_azure_firewalls_create_or_update_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: _models.AzureFirewall, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureFirewall + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.AzureFirewall, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AzureFirewall]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. Is + either a AzureFirewall type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureFirewall or IO[bytes] + :return: An instance of LROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureFirewall", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AzureFirewall].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AzureFirewall]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.AzureFirewall]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AzureFirewall]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_azure_firewalls_update_tags_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AzureFirewall", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AzureFirewall]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of LROPoller that returns either AzureFirewall or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureFirewall] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureFirewall", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AzureFirewall].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AzureFirewall]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.AzureFirewall"]: + """Lists all Azure Firewalls in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewallListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewalls_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.AzureFirewall"]: + """Gets all the Azure Firewalls in a subscription. + + :return: An iterator like instance of either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewallListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewalls_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _list_learned_prefixes_initial( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> Optional[_models.IPPrefixesList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.IPPrefixesList]] = kwargs.pop("cls", None) + + _request = build_azure_firewalls_list_learned_prefixes_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("IPPrefixesList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_learned_prefixes( + self, resource_group_name: str, azure_firewall_name: str, **kwargs: Any + ) -> LROPoller[_models.IPPrefixesList]: + """Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the azure firewall. Required. + :type azure_firewall_name: str + :return: An instance of LROPoller that returns either IPPrefixesList or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IPPrefixesList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IPPrefixesList] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_learned_prefixes_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IPPrefixesList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IPPrefixesList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IPPrefixesList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _packet_capture_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.FirewallPacketCaptureParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPacketCaptureParameters") + + _request = build_azure_firewalls_packet_capture_request( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: _models.FirewallPacketCaptureParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPacketCaptureParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_packet_capture( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: Union[_models.FirewallPacketCaptureParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Runs a packet capture on AzureFirewall. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. Required. + :type azure_firewall_name: str + :param parameters: Parameters supplied to run packet capture on azure firewall. Is either a + FirewallPacketCaptureParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPacketCaptureParameters or + IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._packet_capture_initial( # type: ignore + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AzureFirewallFqdnTagsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`azure_firewall_fqdn_tags` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.AzureFirewallFqdnTag"]: + """Gets all the Azure Firewall FQDN Tags in a subscription. + + :return: An iterator like instance of either AzureFirewallFqdnTag or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureFirewallFqdnTag] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureFirewallFqdnTagListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_azure_firewall_fqdn_tags_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AzureFirewallFqdnTagListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class WebCategoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`web_categories` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, name: str, *, expand: Optional[str] = None, **kwargs: Any) -> _models.AzureWebCategory: + """Gets the specified Azure Web Category. + + :param name: The name of the azureWebCategory. Required. + :type name: str + :keyword expand: Expands resourceIds back referenced by the azureWebCategory resource. Default + value is None. + :paramtype expand: str + :return: AzureWebCategory or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AzureWebCategory + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureWebCategory] = kwargs.pop("cls", None) + + _request = build_web_categories_get_request( + name=name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AzureWebCategory", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.AzureWebCategory"]: + """Gets all the Azure Web Categories in a subscription. + + :return: An iterator like instance of either AzureWebCategory or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AzureWebCategory] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AzureWebCategoryListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_categories_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AzureWebCategoryListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class BastionHostsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`bastion_hosts` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_bastion_hosts_delete_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, bastion_host_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, bastion_host_name: str, **kwargs: Any) -> _models.BastionHost: + """Gets the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: BastionHost or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BastionHost + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + + _request = build_bastion_hosts_get_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.BastionHost, IO[bytes]], + **kwargs: Any + ) -> _models.BastionHost: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BastionHost") + + _request = build_bastion_hosts_create_or_update_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: _models.BastionHost, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BastionHost + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.BastionHost, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BastionHost]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. Is + either a BastionHost type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BastionHost or IO[bytes] + :return: An instance of LROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BastionHost", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BastionHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BastionHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.BastionHost]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BastionHost]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_bastion_hosts_update_tags_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionHost", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BastionHost]: + """Updates Tags for BastionHost resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param parameters: Parameters supplied to update BastionHost tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of LROPoller that returns either BastionHost or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionHost] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BastionHost", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BastionHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BastionHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.BastionHost"]: + """Lists all Bastion Hosts in a subscription. + + :return: An iterator like instance of either BastionHost or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bastion_hosts_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.BastionHost"]: + """Lists all Bastion Hosts in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either BastionHost or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BastionHostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bastion_hosts_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BastionHostListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkManagementClientOperationsMixin(NetworkManagementClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + + def _put_bastion_shareable_link_initial( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.BastionShareableLinkListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("_put_bastion_shareable_link_initial") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BastionShareableLinkListResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + _request = build_network_management_put_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: _models.BastionShareableLinkListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Iterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Iterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[Iterable["_models.BastionShareableLink"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of either + BastionShareableLinkListResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("begin_put_bastion_shareable_link") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionShareableLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_put_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._put_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return get_next(next_link) + + return ItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[Iterable["_models.BastionShareableLink"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[Iterable["_models.BastionShareableLink"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_bastion_shareable_link_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("_delete_bastion_shareable_link_initial") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + _request = build_network_management_delete_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: _models.BastionShareableLinkListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("begin_delete_bastion_shareable_link") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_bastion_shareable_link_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_bastion_shareable_link_by_token_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("_delete_bastion_shareable_link_by_token_initial") or "2023-09-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_token_request, (IOBase, bytes)): + _content = bsl_token_request + else: + _json = self._serialize.body(bsl_token_request, "BastionShareableLinkTokenListRequest") + + _request = build_network_management_delete_bastion_shareable_link_by_token_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: _models.BastionShareableLinkTokenListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. + Required. + :type bsl_token_request: + ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. + Required. + :type bsl_token_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_bastion_shareable_link_by_token( # pylint: disable=name-too-long + self, + resource_group_name: str, + bastion_host_name: str, + bsl_token_request: Union[_models.BastionShareableLinkTokenListRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Bastion Shareable Links for all the tokens specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_token_request: Post request for Delete Bastion Shareable Link By Token endpoint. Is + either a BastionShareableLinkTokenListRequest type or a IO[bytes] type. Required. + :type bsl_token_request: + ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkTokenListRequest or IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("begin_delete_bastion_shareable_link_by_token") or "2023-09-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_bastion_shareable_link_by_token_initial( # type: ignore + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_token_request=bsl_token_request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: _models.BastionShareableLinkListRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. + Required. + :type bsl_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: Union[_models.BastionShareableLinkListRequest, IO[bytes]], + **kwargs: Any + ) -> Iterable["_models.BastionShareableLink"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param bsl_request: Post request for Create/Delete/Get Bastion Shareable Link endpoints. Is + either a BastionShareableLinkListRequest type or a IO[bytes] type. Required. + :type bsl_request: ~azure.mgmt.network.v2023_09_01.models.BastionShareableLinkListRequest or + IO[bytes] + :return: An iterator like instance of either BastionShareableLink or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionShareableLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("get_bastion_shareable_link") or "2023-09-01") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionShareableLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(bsl_request, (IOBase, bytes)): + _content = bsl_request + else: + _json = self._serialize.body(bsl_request, "BastionShareableLinkListRequest") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_get_bastion_shareable_link_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BastionShareableLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _get_active_sessions_initial( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> Optional[_models.BastionActiveSessionListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("_get_active_sessions_initial") or "2023-09-01") + ) + cls: ClsType[Optional[_models.BastionActiveSessionListResult]] = kwargs.pop("cls", None) + + _request = build_network_management_get_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BastionActiveSessionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_active_sessions( + self, resource_group_name: str, bastion_host_name: str, **kwargs: Any + ) -> LROPoller[Iterable["_models.BastionActiveSession"]]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :return: An instance of LROPoller that returns an iterator like instance of either + BastionActiveSessionListResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionActiveSession]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("begin_get_active_sessions") or "2023-09-01") + ) + cls: ClsType[_models.BastionActiveSessionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_get_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BastionActiveSessionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_active_sessions_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return get_next(next_link) + + return ItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[Iterable["_models.BastionActiveSession"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[Iterable["_models.BastionActiveSession"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: _models.SessionIds, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Required. + :type session_ids: ~azure.mgmt.network.v2023_09_01.models.SessionIds + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Required. + :type session_ids: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: Union[_models.SessionIds, IO[bytes]], + **kwargs: Any + ) -> Iterable["_models.BastionSessionState"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. Required. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. Is either a SessionIds type or a + IO[bytes] type. Required. + :type session_ids: ~azure.mgmt.network.v2023_09_01.models.SessionIds or IO[bytes] + :return: An iterator like instance of either BastionSessionState or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BastionSessionState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("disconnect_active_sessions") or "2023-09-01") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BastionSessionDeleteResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(session_ids, (IOBase, bytes)): + _content = session_ids + else: + _json = self._serialize.body(session_ids, "SessionIds") + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_management_disconnect_active_sessions_request( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BastionSessionDeleteResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def check_dns_name_availability( + self, location: str, *, domain_name_label: str, **kwargs: Any + ) -> _models.DnsNameAvailabilityResult: + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + + :param location: The location of the domain name. Required. + :type location: str + :keyword domain_name_label: The domain name to be verified. It must conform to the following + regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Required. + :paramtype domain_name_label: str + :return: DnsNameAvailabilityResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DnsNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_dns_name_availability") or "2023-09-01") + ) + cls: ClsType[_models.DnsNameAvailabilityResult] = kwargs.pop("cls", None) + + _request = build_network_management_check_dns_name_availability_request( + location=location, + subscription_id=self._config.subscription_id, + domain_name_label=domain_name_label, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DnsNameAvailabilityResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def express_route_provider_port(self, providerport: str, **kwargs: Any) -> _models.ExpressRouteProviderPort: + """Retrieves detail of a provider port. + + :param providerport: The name of the provider port. Required. + :type providerport: str + :return: ExpressRouteProviderPort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("express_route_provider_port") or "2023-09-01") + ) + cls: ClsType[_models.ExpressRouteProviderPort] = kwargs.pop("cls", None) + + _request = build_network_management_express_route_provider_port_request( + providerport=providerport, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteProviderPort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.ActiveConfigurationParameter, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_active_connectivity_configurations( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.ActiveConnectivityConfigurationsListResult: + """Lists active connectivity configurations in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or + IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: ActiveConnectivityConfigurationsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveConnectivityConfigurationsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("list_active_connectivity_configurations") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveConnectivityConfigurationsListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_network_management_list_active_connectivity_configurations_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveConnectivityConfigurationsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.ActiveConfigurationParameter, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_active_security_admin_rules( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.ActiveConfigurationParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.ActiveSecurityAdminRulesListResult: + """Lists active security admin rules in a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Active Configuration Parameter. Is either a ActiveConfigurationParameter + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ActiveConfigurationParameter or + IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: ActiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ActiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop("api-version", self._api_version("list_active_security_admin_rules") or "2023-09-01"), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ActiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ActiveConfigurationParameter") + + _request = build_network_management_list_active_security_admin_rules_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ActiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.QueryRequestOptions, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_network_manager_effective_connectivity_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerEffectiveConnectivityConfigurationListResult: + """List all effective connectivity configurations applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerEffectiveConnectivityConfigurationListResult or the result of + cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveConnectivityConfigurationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("list_network_manager_effective_connectivity_configurations") or "2023-09-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_management_list_network_manager_effective_connectivity_configurations_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize( + "NetworkManagerEffectiveConnectivityConfigurationListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.QueryRequestOptions, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_network_manager_effective_security_admin_rules( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.QueryRequestOptions, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerEffectiveSecurityAdminRulesListResult: + """List all effective security admin rules applied on a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to list correct page. Is either a QueryRequestOptions + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryRequestOptions or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerEffectiveSecurityAdminRulesListResult or the result of cls(response) + :rtype: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerEffectiveSecurityAdminRulesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", self._api_version("list_network_manager_effective_security_admin_rules") or "2023-09-01" + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerEffectiveSecurityAdminRulesListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryRequestOptions") + + _request = build_network_management_list_network_manager_effective_security_admin_rules_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerEffectiveSecurityAdminRulesListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def supported_security_providers( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> _models.VirtualWanSecurityProviders: + """Gives the supported security providers for the virtual wan. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which supported security providers are + needed. Required. + :type virtual_wan_name: str + :return: VirtualWanSecurityProviders or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWanSecurityProviders + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("supported_security_providers") or "2023-09-01") + ) + cls: ClsType[_models.VirtualWanSecurityProviders] = kwargs.pop("cls", None) + + _request = build_network_management_supported_security_providers_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWanSecurityProviders", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnProfileResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("_generatevirtualwanvpnserverconfigurationvpnprofile_initial") or "2023-09-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnProfileResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_client_params, (IOBase, bytes)): + _content = vpn_client_params + else: + _json = self._serialize.body(vpn_client_params, "VirtualWanVpnProfileParameters") + + _request = build_network_management_generatevirtualwanvpnserverconfigurationvpnprofile_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: _models.VirtualWanVpnProfileParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Required. + :type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Required. + :type vpn_client_params: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_generatevirtualwanvpnserverconfigurationvpnprofile( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: Union[_models.VirtualWanVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnProfileResponse]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. Is either a VirtualWanVpnProfileParameters type or a IO[bytes] type. Required. + :type vpn_client_params: ~azure.mgmt.network.v2023_09_01.models.VirtualWanVpnProfileParameters + or IO[bytes] + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", + _params.pop( + "api-version", + self._api_version("begin_generatevirtualwanvpnserverconfigurationvpnprofile") or "2023-09-01", + ), + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnProfileResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generatevirtualwanvpnserverconfigurationvpnprofile_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + vpn_client_params=vpn_client_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnProfileResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnProfileResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_interfaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_cloud_service_role_instance_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, cloud_service_name: str, role_instance_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterface"]: + """Gets information about all network interfaces in a role instance in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_cloud_service_role_instance_network_interfaces_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_cloud_service_network_interfaces( + self, resource_group_name: str, cloud_service_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterface"]: + """Gets all network interfaces in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_cloud_service_network_interfaces_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_cloud_service_network_interface( + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterface: + """Get the specified network interface in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_cloud_service_network_interface_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_interfaces_delete_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_interface_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_interface_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkInterface: + """Gets information about the specified network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.NetworkInterface, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkInterface") + + _request = build_network_interfaces_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: _models.NetworkInterface, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.NetworkInterface, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. Is + either a NetworkInterface type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface or IO[bytes] + :return: An instance of LROPoller that returns either NetworkInterface or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterface", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterface: + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_interfaces_update_tags_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.NetworkInterface"]: + """Gets all network interfaces in a subscription. + + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkInterface"]: + """Gets all network interfaces in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _get_effective_route_table_initial( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Optional[_models.EffectiveRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.EffectiveRouteListResult]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_effective_route_table_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_effective_route_table( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteListResult]: + """Gets all route tables applied to a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of LROPoller that returns either EffectiveRouteListResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.EffectiveRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_effective_route_table_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EffectiveRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EffectiveRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_effective_network_security_groups_initial( # pylint: disable=name-too-long + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Optional[_models.EffectiveNetworkSecurityGroupListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.EffectiveNetworkSecurityGroupListResult]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_list_effective_network_security_groups_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveNetworkSecurityGroupListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_effective_network_security_groups( # pylint: disable=name-too-long + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> LROPoller[_models.EffectiveNetworkSecurityGroupListResult]: + """Gets all network security groups applied to a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An instance of LROPoller that returns either EffectiveNetworkSecurityGroupListResult + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveNetworkSecurityGroupListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.EffectiveNetworkSecurityGroupListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_effective_network_security_groups_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveNetworkSecurityGroupListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EffectiveNetworkSecurityGroupListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EffectiveNetworkSecurityGroupListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_virtual_machine_scale_set_vm_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterface"]: + """Gets information about all network interfaces in a virtual machine in a virtual machine scale + set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_virtual_machine_scale_set_network_interfaces( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterface"]: + """Gets all network interfaces in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_virtual_machine_scale_set_network_interface( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterface: + """Get the specified network interface in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterface or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_virtual_machine_scale_set_network_interface_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterface", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_virtual_machine_scale_set_ip_configurations( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.NetworkInterfaceIPConfiguration"]: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: An iterator like instance of either NetworkInterfaceIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interfaces_list_virtual_machine_scale_set_ip_configurations_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_virtual_machine_scale_set_ip_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkInterfaceIPConfiguration: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration. Required. + :type ip_configuration_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkInterfaceIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.NetworkInterfaceIPConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_virtual_machine_scale_set_ip_configuration_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PublicIPAddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`public_ip_addresses` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_cloud_service_public_ip_addresses( + self, resource_group_name: str, cloud_service_name: str, **kwargs: Any + ) -> Iterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses on a cloud service level. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_cloud_service_public_ip_addresses_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_cloud_service_role_instance_public_ip_addresses( # pylint: disable=name-too-long + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs: Any + ) -> Iterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses in a role instance IP configuration in a cloud + service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The name of role instance. Required. + :type role_instance_name: str + :param network_interface_name: The network interface name. Required. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. Required. + :type ip_configuration_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_cloud_service_role_instance_public_ip_addresses_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_cloud_service_public_ip_address( + self, + resource_group_name: str, + cloud_service_name: str, + role_instance_name: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PublicIPAddress: + """Get the specified public IP address in a cloud service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cloud_service_name: The name of the cloud service. Required. + :type cloud_service_name: str + :param role_instance_name: The role instance name. Required. + :type role_instance_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. Required. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_cloud_service_public_ip_address_request( + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + role_instance_name=role_instance_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_delete_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, public_ip_address_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PublicIPAddress: + """Gets the specified public IP address in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.PublicIPAddress, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PublicIPAddress") + + _request = build_public_ip_addresses_create_or_update_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: _models.PublicIPAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.PublicIPAddress, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PublicIPAddress]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. Is + either a PublicIPAddress type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress or IO[bytes] + :return: An instance of LROPoller that returns either PublicIPAddress or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PublicIPAddress].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PublicIPAddress]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPAddress: + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_addresses_update_tags_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.PublicIPAddress"]: + """Gets all the public IP addresses in a subscription. + + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.PublicIPAddress"]: + """Gets all public IP addresses in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _ddos_protection_status_initial( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> Optional[_models.PublicIpDdosProtectionStatusResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.PublicIpDdosProtectionStatusResult]] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_ddos_protection_status_request( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("PublicIpDdosProtectionStatusResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_ddos_protection_status( + self, resource_group_name: str, public_ip_address_name: str, **kwargs: Any + ) -> LROPoller[_models.PublicIpDdosProtectionStatusResult]: + """Gets the Ddos Protection Status of a Public IP Address. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. Required. + :type public_ip_address_name: str + :return: An instance of LROPoller that returns either PublicIpDdosProtectionStatusResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIpDdosProtectionStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIpDdosProtectionStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._ddos_protection_status_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIpDdosProtectionStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PublicIpDdosProtectionStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PublicIpDdosProtectionStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_virtual_machine_scale_set_public_ip_addresses( # pylint: disable=name-too-long + self, resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs: Any + ) -> Iterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses on a virtual machine scale set level. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_virtual_machine_scale_set_public_ip_addresses_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_virtual_machine_scale_set_vm_public_ip_addresses( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs: Any + ) -> Iterable["_models.PublicIPAddress"]: + """Gets information about all public IP addresses in a virtual machine IP configuration in a + virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The network interface name. Required. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. Required. + :type ip_configuration_name: str + :return: An iterator like instance of either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddressListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_addresses_list_virtual_machine_scale_set_vm_public_ip_addresses_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_virtual_machine_scale_set_public_ip_address( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PublicIPAddress: + """Get the specified public IP address in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. Required. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. Required. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. Required. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. Required. + :type public_ip_address_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPAddress or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPAddress + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-10-01")) + cls: ClsType[_models.PublicIPAddress] = kwargs.pop("cls", None) + + _request = build_public_ip_addresses_get_virtual_machine_scale_set_public_ip_address_request( + resource_group_name=resource_group_name, + virtual_machine_scale_set_name=virtual_machine_scale_set_name, + virtualmachine_index=virtualmachine_index, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + public_ip_address_name=public_ip_address_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPAddress", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VipSwapOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vip_swap` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, group_name: str, resource_name: str, **kwargs: Any) -> _models.SwapResource: + """Gets the SwapResource which identifies the slot type for the specified cloud service. The slot + type on a cloud service can either be Staging or Production. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :return: SwapResource or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SwapResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SwapResource] = kwargs.pop("cls", None) + + _request = build_vip_swap_get_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + singleton_resource=singleton_resource, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SwapResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( # pylint: disable=inconsistent-return-statements + self, group_name: str, resource_name: str, parameters: Union[_models.SwapResource, IO[bytes]], **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SwapResource") + + _request = build_vip_swap_create_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + singleton_resource=singleton_resource, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_create( + self, + group_name: str, + resource_name: str, + parameters: _models.SwapResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SwapResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, group_name: str, resource_name: str, parameters: Union[_models.SwapResource, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Performs vip swap operation on swappable cloud services. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :param parameters: SwapResource object where slot type should be the target slot after vip swap + for the specified cloud service. Is either a SwapResource type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SwapResource or IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + singleton_resource: Literal["swap"] = kwargs.pop("singleton_resource", "swap") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( # type: ignore + group_name=group_name, + resource_name=resource_name, + parameters=parameters, + singleton_resource=singleton_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, group_name: str, resource_name: str, **kwargs: Any) -> _models.SwapResourceListResult: + """Gets the list of SwapResource which identifies the slot type for the specified cloud service. + The slot type on a cloud service can either be Staging or Production. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param resource_name: The name of the cloud service. Required. + :type resource_name: str + :return: SwapResourceListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SwapResourceListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SwapResourceListResult] = kwargs.pop("cls", None) + + _request = build_vip_swap_list_request( + group_name=group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SwapResourceListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class CustomIPPrefixesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`custom_ip_prefixes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, custom_ip_prefix_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_custom_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, custom_ip_prefix_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the CustomIpPrefix. Required. + :type custom_ip_prefix_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, custom_ip_prefix_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.CustomIpPrefix: + """Gets the specified custom IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + _request = build_custom_ip_prefixes_get_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.CustomIpPrefix, IO[bytes]], + **kwargs: Any + ) -> _models.CustomIpPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CustomIpPrefix") + + _request = build_custom_ip_prefixes_create_or_update_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: _models.CustomIpPrefix, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.CustomIpPrefix, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CustomIpPrefix]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. Is + either a CustomIpPrefix type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix or IO[bytes] + :return: An instance of LROPoller that returns either CustomIpPrefix or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CustomIpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CustomIpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.CustomIpPrefix: + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. Required. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: CustomIpPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomIpPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_custom_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomIpPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.CustomIpPrefix"]: + """Gets all the custom IP prefixes in a subscription. + + :return: An iterator like instance of either CustomIpPrefix or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.CustomIpPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_custom_ip_prefixes_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CustomIpPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.CustomIpPrefix"]: + """Gets all custom IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either CustomIpPrefix or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.CustomIpPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_custom_ip_prefixes_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CustomIpPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DdosCustomPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`ddos_custom_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ddos_custom_policies_delete_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, ddos_custom_policy_name: str, **kwargs: Any) -> _models.DdosCustomPolicy: + """Gets information about the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + _request = build_ddos_custom_policies_get_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.DdosCustomPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DdosCustomPolicy") + + _request = build_ddos_custom_policies_create_or_update_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: _models.DdosCustomPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.DdosCustomPolicy, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DdosCustomPolicy]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. Is either a + DdosCustomPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy or IO[bytes] + :return: An instance of LROPoller that returns either DdosCustomPolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DdosCustomPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DdosCustomPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosCustomPolicy: + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. Required. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosCustomPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosCustomPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_custom_policies_update_tags_request( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosCustomPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DdosProtectionPlansOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`ddos_protection_plans` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ddos_protection_plans_delete_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, ddos_protection_plan_name: str, **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Gets information about the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + _request = build_ddos_protection_plans_get_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.DdosProtectionPlan, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DdosProtectionPlan") + + _request = build_ddos_protection_plans_create_or_update_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: _models.DdosProtectionPlan, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.DdosProtectionPlan, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DdosProtectionPlan]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. Is either a + DdosProtectionPlan type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan or IO[bytes] + :return: An instance of LROPoller that returns either DdosProtectionPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DdosProtectionPlan].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DdosProtectionPlan]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.DdosProtectionPlan: + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. Required. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DdosProtectionPlan] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ddos_protection_plans_update_tags_request( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DdosProtectionPlan", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.DdosProtectionPlan"]: + """Gets all DDoS protection plans in a subscription. + + :return: An iterator like instance of either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosProtectionPlanListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ddos_protection_plans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlanListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.DdosProtectionPlan"]: + """Gets all the DDoS protection plans in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DdosProtectionPlanListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ddos_protection_plans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DdosProtectionPlanListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DscpConfigurationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`dscp_configuration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: Union[_models.DscpConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.DscpConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "DscpConfiguration") + + _request = build_dscp_configuration_create_or_update_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: _models.DscpConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DscpConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: Union[_models.DscpConfiguration, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DscpConfiguration]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. Is + either a DscpConfiguration type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.DscpConfiguration or IO[bytes] + :return: An instance of LROPoller that returns either DscpConfiguration or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DscpConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DscpConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_dscp_configuration_delete_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, dscp_configuration_name: str, **kwargs: Any) -> _models.DscpConfiguration: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. Required. + :type dscp_configuration_name: str + :return: DscpConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.DscpConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DscpConfiguration] = kwargs.pop("cls", None) + + _request = build_dscp_configuration_get_request( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DscpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.DscpConfiguration"]: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either DscpConfiguration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DscpConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_dscp_configuration_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DscpConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.DscpConfiguration"]: + """Gets all dscp configurations in a subscription. + + :return: An iterator like instance of either DscpConfiguration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.DscpConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_dscp_configuration_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DscpConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AvailableEndpointServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`available_endpoint_services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.EndpointServiceResult"]: + """List what values of endpoint services are available for use. + + :param location: The location to check available endpoint services. Required. + :type location: str + :return: An iterator like instance of either EndpointServiceResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.EndpointServiceResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.EndpointServicesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_endpoint_services_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("EndpointServicesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitAuthorizationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_circuit_authorizations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_authorizations_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, circuit_name: str, authorization_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitAuthorization: + """Gets the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_authorizations_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRouteCircuitAuthorization, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitAuthorization: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(authorization_parameters, (IOBase, bytes)): + _content = authorization_parameters + else: + _json = self._serialize.body(authorization_parameters, "ExpressRouteCircuitAuthorization") + + _request = build_express_route_circuit_authorizations_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: _models.ExpressRouteCircuitAuthorization, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Required. + :type authorization_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRouteCircuitAuthorization, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitAuthorization]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. Is either a ExpressRouteCircuitAuthorization type or a + IO[bytes] type. Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteCircuitAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitAuthorization] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitAuthorization", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitAuthorization].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitAuthorization]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRouteCircuitAuthorization"]: + """Gets all authorizations in an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitAuthorization or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AuthorizationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_authorizations_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AuthorizationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitPeeringsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_circuit_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_peerings_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified peering from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitPeering: + """Gets the specified peering for the express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_peerings_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCircuitPeering, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(peering_parameters, (IOBase, bytes)): + _content = peering_parameters + else: + _json = self._serialize.body(peering_parameters, "ExpressRouteCircuitPeering") + + _request = build_express_route_circuit_peerings_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: _models.ExpressRouteCircuitPeering, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Required. + :type peering_parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Required. + :type peering_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCircuitPeering, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitPeering]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. Is either a ExpressRouteCircuitPeering type or a IO[bytes] type. Required. + :type peering_parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering or + IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitPeering] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRouteCircuitPeering"]: + """Gets all peerings in a specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: An iterator like instance of either ExpressRouteCircuitPeering or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_peerings_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_circuit_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_connections_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitConnection: + """Gets the specified Express Route Circuit Connection from the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :return: ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + _request = build_express_route_circuit_connections_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: Union[_models.ExpressRouteCircuitConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuitConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(express_route_circuit_connection_parameters, (IOBase, bytes)): + _content = express_route_circuit_connection_parameters + else: + _json = self._serialize.body(express_route_circuit_connection_parameters, "ExpressRouteCircuitConnection") + + _request = build_express_route_circuit_connections_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: _models.ExpressRouteCircuitConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Required. + :type express_route_circuit_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Required. + :type express_route_circuit_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: Union[_models.ExpressRouteCircuitConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitConnection]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. Required. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. Is either a ExpressRouteCircuitConnection type or a + IO[bytes] type. Required. + :type express_route_circuit_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteCircuitConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuitConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + express_route_circuit_connection_parameters=express_route_circuit_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRouteCircuitConnection"]: + """Gets all global reach connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An iterator like instance of either ExpressRouteCircuitConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuit_connections_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PeerExpressRouteCircuitConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`peer_express_route_circuit_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, circuit_name: str, peering_name: str, connection_name: str, **kwargs: Any + ) -> _models.PeerExpressRouteCircuitConnection: + """Gets the specified Peer Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param connection_name: The name of the peer express route circuit connection. Required. + :type connection_name: str + :return: PeerExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PeerExpressRouteCircuitConnection] = kwargs.pop("cls", None) + + _request = build_peer_express_route_circuit_connections_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PeerExpressRouteCircuitConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> Iterable["_models.PeerExpressRouteCircuitConnection"]: + """Gets all global reach peer connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An iterator like instance of either PeerExpressRouteCircuitConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PeerExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PeerExpressRouteCircuitConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_peer_express_route_circuit_connections_list_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PeerExpressRouteCircuitConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteCircuitsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_circuits` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, circuit_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_delete_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + circuit_name=circuit_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> _models.ExpressRouteCircuit: + """Gets information about the specified express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of express route circuit. Required. + :type circuit_name: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.ExpressRouteCircuit, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRouteCircuit") + + _request = build_express_route_circuits_create_or_update_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: _models.ExpressRouteCircuit, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.ExpressRouteCircuit, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuit]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + Is either a ExpressRouteCircuit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteCircuit or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCircuit: + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the circuit. Required. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCircuit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_circuits_update_tags_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _list_arp_table_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsArpTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsArpTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_arp_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_arp_table( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitsArpTableListResult]: + """Gets the currently advertised ARP table associated with the express route circuit in a resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitsArpTableListResult or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_arp_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitsArpTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitsArpTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_routes_table_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_routes_table_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_routes_table( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]: + """Gets the currently advertised routes table associated with the express route circuit in a + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableListResult + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_routes_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitsRoutesTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_routes_table_summary_initial( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_list_routes_table_summary_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableSummaryListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_routes_table_summary( + self, resource_group_name: str, circuit_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]: + """Gets the currently advertised routes table summary associated with the express route circuit in + a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of LROPoller that returns either + ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableSummaryListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableSummaryListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitsRoutesTableSummaryListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_stats(self, resource_group_name: str, circuit_name: str, **kwargs: Any) -> _models.ExpressRouteCircuitStats: + """Gets all the stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :return: ExpressRouteCircuitStats or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitStats + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitStats] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitStats", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_peering_stats( + self, resource_group_name: str, circuit_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCircuitStats: + """Gets all stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. Required. + :type circuit_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCircuitStats or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitStats + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitStats] = kwargs.pop("cls", None) + + _request = build_express_route_circuits_get_peering_stats_request( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCircuitStats", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ExpressRouteCircuit"]: + """Gets all the express route circuits in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRouteCircuit or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.ExpressRouteCircuit"]: + """Gets all the express route circuits in a subscription. + + :return: An iterator like instance of either ExpressRouteCircuit or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_circuits_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteServiceProvidersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_service_providers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ExpressRouteServiceProvider"]: + """Gets all the available express route service providers. + + :return: An iterator like instance of either ExpressRouteServiceProvider or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteServiceProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteServiceProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_service_providers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteServiceProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteCrossConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_cross_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ExpressRouteCrossConnection"]: + """Retrieves all the ExpressRouteCrossConnections in a subscription. + + :return: An iterator like instance of either ExpressRouteCrossConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connections_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRouteCrossConnection"]: + """Retrieves all the ExpressRouteCrossConnections in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRouteCrossConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connections_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, cross_connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Gets details about the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group (peering location of the circuit). + Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection (service key of the + circuit). Required. + :type cross_connection_name: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_get_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: Union[_models.ExpressRouteCrossConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRouteCrossConnection") + + _request = build_express_route_cross_connections_create_or_update_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: _models.ExpressRouteCrossConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCrossConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCrossConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: Union[_models.ExpressRouteCrossConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnection]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + Is either a ExpressRouteCrossConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection or + IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteCrossConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCrossConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCrossConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Required. + :type cross_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Required. + :type cross_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnection: + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. Required. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type cross_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cross_connection_parameters, (IOBase, bytes)): + _content = cross_connection_parameters + else: + _json = self._serialize.body(cross_connection_parameters, "TagsObject") + + _request = build_express_route_cross_connections_update_tags_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _list_arp_table_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsArpTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsArpTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_list_arp_table_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_arp_table( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitsArpTableListResult]: + """Gets the currently advertised ARP table associated with the express route cross connection in a + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitsArpTableListResult or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsArpTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_arp_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitsArpTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitsArpTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_routes_table_summary_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]] = kwargs.pop( + "cls", None + ) + + _request = build_express_route_cross_connections_list_routes_table_summary_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize( + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", pipeline_response + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_routes_table_summary( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]: + """Gets the route table summary associated with the express route cross connection in a resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of LROPoller that returns either + ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "ExpressRouteCrossConnectionsRoutesTableSummaryListResult", pipeline_response + ) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_routes_table_initial( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> Optional[_models.ExpressRouteCircuitsRoutesTableListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.ExpressRouteCircuitsRoutesTableListResult]] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connections_list_routes_table_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_routes_table( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, device_path: str, **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]: + """Gets the currently advertised routes table associated with the express route cross connection + in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param device_path: The path of the device. Required. + :type device_path: str + :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableListResult + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCircuitsRoutesTableListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_routes_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCircuitsRoutesTableListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCircuitsRoutesTableListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExpressRouteCrossConnectionPeeringsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_cross_connection_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, cross_connection_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRouteCrossConnectionPeering"]: + """Gets all peerings in a specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :return: An iterator like instance of either ExpressRouteCrossConnectionPeering or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionPeeringList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_cross_connection_peerings_list_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionPeeringList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connection_peerings_delete_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified peering from the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, cross_connection_name: str, peering_name: str, **kwargs: Any + ) -> _models.ExpressRouteCrossConnectionPeering: + """Gets the specified peering for the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + + _request = build_express_route_cross_connection_peerings_get_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCrossConnectionPeering, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteCrossConnectionPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(peering_parameters, (IOBase, bytes)): + _content = peering_parameters + else: + _json = self._serialize.body(peering_parameters, "ExpressRouteCrossConnectionPeering") + + _request = build_express_route_cross_connection_peerings_create_or_update_request( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: _models.ExpressRouteCrossConnectionPeering, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Required. + :type peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCrossConnectionPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Required. + :type peering_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteCrossConnectionPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: Union[_models.ExpressRouteCrossConnectionPeering, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteCrossConnectionPeering]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. Required. + :type cross_connection_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. Is either a ExpressRouteCrossConnectionPeering + type or a IO[bytes] type. Required. + :type peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteCrossConnectionPeering or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteCrossConnectionPeering] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteCrossConnectionPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteCrossConnectionPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteCrossConnectionPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExpressRoutePortsLocationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_ports_locations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ExpressRoutePortsLocation"]: + """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each + location. Available bandwidths can only be obtained when retrieving a specific peering + location. + + :return: An iterator like instance of either ExpressRoutePortsLocation or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortsLocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_locations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortsLocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, location_name: str, **kwargs: Any) -> _models.ExpressRoutePortsLocation: + """Retrieves a single ExpressRoutePort peering location, including the list of available + bandwidths available at said peering location. + + :param location_name: Name of the requested ExpressRoutePort peering location. Required. + :type location_name: str + :return: ExpressRoutePortsLocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortsLocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortsLocation] = kwargs.pop("cls", None) + + _request = build_express_route_ports_locations_get_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePortsLocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRoutePortsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_ports` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_ports_delete_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, express_route_port_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, express_route_port_name: str, **kwargs: Any) -> _models.ExpressRoutePort: + """Retrieves the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + _request = build_express_route_ports_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.ExpressRoutePort, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExpressRoutePort") + + _request = build_express_route_ports_create_or_update_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: _models.ExpressRoutePort, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.ExpressRoutePort, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRoutePort]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. Is either a + ExpressRoutePort type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRoutePort or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRoutePort].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRoutePort]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePort: + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ExpressRoutePort or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePort] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_express_route_ports_update_tags_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePort", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ExpressRoutePort"]: + """List all the ExpressRoutePort resources in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ExpressRoutePort"]: + """List all the ExpressRoutePort resources in the specified subscription. + + :return: An iterator like instance of either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_ports_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: _models.GenerateExpressRoutePortsLOARequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOARequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: Union[_models.GenerateExpressRoutePortsLOARequest, IO[bytes]], + **kwargs: Any + ) -> _models.GenerateExpressRoutePortsLOAResult: + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. Required. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. Is either a + GenerateExpressRoutePortsLOARequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOARequest or + IO[bytes] + :return: GenerateExpressRoutePortsLOAResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.GenerateExpressRoutePortsLOAResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateExpressRoutePortsLOAResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "GenerateExpressRoutePortsLOARequest") + + _request = build_express_route_ports_generate_loa_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GenerateExpressRoutePortsLOAResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ExpressRouteLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, express_route_port_name: str, link_name: str, **kwargs: Any + ) -> _models.ExpressRouteLink: + """Retrieves the specified ExpressRouteLink resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :param link_name: The name of the ExpressRouteLink resource. Required. + :type link_name: str + :return: ExpressRouteLink or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteLink] = kwargs.pop("cls", None) + + _request = build_express_route_links_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + link_name=link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRouteLink"]: + """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. Required. + :type express_route_port_name: str + :return: An iterator like instance of either ExpressRouteLink or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRouteLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteLinkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_links_list_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRouteLinkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRoutePortAuthorizationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_port_authorizations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_port_authorizations_delete_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified authorization from the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, express_route_port_name: str, authorization_name: str, **kwargs: Any + ) -> _models.ExpressRoutePortAuthorization: + """Gets the specified authorization from the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :return: ExpressRoutePortAuthorization or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + + _request = build_express_route_port_authorizations_get_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRoutePortAuthorization, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRoutePortAuthorization: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(authorization_parameters, (IOBase, bytes)): + _content = authorization_parameters + else: + _json = self._serialize.body(authorization_parameters, "ExpressRoutePortAuthorization") + + _request = build_express_route_port_authorizations_create_or_update_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: _models.ExpressRoutePortAuthorization, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Required. + :type authorization_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + authorization_name: str, + authorization_parameters: Union[_models.ExpressRoutePortAuthorization, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRoutePortAuthorization]: + """Creates or updates an authorization in the specified express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :param authorization_name: The name of the authorization. Required. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route port + authorization operation. Is either a ExpressRoutePortAuthorization type or a IO[bytes] type. + Required. + :type authorization_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRoutePortAuthorization or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRoutePortAuthorization] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortAuthorization", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRoutePortAuthorization].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRoutePortAuthorization]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, express_route_port_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressRoutePortAuthorization"]: + """Gets all authorizations in an express route port. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_port_name: The name of the express route port. Required. + :type express_route_port_name: str + :return: An iterator like instance of either ExpressRoutePortAuthorization or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ExpressRoutePortAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRoutePortAuthorizationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_express_route_port_authorizations_list_request( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExpressRoutePortAuthorizationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteProviderPortsLocationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_provider_ports_location` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, *, filter: Optional[str] = None, **kwargs: Any) -> _models.ExpressRouteProviderPortListResult: + """Retrieves all the ExpressRouteProviderPorts in a subscription. + + :keyword filter: The filter to apply on the operation. For example, you can use + $filter=location eq '{state}'. Default value is None. + :paramtype filter: str + :return: ExpressRouteProviderPortListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteProviderPortListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteProviderPortListResult] = kwargs.pop("cls", None) + + _request = build_express_route_provider_ports_location_list_request( + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteProviderPortListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`firewall_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policies_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, firewall_policy_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.FirewallPolicy: + """Gets the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + _request = build_firewall_policies_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicy") + + _request = build_firewall_policies_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.FirewallPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.FirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FirewallPolicy]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. Is + either a FirewallPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy or IO[bytes] + :return: An instance of LROPoller that returns either FirewallPolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FirewallPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FirewallPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicy: + """Updates tags of a Azure Firewall Policy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Parameters supplied to update Azure Firewall Policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: FirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_firewall_policies_update_tags_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.FirewallPolicy"]: + """Lists all Firewall Policies in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policies_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.FirewallPolicy"]: + """Gets all the Firewall Policies in a subscription. + + :return: An iterator like instance of either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policies_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FirewallPolicyRuleCollectionGroupsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`firewall_policy_rule_collection_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_groups_delete_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroup: + """Gets the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :return: FirewallPolicyRuleCollectionGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + + _request = build_firewall_policy_rule_collection_groups_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroup, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallPolicyRuleCollectionGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FirewallPolicyRuleCollectionGroup") + + _request = build_firewall_policy_rule_collection_groups_create_or_update_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: _models.FirewallPolicyRuleCollectionGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FirewallPolicyRuleCollectionGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FirewallPolicyRuleCollectionGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: Union[_models.FirewallPolicyRuleCollectionGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FirewallPolicyRuleCollectionGroup]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. Required. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. Is either a FirewallPolicyRuleCollectionGroup type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup or + IO[bytes] + :return: An instance of LROPoller that returns either FirewallPolicyRuleCollectionGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FirewallPolicyRuleCollectionGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FirewallPolicyRuleCollectionGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> Iterable["_models.FirewallPolicyRuleCollectionGroup"]: + """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: An iterator like instance of either FirewallPolicyRuleCollectionGroup or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FirewallPolicyRuleCollectionGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_policy_rule_collection_groups_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallPolicyRuleCollectionGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FirewallPolicyIdpsSignaturesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.IDPSQueryObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IDPSQueryObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.IDPSQueryObject, IO[bytes]], + **kwargs: Any + ) -> _models.QueryResults: + """Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of + returned signatures is 1000. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Is either a IDPSQueryObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IDPSQueryObject or IO[bytes] + :return: QueryResults or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.QueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResults] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IDPSQueryObject") + + _request = build_firewall_policy_idps_signatures_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("QueryResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesOverridesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures_overrides` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.SignaturesOverrides, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def patch( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignaturesOverrides, IO[bytes]], + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will update the status of policy's signature overrides for IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Is either a + SignaturesOverrides type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides or IO[bytes] + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignaturesOverrides") + + _request = build_firewall_policy_idps_signatures_overrides_patch_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.SignaturesOverrides, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignaturesOverrides, IO[bytes]], + **kwargs: Any + ) -> _models.SignaturesOverrides: + """Will override/create a new signature overrides for the policy's IDPS. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Will contain all properties of the object to put. Is either a + SignaturesOverrides type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides or IO[bytes] + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignaturesOverrides") + + _request = build_firewall_policy_idps_signatures_overrides_put_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any) -> _models.SignaturesOverrides: + """Returns all signatures overrides for a specific policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: SignaturesOverrides or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverrides + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SignaturesOverrides] = kwargs.pop("cls", None) + + _request = build_firewall_policy_idps_signatures_overrides_get_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverrides", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, firewall_policy_name: str, **kwargs: Any + ) -> _models.SignaturesOverridesList: + """Returns all signatures overrides objects for a specific policy as a list containing a single + value. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :return: SignaturesOverridesList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignaturesOverridesList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SignaturesOverridesList] = kwargs.pop("cls", None) + + _request = build_firewall_policy_idps_signatures_overrides_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignaturesOverridesList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class FirewallPolicyIdpsSignaturesFilterValuesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`firewall_policy_idps_signatures_filter_values` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: _models.SignatureOverridesFilterValuesQuery, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesQuery + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: Union[_models.SignatureOverridesFilterValuesQuery, IO[bytes]], + **kwargs: Any + ) -> _models.SignatureOverridesFilterValuesResponse: + """Retrieves the current filter values for the signatures overrides. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. Required. + :type firewall_policy_name: str + :param parameters: Is either a SignatureOverridesFilterValuesQuery type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesQuery or + IO[bytes] + :return: SignatureOverridesFilterValuesResponse or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SignatureOverridesFilterValuesResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SignatureOverridesFilterValuesResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SignatureOverridesFilterValuesQuery") + + _request = build_firewall_policy_idps_signatures_filter_values_list_request( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SignatureOverridesFilterValuesResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class IpAllocationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`ip_allocations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ip_allocation_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ip_allocations_delete_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ip_allocation_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified IpAllocation. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, ip_allocation_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.IpAllocation: + """Gets the specified IpAllocation by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + _request = build_ip_allocations_get_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.IpAllocation, IO[bytes]], + **kwargs: Any + ) -> _models.IpAllocation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IpAllocation") + + _request = build_ip_allocations_create_or_update_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: _models.IpAllocation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.IpAllocation, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpAllocation]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. Is + either a IpAllocation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpAllocation or IO[bytes] + :return: An instance of LROPoller that returns either IpAllocation or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IpAllocation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpAllocation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpAllocation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.IpAllocation: + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. Required. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: IpAllocation or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpAllocation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpAllocation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ip_allocations_update_tags_request( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpAllocation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.IpAllocation"]: + """Gets all IpAllocations in a subscription. + + :return: An iterator like instance of either IpAllocation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpAllocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_allocations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("IpAllocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.IpAllocation"]: + """Gets all IpAllocations in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either IpAllocation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpAllocationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_allocations_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("IpAllocationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class IpGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`ip_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, ip_groups_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.IpGroup: + """Gets the specified ipGroups. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :keyword expand: Expands resourceIds (of Firewalls/Network Security Groups etc.) back + referenced by the IpGroups resource. Default value is None. + :paramtype expand: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + _request = build_ip_groups_get_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.IpGroup, IO[bytes]], + **kwargs: Any + ) -> _models.IpGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "IpGroup") + + _request = build_ip_groups_create_or_update_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("IpGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: _models.IpGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.IpGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpGroup]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. Is either a + IpGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.IpGroup or IO[bytes] + :return: An instance of LROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IpGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.IpGroup: + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: IpGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IpGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_ip_groups_update_groups_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IpGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, ip_groups_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ip_groups_delete_request( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ip_groups_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified ipGroups. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. Required. + :type ip_groups_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.IpGroup"]: + """Gets all IpGroups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either IpGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("IpGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.IpGroup"]: + """Gets all IpGroups in a subscription. + + :return: An iterator like instance of either IpGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IpGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ip_groups_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("IpGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_load_balancers_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, load_balancer_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, load_balancer_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_load_balancers_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LoadBalancer") + + _request = build_load_balancers_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: _models.LoadBalancer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LoadBalancer]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. Is + either a LoadBalancer type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer or IO[bytes] + :return: An instance of LROPoller that returns either LoadBalancer or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LoadBalancer", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LoadBalancer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LoadBalancer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_load_balancers_update_tags_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.LoadBalancer"]: + """Gets all the load balancers in a subscription. + + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.LoadBalancer"]: + """Gets all the load balancers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _swap_public_ip_addresses_initial( # pylint: disable=inconsistent-return-statements + self, location: str, parameters: Union[_models.LoadBalancerVipSwapRequest, IO[bytes]], **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LoadBalancerVipSwapRequest") + + _request = build_load_balancers_swap_public_ip_addresses_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_swap_public_ip_addresses( + self, + location: str, + parameters: _models.LoadBalancerVipSwapRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancerVipSwapRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_swap_public_ip_addresses( + self, location: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_swap_public_ip_addresses( + self, location: str, parameters: Union[_models.LoadBalancerVipSwapRequest, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Swaps VIPs between two load balancers. + + :param location: The region where load balancers are located at. Required. + :type location: str + :param parameters: Parameters that define which VIPs should be swapped. Is either a + LoadBalancerVipSwapRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LoadBalancerVipSwapRequest or + IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._swap_public_ip_addresses_initial( # type: ignore + location=location, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _list_inbound_nat_rule_port_mappings_initial( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: Union[_models.QueryInboundNatRulePortMappingRequest, IO[bytes]], + **kwargs: Any + ) -> _models.BackendAddressInboundNatRulePortMappings: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressInboundNatRulePortMappings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryInboundNatRulePortMappingRequest") + + _request = build_load_balancers_list_inbound_nat_rule_port_mappings_request( + group_name=group_name, + load_balancer_name=load_balancer_name, + backend_pool_name=backend_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: _models.QueryInboundNatRulePortMappingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryInboundNatRulePortMappingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BackendAddressInboundNatRulePortMappings + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BackendAddressInboundNatRulePortMappings + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_list_inbound_nat_rule_port_mappings( # pylint: disable=name-too-long + self, + group_name: str, + load_balancer_name: str, + backend_pool_name: str, + parameters: Union[_models.QueryInboundNatRulePortMappingRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BackendAddressInboundNatRulePortMappings]: + """List of inbound NAT rule port mappings. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_pool_name: The name of the load balancer backend address pool. Required. + :type backend_pool_name: str + :param parameters: Query inbound NAT rule port mapping request. Is either a + QueryInboundNatRulePortMappingRequest type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryInboundNatRulePortMappingRequest + or IO[bytes] + :return: An instance of LROPoller that returns either BackendAddressInboundNatRulePortMappings + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressInboundNatRulePortMappings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressInboundNatRulePortMappings] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_inbound_nat_rule_port_mappings_initial( + group_name=group_name, + load_balancer_name=load_balancer_name, + backend_pool_name=backend_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BackendAddressInboundNatRulePortMappings", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BackendAddressInboundNatRulePortMappings].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BackendAddressInboundNatRulePortMappings]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[_models.MigrateLoadBalancerToIpBasedRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.MigrateLoadBalancerToIpBasedRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def migrate_to_ip_based( + self, + group_name: str, + load_balancer_name: str, + parameters: Optional[Union[_models.MigrateLoadBalancerToIpBasedRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.MigratedPools: + """Migrate load balancer to IP Based. + + :param group_name: The name of the resource group. Required. + :type group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: Parameters supplied to the migrateToIpBased Api. Is either a + MigrateLoadBalancerToIpBasedRequest type or a IO[bytes] type. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.MigrateLoadBalancerToIpBasedRequest or + IO[bytes] + :return: MigratedPools or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.MigratedPools + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MigratedPools] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "MigrateLoadBalancerToIpBasedRequest") + else: + _json = None + + _request = build_load_balancers_migrate_to_ip_based_request( + group_name=group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MigratedPools", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LoadBalancerBackendAddressPoolsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancer_backend_address_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterable["_models.BackendAddressPool"]: + """Gets all the load balancer backed address pools. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either BackendAddressPool or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerBackendAddressPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_backend_address_pools_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerBackendAddressPoolListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> _models.BackendAddressPool: + """Gets load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :return: BackendAddressPool or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BackendAddressPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + + _request = build_load_balancer_backend_address_pools_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: Union[_models.BackendAddressPool, IO[bytes]], + **kwargs: Any + ) -> _models.BackendAddressPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BackendAddressPool") + + _request = build_load_balancer_backend_address_pools_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: _models.BackendAddressPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BackendAddressPool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: Union[_models.BackendAddressPool, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BackendAddressPool]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. Is either a BackendAddressPool type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BackendAddressPool or IO[bytes] + :return: An instance of LROPoller that returns either BackendAddressPool or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackendAddressPool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BackendAddressPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BackendAddressPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BackendAddressPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_load_balancer_backend_address_pools_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified load balancer backend address pool. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. Required. + :type backend_address_pool_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class LoadBalancerFrontendIPConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancer_frontend_ip_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterable["_models.FrontendIPConfiguration"]: + """Gets all the load balancer frontend IP configurations. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either FrontendIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerFrontendIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_frontend_ip_configurations_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerFrontendIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs: Any + ) -> _models.FrontendIPConfiguration: + """Gets load balancer frontend IP configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param frontend_ip_configuration_name: The name of the frontend IP configuration. Required. + :type frontend_ip_configuration_name: str + :return: FrontendIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FrontendIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FrontendIPConfiguration] = kwargs.pop("cls", None) + + _request = build_load_balancer_frontend_ip_configurations_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + frontend_ip_configuration_name=frontend_ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FrontendIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InboundNatRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`inbound_nat_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterable["_models.InboundNatRule"]: + """Gets all the inbound NAT rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.InboundNatRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_inbound_nat_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("InboundNatRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_inbound_nat_rules_delete_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.InboundNatRule: + """Gets the specified load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: InboundNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.InboundNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + + _request = build_inbound_nat_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: Union[_models.InboundNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.InboundNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(inbound_nat_rule_parameters, (IOBase, bytes)): + _content = inbound_nat_rule_parameters + else: + _json = self._serialize.body(inbound_nat_rule_parameters, "InboundNatRule") + + _request = build_inbound_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InboundNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: _models.InboundNatRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Required. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.InboundNatRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Required. + :type inbound_nat_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: Union[_models.InboundNatRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InboundNatRule]: + """Creates or updates a load balancer inbound NAT rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound NAT rule. Required. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound NAT + rule operation. Is either a InboundNatRule type or a IO[bytes] type. Required. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.InboundNatRule or + IO[bytes] + :return: An instance of LROPoller that returns either InboundNatRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundNatRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + inbound_nat_rule_parameters=inbound_nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InboundNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InboundNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InboundNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class LoadBalancerLoadBalancingRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancer_load_balancing_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterable["_models.LoadBalancingRule"]: + """Gets all the load balancing rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either LoadBalancingRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerLoadBalancingRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_load_balancing_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerLoadBalancingRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, load_balancer_name: str, load_balancing_rule_name: str, **kwargs: Any + ) -> _models.LoadBalancingRule: + """Gets the specified load balancer load balancing rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param load_balancing_rule_name: The name of the load balancing rule. Required. + :type load_balancing_rule_name: str + :return: LoadBalancingRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LoadBalancingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancingRule] = kwargs.pop("cls", None) + + _request = build_load_balancer_load_balancing_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + load_balancing_rule_name=load_balancing_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancingRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LoadBalancerOutboundRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancer_outbound_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterable["_models.OutboundRule"]: + """Gets all the outbound rules in a load balancer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either OutboundRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.OutboundRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerOutboundRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_outbound_rules_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerOutboundRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, load_balancer_name: str, outbound_rule_name: str, **kwargs: Any + ) -> _models.OutboundRule: + """Gets the specified load balancer outbound rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param outbound_rule_name: The name of the outbound rule. Required. + :type outbound_rule_name: str + :return: OutboundRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.OutboundRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.OutboundRule] = kwargs.pop("cls", None) + + _request = build_load_balancer_outbound_rules_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + outbound_rule_name=outbound_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OutboundRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LoadBalancerNetworkInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancer_network_interfaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterface"]: + """Gets associated load balancer network interfaces. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_network_interfaces_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LoadBalancerProbesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`load_balancer_probes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, load_balancer_name: str, **kwargs: Any) -> Iterable["_models.Probe"]: + """Gets all the load balancer probes. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An iterator like instance of either Probe or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.Probe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LoadBalancerProbeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancer_probes_list_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerProbeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, resource_group_name: str, load_balancer_name: str, probe_name: str, **kwargs: Any) -> _models.Probe: + """Gets load balancer probe. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param probe_name: The name of the probe. Required. + :type probe_name: str + :return: Probe or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Probe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.Probe] = kwargs.pop("cls", None) + + _request = build_load_balancer_probes_get_request( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + probe_name=probe_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Probe", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NatGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`nat_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, nat_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nat_gateways_delete_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, nat_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, nat_gateway_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NatGateway: + """Gets the specified nat gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + + _request = build_nat_gateways_get_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.NatGateway, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.NatGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NatGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NatGateway") + + _request = build_nat_gateways_create_or_update_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("NatGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: _models.NatGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.NatGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NatGateway]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. Is either + a NatGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NatGateway or IO[bytes] + :return: An instance of LROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NatGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NatGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NatGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NatGateway: + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. Required. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NatGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NatGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NatGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_nat_gateways_update_tags_request( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NatGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.NatGateway"]: + """Gets all the Nat Gateways in a subscription. + + :return: An iterator like instance of either NatGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NatGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_gateways_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NatGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NatGateway"]: + """Gets all nat gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NatGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NatGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NatGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkInterfaceIPConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_interface_ip_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterfaceIPConfiguration"]: + """Get all ip configurations in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either NetworkInterfaceIPConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceIPConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_ip_configurations_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceIPConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, network_interface_name: str, ip_configuration_name: str, **kwargs: Any + ) -> _models.NetworkInterfaceIPConfiguration: + """Gets the specified network interface ip configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration name. Required. + :type ip_configuration_name: str + :return: NetworkInterfaceIPConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceIPConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceIPConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interface_ip_configurations_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + ip_configuration_name=ip_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceIPConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkInterfaceLoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_interface_load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Iterable["_models.LoadBalancer"]: + """List all load balancers in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceLoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_load_balancers_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceLoadBalancerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkInterfaceTapConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_interface_tap_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_interface_tap_configurations_delete_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified tap configuration from the NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_interface_name: str, tap_configuration_name: str, **kwargs: Any + ) -> _models.NetworkInterfaceTapConfiguration: + """Get the specified tap configuration on a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :return: NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + + _request = build_network_interface_tap_configurations_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: Union[_models.NetworkInterfaceTapConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkInterfaceTapConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_configuration_parameters, (IOBase, bytes)): + _content = tap_configuration_parameters + else: + _json = self._serialize.body(tap_configuration_parameters, "NetworkInterfaceTapConfiguration") + + _request = build_network_interface_tap_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: _models.NetworkInterfaceTapConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Required. + :type tap_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkInterfaceTapConfiguration or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Required. + :type tap_configuration_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkInterfaceTapConfiguration or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: Union[_models.NetworkInterfaceTapConfiguration, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaceTapConfiguration]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. Required. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. Is either a NetworkInterfaceTapConfiguration type or a IO[bytes] type. + Required. + :type tap_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration or IO[bytes] + :return: An instance of LROPoller that returns either NetworkInterfaceTapConfiguration or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkInterfaceTapConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + tap_configuration_parameters=tap_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceTapConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkInterfaceTapConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkInterfaceTapConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkInterfaceTapConfiguration"]: + """Get all Tap configurations in a network interface. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. Required. + :type network_interface_name: str + :return: An iterator like instance of either NetworkInterfaceTapConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkInterfaceTapConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_interface_tap_configurations_list_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkInterfaceTapConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkManagersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_managers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, network_manager_name: str, **kwargs: Any) -> _models.NetworkManager: + """Gets the specified Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + _request = build_network_managers_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.NetworkManager, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManager, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Creates or updates a Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Is either a + NetworkManager type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManager or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManager") + + _request = build_network_managers_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_managers_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_manager_name: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.PatchObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PatchObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def patch( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.PatchObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManager: + """Patch NetworkManager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which network manager is. Is either a + PatchObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PatchObject or IO[bytes] + :return: NetworkManager or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PatchObject") + + _request = build_network_managers_patch_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManager", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.NetworkManager"]: + """List all network managers in a subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManager or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_managers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.NetworkManager"]: + """List network managers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManager or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_managers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkManagerCommitsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_manager_commits` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _post_initial( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerCommit: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerCommit") + + _request = build_network_manager_commits_post_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.NetworkManagerCommit, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkManagerCommit or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkManagerCommit or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_post( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerCommit, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkManagerCommit]: + """Post a Network Manager Commit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network commit is. Is either a + NetworkManagerCommit type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit or IO[bytes] + :return: An instance of LROPoller that returns either NetworkManagerCommit or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkManagerCommit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerCommit] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._post_initial( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkManagerCommit", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkManagerCommit].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkManagerCommit]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkManagerDeploymentStatusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_manager_deployment_status` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: _models.NetworkManagerDeploymentStatusParameter, + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusParameter + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: IO[bytes], + *, + top: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Required. + :type parameters: IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + parameters: Union[_models.NetworkManagerDeploymentStatusParameter, IO[bytes]], + *, + top: Optional[int] = None, + **kwargs: Any + ) -> _models.NetworkManagerDeploymentStatusListResult: + """Post to List of Network Manager Deployment Status. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param parameters: Parameters supplied to specify which Managed Network deployment status is. + Is either a NetworkManagerDeploymentStatusParameter type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusParameter or IO[bytes] + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :return: NetworkManagerDeploymentStatusListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerDeploymentStatusListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerDeploymentStatusListResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerDeploymentStatusParameter") + + _request = build_network_manager_deployment_status_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerDeploymentStatusListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SubscriptionNetworkManagerConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`subscription_network_manager_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def create_or_update( + self, + network_manager_connection_name: str, + parameters: _models.NetworkManagerConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + network_manager_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + network_manager_connection_name: str, + parameters: Union[_models.NetworkManagerConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Is either a + NetworkManagerConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection or IO[bytes] + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerConnection") + + _request = build_subscription_network_manager_connections_create_or_update_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, network_manager_connection_name: str, **kwargs: Any) -> _models.NetworkManagerConnection: + """Get a specified connection created by this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + _request = build_subscription_network_manager_connections_get_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, network_manager_connection_name: str, **kwargs: Any + ) -> None: + """Delete specified connection created by this subscription. + + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_subscription_network_manager_connections_delete_request( + network_manager_connection_name=network_manager_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.NetworkManagerConnection"]: + """List all network manager connections created by this subscription. + + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManagerConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subscription_network_manager_connections_list_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagementGroupNetworkManagerConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`management_group_network_manager_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: _models.NetworkManagerConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + management_group_id: str, + network_manager_connection_name: str, + parameters: Union[_models.NetworkManagerConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Create a network manager connection on this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :param parameters: Network manager connection to be created/updated. Is either a + NetworkManagerConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection or IO[bytes] + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkManagerConnection") + + _request = build_management_group_network_manager_connections_create_or_update_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, management_group_id: str, network_manager_connection_name: str, **kwargs: Any + ) -> _models.NetworkManagerConnection: + """Get a specified connection created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: NetworkManagerConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnection] = kwargs.pop("cls", None) + + _request = build_management_group_network_manager_connections_get_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkManagerConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, management_group_id: str, network_manager_connection_name: str, **kwargs: Any + ) -> None: + """Delete specified pending connection created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :param network_manager_connection_name: Name for the network manager connection. Required. + :type network_manager_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_management_group_network_manager_connections_delete_request( + management_group_id=management_group_id, + network_manager_connection_name=network_manager_connection_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, management_group_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.NetworkManagerConnection"]: + """List all network manager connections created by this management group. + + :param management_group_id: The management group Id which uniquely identify the Microsoft Azure + management group. Required. + :type management_group_id: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkManagerConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkManagerConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkManagerConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_management_group_network_manager_connections_list_request( + management_group_id=management_group_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkManagerConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ConnectivityConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`connectivity_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Gets a Network Connectivity Configuration, specified by the resource group, network manager + name, and connectivity Configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectivityConfiguration] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: _models.ConnectivityConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Required. + :type connectivity_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Required. + :type connectivity_configuration: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + connectivity_configuration: Union[_models.ConnectivityConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectivityConfiguration: + """Creates/Updates a new network manager connectivity configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :param connectivity_configuration: Parameters supplied to create/update a network manager + connectivity configuration. Is either a ConnectivityConfiguration type or a IO[bytes] type. + Required. + :type connectivity_configuration: + ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration or IO[bytes] + :return: ConnectivityConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(connectivity_configuration, (IOBase, bytes)): + _content = connectivity_configuration + else: + _json = self._serialize.body(connectivity_configuration, "ConnectivityConfiguration") + + _request = build_connectivity_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectivityConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connectivity_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a network manager connectivity configuration, specified by the resource group, network + manager name, and connectivity configuration name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager connectivity configuration. + Required. + :type configuration_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ConnectivityConfiguration"]: + """Lists all the network manager connectivity configuration in a specified network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either ConnectivityConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ConnectivityConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectivityConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connectivity_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectivityConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, network_manager_name: str, network_group_name: str, **kwargs: Any + ) -> _models.NetworkGroup: + """Gets the specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkGroup] = kwargs.pop("cls", None) + + _request = build_network_groups_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: _models.NetworkGroup, + *, + if_match: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: IO[bytes], + *, + if_match: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. + Required. + :type parameters: IO[bytes] + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + parameters: Union[_models.NetworkGroup, IO[bytes]], + *, + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkGroup: + """Creates or updates a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param parameters: Parameters supplied to the specify which network group need to create. Is + either a NetworkGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup or IO[bytes] + :keyword if_match: The ETag of the transformation. Omit this value to always overwrite the + current resource. Specify the last-seen ETag value to prevent accidentally overwriting + concurrent changes. Default value is None. + :paramtype if_match: str + :return: NetworkGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkGroup") + + _request = build_network_groups_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if response.status_code == 201: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + deserialized = self._deserialize("NetworkGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_groups_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.NetworkGroup"]: + """Lists the specified network group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either NetworkGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_groups_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class StaticMembersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`static_members` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + **kwargs: Any + ) -> _models.StaticMember: + """Gets the specified static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.StaticMember] = kwargs.pop("cls", None) + + _request = build_static_members_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("StaticMember", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: _models.StaticMember, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + parameters: Union[_models.StaticMember, IO[bytes]], + **kwargs: Any + ) -> _models.StaticMember: + """Creates or updates a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :param parameters: Parameters supplied to the specify the static member to create. Is either a + StaticMember type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.StaticMember or IO[bytes] + :return: StaticMember or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.StaticMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StaticMember] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "StaticMember") + + _request = build_static_members_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("StaticMember", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("StaticMember", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + static_member_name: str, + **kwargs: Any + ) -> None: + """Deletes a static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :param static_member_name: The name of the static member. Required. + :type static_member_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_static_members_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + static_member_name=static_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + network_group_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.StaticMember"]: + """Lists the specified static member. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param network_group_name: The name of the network group. Required. + :type network_group_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either StaticMember or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.StaticMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.StaticMemberListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_static_members_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + network_group_name=network_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("StaticMemberListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ScopeConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`scope_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: _models.ScopeConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + scope_connection_name: str, + parameters: Union[_models.ScopeConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ScopeConnection: + """Creates or updates scope connection from Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :param parameters: Scope connection to be created/updated. Is either a ScopeConnection type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection or IO[bytes] + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScopeConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ScopeConnection") + + _request = build_scope_connections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_manager_name: str, scope_connection_name: str, **kwargs: Any + ) -> _models.ScopeConnection: + """Get specified scope connection created by this Network Manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :return: ScopeConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ScopeConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ScopeConnection] = kwargs.pop("cls", None) + + _request = build_scope_connections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ScopeConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_manager_name: str, scope_connection_name: str, **kwargs: Any + ) -> None: + """Delete the pending scope connection created by this network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param scope_connection_name: Name for the cross-tenant connection. Required. + :type scope_connection_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_scope_connections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + scope_connection_name=scope_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ScopeConnection"]: + """List all scope connections created by this network manager. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either ScopeConnection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ScopeConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ScopeConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_scope_connections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ScopeConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SecurityAdminConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`security_admin_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.SecurityAdminConfiguration"]: + """Lists all the network manager security admin configurations in a network manager, in a + paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either SecurityAdminConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityAdminConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_admin_configurations_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityAdminConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Retrieves a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityAdminConfiguration] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: _models.SecurityAdminConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. + Required. + :type security_admin_configuration: + ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. + Required. + :type security_admin_configuration: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + security_admin_configuration: Union[_models.SecurityAdminConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityAdminConfiguration: + """Creates or updates a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param security_admin_configuration: The security admin configuration to create or update. Is + either a SecurityAdminConfiguration type or a IO[bytes] type. Required. + :type security_admin_configuration: + ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration or IO[bytes] + :return: SecurityAdminConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityAdminConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAdminConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_admin_configuration, (IOBase, bytes)): + _content = security_admin_configuration + else: + _json = self._serialize.body(security_admin_configuration, "SecurityAdminConfiguration") + + _request = build_security_admin_configurations_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityAdminConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_admin_configurations_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a network manager security admin configuration. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AdminRuleCollectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`admin_rule_collections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.AdminRuleCollection"]: + """Lists all the rule collections in a security admin configuration, in a paginated format. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either AdminRuleCollection or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AdminRuleCollectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_admin_rule_collections_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AdminRuleCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Gets a network manager security admin configuration rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AdminRuleCollection] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: _models.AdminRuleCollection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Required. + :type rule_collection: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Required. + :type rule_collection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_collection: Union[_models.AdminRuleCollection, IO[bytes]], + **kwargs: Any + ) -> _models.AdminRuleCollection: + """Creates or updates an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_collection: The Rule Collection to create or update. Is either a + AdminRuleCollection type or a IO[bytes] type. Required. + :type rule_collection: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection or IO[bytes] + :return: AdminRuleCollection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.AdminRuleCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdminRuleCollection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(rule_collection, (IOBase, bytes)): + _content = rule_collection + else: + _json = self._serialize.body(rule_collection, "AdminRuleCollection") + + _request = build_admin_rule_collections_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AdminRuleCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rule_collections_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an admin rule collection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class AdminRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`admin_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.BaseAdminRule"]: + """List all network manager security configuration admin rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :keyword top: An optional query parameter which specifies the maximum number of records to be + returned by the server. Default value is None. + :paramtype top: int + :keyword skip_token: SkipToken is only used if a previous operation returned a partial result. + If a previous response contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use for subsequent calls. + Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of either BaseAdminRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BaseAdminRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AdminRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_admin_rules_list_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AdminRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + **kwargs: Any + ) -> _models.BaseAdminRule: + """Gets a network manager security configuration admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BaseAdminRule] = kwargs.pop("cls", None) + + _request = build_admin_rules_get_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: _models.BaseAdminRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Required. + :type admin_rule: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Required. + :type admin_rule: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + admin_rule: Union[_models.BaseAdminRule, IO[bytes]], + **kwargs: Any + ) -> _models.BaseAdminRule: + """Creates or updates an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :param admin_rule: The admin rule to create or update. Is either a BaseAdminRule type or a + IO[bytes] type. Required. + :type admin_rule: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule or IO[bytes] + :return: BaseAdminRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BaseAdminRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BaseAdminRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(admin_rule, (IOBase, bytes)): + _content = admin_rule + else: + _json = self._serialize.body(admin_rule, "BaseAdminRule") + + _request = build_admin_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BaseAdminRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_admin_rules_delete_request( + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + force=force, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + network_manager_name: str, + configuration_name: str, + rule_collection_name: str, + rule_name: str, + *, + force: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an admin rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_manager_name: The name of the network manager. Required. + :type network_manager_name: str + :param configuration_name: The name of the network manager Security Configuration. Required. + :type configuration_name: str + :param rule_collection_name: The name of the network manager security Configuration rule + collection. Required. + :type rule_collection_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :keyword force: Deletes the resource even if it is part of a deployed configuration. If the + configuration has been deployed, the service will do a cleanup deployment in the background, + prior to the delete. Default value is None. + :paramtype force: bool + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_manager_name=network_manager_name, + configuration_name=configuration_name, + rule_collection_name=rule_collection_name, + rule_name=rule_name, + force=force, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NetworkProfilesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_profiles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_profile_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_profiles_delete_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_profile_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the NetworkProfile. Required. + :type network_profile_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_profile_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkProfile: + """Gets the specified network profile in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the public IP prefix. Required. + :type network_profile_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + _request = build_network_profiles_get_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: _models.NetworkProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: Union[_models.NetworkProfile, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkProfile: + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. Is + either a NetworkProfile type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile or IO[bytes] + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkProfile") + + _request = build_network_profiles_create_or_update_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkProfile: + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. Required. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_profiles_update_tags_request( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.NetworkProfile"]: + """Gets all the network profiles in a subscription. + + :return: An iterator like instance of either NetworkProfile or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_profiles_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkProfile"]: + """Gets all network profiles in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkProfile or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkProfileListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_profiles_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkProfileListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkSecurityGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_security_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_security_groups_delete_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_security_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Gets the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + _request = build_network_security_groups_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.NetworkSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkSecurityGroup") + + _request = build_network_security_groups_create_or_update_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: _models.NetworkSecurityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.NetworkSecurityGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkSecurityGroup]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. Is either a NetworkSecurityGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup or IO[bytes] + :return: An instance of LROPoller that returns either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkSecurityGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkSecurityGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkSecurityGroup: + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkSecurityGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_security_groups_update_tags_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSecurityGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.NetworkSecurityGroup"]: + """Gets all network security groups in a subscription. + + :return: An iterator like instance of either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_groups_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkSecurityGroup"]: + """Gets all network security groups in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkSecurityGroup or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkSecurityGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_groups_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SecurityRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`security_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_rules_delete_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs: Any + ) -> _models.SecurityRule: + """Get the specified network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :return: SecurityRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + _request = build_security_rules_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: Union[_models.SecurityRule, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(security_rule_parameters, (IOBase, bytes)): + _content = security_rule_parameters + else: + _json = self._serialize.body(security_rule_parameters, "SecurityRule") + + _request = build_security_rules_create_or_update_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: _models.SecurityRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Required. + :type security_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Required. + :type security_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: Union[_models.SecurityRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SecurityRule]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. Required. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. Is either a SecurityRule type or a IO[bytes] type. Required. + :type security_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityRule or + IO[bytes] + :return: An instance of LROPoller that returns either SecurityRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + security_rule_parameters=security_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SecurityRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SecurityRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> Iterable["_models.SecurityRule"]: + """Gets all security rules in a network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An iterator like instance of either SecurityRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_rules_list_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DefaultSecurityRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`default_security_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, network_security_group_name: str, **kwargs: Any + ) -> Iterable["_models.SecurityRule"]: + """Gets all default security rules in a network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :return: An iterator like instance of either SecurityRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_default_security_rules_list_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, network_security_group_name: str, default_security_rule_name: str, **kwargs: Any + ) -> _models.SecurityRule: + """Get the specified default network security rule. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. Required. + :type network_security_group_name: str + :param default_security_rule_name: The name of the default security rule. Required. + :type default_security_rule_name: str + :return: SecurityRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityRule] = kwargs.pop("cls", None) + + _request = build_default_security_rules_get_request( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + default_security_rule_name=default_security_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkVirtualAppliancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_virtual_appliances` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliances_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Gets the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliances_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_virtual_appliances_update_tags_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.NetworkVirtualAppliance, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualAppliance: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkVirtualAppliance") + + _request = build_network_virtual_appliances_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: _models.NetworkVirtualAppliance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: Union[_models.NetworkVirtualAppliance, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkVirtualAppliance]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. Is + either a NetworkVirtualAppliance type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance or IO[bytes] + :return: An instance of LROPoller that returns either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualAppliance] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualAppliance", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkVirtualAppliance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkVirtualAppliance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkVirtualAppliance"]: + """Lists all Network Virtual Appliances in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliances_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.NetworkVirtualAppliance"]: + """Gets all Network Virtual Appliances in a subscription. + + :return: An iterator like instance of either NetworkVirtualAppliance or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliances_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualApplianceSitesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_appliance_sites` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_sites_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified site from a Virtual Appliance. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_virtual_appliance_name: str, site_name: str, **kwargs: Any + ) -> _models.VirtualApplianceSite: + """Gets the specified Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :return: VirtualApplianceSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_sites_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: Union[_models.VirtualApplianceSite, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualApplianceSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualApplianceSite") + + _request = build_virtual_appliance_sites_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: _models.VirtualApplianceSite, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualApplianceSite or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualApplianceSite or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: Union[_models.VirtualApplianceSite, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualApplianceSite]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. Is either a VirtualApplianceSite type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite or IO[bytes] + :return: An instance of LROPoller that returns either VirtualApplianceSite or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualApplianceSite] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualApplianceSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualApplianceSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualApplianceSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualApplianceSite"]: + """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An iterator like instance of either VirtualApplianceSite or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceSiteListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_appliance_sites_list_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceSiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualApplianceSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_appliance_skus` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.NetworkVirtualApplianceSku"]: + """List all SKUs available for a virtual appliance. + + :return: An iterator like instance of either NetworkVirtualApplianceSku or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceSkuListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_appliance_skus_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceSkuListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, sku_name: str, **kwargs: Any) -> _models.NetworkVirtualApplianceSku: + """Retrieves a single available sku for network virtual appliance. + + :param sku_name: Name of the Sku. Required. + :type sku_name: str + :return: NetworkVirtualApplianceSku or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceSku] = kwargs.pop("cls", None) + + _request = build_virtual_appliance_skus_get_request( + sku_name=sku_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualApplianceSku", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InboundSecurityRuleOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`inbound_security_rule` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: Union[_models.InboundSecurityRule, IO[bytes]], + **kwargs: Any + ) -> _models.InboundSecurityRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundSecurityRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "InboundSecurityRule") + + _request = build_inbound_security_rule_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: _models.InboundSecurityRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: Union[_models.InboundSecurityRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InboundSecurityRule]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. Required. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. Is either a InboundSecurityRule type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule or IO[bytes] + :return: An instance of LROPoller that returns either InboundSecurityRule or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InboundSecurityRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("InboundSecurityRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InboundSecurityRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InboundSecurityRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkWatchersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_watchers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.NetworkWatcher, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkWatcher, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkWatcher: + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. Is either a + NetworkWatcher type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher or IO[bytes] + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkWatcher") + + _request = build_network_watchers_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, network_watcher_name: str, **kwargs: Any) -> _models.NetworkWatcher: + """Gets the specified network watcher by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + _request = build_network_watchers_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_watchers_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_watcher_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified network watcher resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkWatcher: + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: NetworkWatcher or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkWatcher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkWatcher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_network_watchers_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkWatcher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkWatcher"]: + """Gets all network watchers by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either NetworkWatcher or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkWatcher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkWatcherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_watchers_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkWatcherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.NetworkWatcher"]: + """Gets all network watchers by subscription. + + :return: An iterator like instance of either NetworkWatcher or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkWatcher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkWatcherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_watchers_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkWatcherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.TopologyParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TopologyParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TopologyParameters, IO[bytes]], + **kwargs: Any + ) -> _models.Topology: + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. Is either a + TopologyParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TopologyParameters or IO[bytes] + :return: Topology or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Topology + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Topology] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TopologyParameters") + + _request = build_network_watchers_get_topology_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Topology", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _verify_ip_flow_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.VerificationIPFlowParameters, IO[bytes]], + **kwargs: Any + ) -> _models.VerificationIPFlowResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VerificationIPFlowResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VerificationIPFlowParameters") + + _request = build_network_watchers_verify_ip_flow_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.VerificationIPFlowParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VerificationIPFlowResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VerificationIPFlowResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.VerificationIPFlowParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VerificationIPFlowResult]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. Is either a + VerificationIPFlowParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowParameters or + IO[bytes] + :return: An instance of LROPoller that returns either VerificationIPFlowResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VerificationIPFlowResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._verify_ip_flow_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VerificationIPFlowResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VerificationIPFlowResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VerificationIPFlowResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_next_hop_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NextHopParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NextHopResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NextHopResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NextHopParameters") + + _request = build_network_watchers_get_next_hop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NextHopResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("NextHopResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.NextHopParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NextHopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NextHopParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NextHopResult]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. Is either a + NextHopParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.NextHopParameters or IO[bytes] + :return: An instance of LROPoller that returns either NextHopResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NextHopResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_next_hop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NextHopResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NextHopResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NextHopResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_vm_security_rules_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.SecurityGroupViewParameters, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityGroupViewResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityGroupViewResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SecurityGroupViewParameters") + + _request = build_network_watchers_get_vm_security_rules_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.SecurityGroupViewParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SecurityGroupViewResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SecurityGroupViewResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.SecurityGroupViewParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SecurityGroupViewResult]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. Is either a + SecurityGroupViewParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewParameters or + IO[bytes] + :return: An instance of LROPoller that returns either SecurityGroupViewResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityGroupViewResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_vm_security_rules_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityGroupViewResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SecurityGroupViewResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SecurityGroupViewResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_troubleshooting_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> _models.TroubleshootingResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TroubleshootingParameters") + + _request = build_network_watchers_get_troubleshooting_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.TroubleshootingParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TroubleshootingParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.TroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TroubleshootingResult]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. Is either a + TroubleshootingParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TroubleshootingParameters or IO[bytes] + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_troubleshooting_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TroubleshootingResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TroubleshootingResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_troubleshooting_result_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.QueryTroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> _models.TroubleshootingResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "QueryTroubleshootingParameters") + + _request = build_network_watchers_get_troubleshooting_result_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.QueryTroubleshootingParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryTroubleshootingParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.QueryTroubleshootingParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TroubleshootingResult]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. Is + either a QueryTroubleshootingParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.QueryTroubleshootingParameters or + IO[bytes] + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TroubleshootingResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_troubleshooting_result_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TroubleshootingResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TroubleshootingResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TroubleshootingResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_flow_log_configuration_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogInformation, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLogInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLogInformation") + + _request = build_network_watchers_set_flow_log_configuration_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.FlowLogInformation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogInformation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogInformation, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FlowLogInformation]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. Is either a + FlowLogInformation type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogInformation or IO[bytes] + :return: An instance of LROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_flow_log_configuration_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FlowLogInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FlowLogInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_flow_log_status_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogStatusParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLogInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLogStatusParameters") + + _request = build_network_watchers_get_flow_log_status_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.FlowLogStatusParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogStatusParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.FlowLogStatusParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FlowLogInformation]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. Is either a FlowLogStatusParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLogStatusParameters or IO[bytes] + :return: An instance of LROPoller that returns either FlowLogInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLogInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_flow_log_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLogInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FlowLogInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FlowLogInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _check_connectivity_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.ConnectivityParameters, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectivityInformation: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityInformation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectivityParameters") + + _request = build_network_watchers_check_connectivity_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.ConnectivityParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectivityParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectivityInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectivityInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.ConnectivityParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConnectivityInformation]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. Is + either a ConnectivityParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectivityParameters or IO[bytes] + :return: An instance of LROPoller that returns either ConnectivityInformation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectivityInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._check_connectivity_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectivityInformation", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConnectivityInformation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectivityInformation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_azure_reachability_report_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AzureReachabilityReportParameters, IO[bytes]], + **kwargs: Any + ) -> _models.AzureReachabilityReport: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureReachabilityReport] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AzureReachabilityReportParameters") + + _request = build_network_watchers_get_azure_reachability_report_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.AzureReachabilityReportParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AzureReachabilityReport or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AzureReachabilityReport or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AzureReachabilityReportParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AzureReachabilityReport]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. Is either + a AzureReachabilityReportParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReportParameters or + IO[bytes] + :return: An instance of LROPoller that returns either AzureReachabilityReport or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AzureReachabilityReport] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_azure_reachability_report_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AzureReachabilityReport", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AzureReachabilityReport].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AzureReachabilityReport]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_available_providers_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AvailableProvidersListParameters, IO[bytes]], + **kwargs: Any + ) -> _models.AvailableProvidersList: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AvailableProvidersList] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "AvailableProvidersListParameters") + + _request = build_network_watchers_list_available_providers_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.AvailableProvidersListParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AvailableProvidersList or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AvailableProvidersList or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.AvailableProvidersListParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AvailableProvidersList]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. Required. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. Is either a + AvailableProvidersListParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.AvailableProvidersListParameters or + IO[bytes] + :return: An instance of LROPoller that returns either AvailableProvidersList or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AvailableProvidersList] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_available_providers_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AvailableProvidersList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AvailableProvidersList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AvailableProvidersList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_network_configuration_diagnostic_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkConfigurationDiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkConfigurationDiagnosticResponse: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConfigurationDiagnosticResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkConfigurationDiagnosticParameters") + + _request = build_network_watchers_get_network_configuration_diagnostic_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: _models.NetworkConfigurationDiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkConfigurationDiagnosticResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkConfigurationDiagnosticResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_network_configuration_diagnostic( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_watcher_name: str, + parameters: Union[_models.NetworkConfigurationDiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkConfigurationDiagnosticResponse]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. Is either a + NetworkConfigurationDiagnosticParameters type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticParameters or IO[bytes] + :return: An instance of LROPoller that returns either NetworkConfigurationDiagnosticResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConfigurationDiagnosticResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_network_configuration_diagnostic_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkConfigurationDiagnosticResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkConfigurationDiagnosticResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkConfigurationDiagnosticResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class PacketCapturesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`packet_captures` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: Union[_models.PacketCapture, IO[bytes]], + **kwargs: Any + ) -> _models.PacketCaptureResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PacketCapture") + + _request = build_packet_captures_create_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: _models.PacketCapture, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PacketCapture + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: Union[_models.PacketCapture, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PacketCaptureResult]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. Is either a + PacketCapture type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PacketCapture or IO[bytes] + :return: An instance of LROPoller that returns either PacketCaptureResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PacketCaptureResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PacketCaptureResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> _models.PacketCaptureResult: + """Gets a packet capture session by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: PacketCaptureResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureResult] = kwargs.pop("cls", None) + + _request = build_packet_captures_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PacketCaptureResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_packet_captures_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_packet_captures_stop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_stop( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Stops a specified packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _get_status_initial( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> _models.PacketCaptureQueryStatusResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureQueryStatusResult] = kwargs.pop("cls", None) + + _request = build_packet_captures_get_status_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_status( + self, resource_group_name: str, network_watcher_name: str, packet_capture_name: str, **kwargs: Any + ) -> LROPoller[_models.PacketCaptureQueryStatusResult]: + """Query the status of a running packet capture session. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param packet_capture_name: The name given to the packet capture session. Required. + :type packet_capture_name: str + :return: An instance of LROPoller that returns either PacketCaptureQueryStatusResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PacketCaptureQueryStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureQueryStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PacketCaptureQueryStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PacketCaptureQueryStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PacketCaptureQueryStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> Iterable["_models.PacketCaptureResult"]: + """Lists all packet capture sessions within the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either PacketCaptureResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PacketCaptureListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_packet_captures_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PacketCaptureListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ConnectionMonitorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`connection_monitors` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.ConnectionMonitor, IO[bytes]], + *, + migrate: Optional[str] = None, + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionMonitor") + + _request = build_connection_monitors_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + migrate=migrate, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: _models.ConnectionMonitor, + *, + migrate: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitor + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectionMonitorResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: IO[bytes], + *, + migrate: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. + Required. + :type parameters: IO[bytes] + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectionMonitorResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.ConnectionMonitor, IO[bytes]], + *, + migrate: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.ConnectionMonitorResult]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. Is + either a ConnectionMonitor type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitor or IO[bytes] + :keyword migrate: Value indicating whether connection monitor V1 should be migrated to V2 + format. Default value is None. + :paramtype migrate: str + :return: An instance of LROPoller that returns either ConnectionMonitorResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + parameters=parameters, + migrate=migrate, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConnectionMonitorResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectionMonitorResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Gets a connection monitor by name. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + _request = build_connection_monitors_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectionMonitorResult: + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionMonitorResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_connection_monitors_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionMonitorResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_stop_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_stop( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Stops the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connection_monitors_start_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_start( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Starts the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _query_initial( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> _models.ConnectionMonitorQueryResult: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorQueryResult] = kwargs.pop("cls", None) + + _request = build_connection_monitors_query_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_query( + self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs: Any + ) -> LROPoller[_models.ConnectionMonitorQueryResult]: + """Query a snapshot of the most recent connection states. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :param connection_monitor_name: The name given to the connection monitor. Required. + :type connection_monitor_name: str + :return: An instance of LROPoller that returns either ConnectionMonitorQueryResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorQueryResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorQueryResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._query_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorQueryResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConnectionMonitorQueryResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectionMonitorQueryResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, network_watcher_name: str, **kwargs: Any + ) -> Iterable["_models.ConnectionMonitorResult"]: + """Lists all connection monitors for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either ConnectionMonitorResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionMonitorListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connection_monitors_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectionMonitorListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FlowLogsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`flow_logs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.FlowLog, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLog: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FlowLog") + + _request = build_flow_logs_create_or_update_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("FlowLog", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: _models.FlowLog, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.FlowLog, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FlowLog]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. Is either a + FlowLog type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.FlowLog or IO[bytes] + :return: An instance of LROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FlowLog", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FlowLog].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FlowLog]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.FlowLog: + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. Required. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. Is either a TagsObject type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_flow_logs_update_tags_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> _models.FlowLog: + """Gets a flow log resource by name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. Required. + :type flow_log_name: str + :return: FlowLog or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.FlowLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FlowLog] = kwargs.pop("cls", None) + + _request = build_flow_logs_get_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FlowLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_flow_logs_delete_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_watcher_name: str, flow_log_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified flow log resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. Required. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. Required. + :type flow_log_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, network_watcher_name: str, **kwargs: Any) -> Iterable["_models.FlowLog"]: + """Lists all flow log resources for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + Required. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. Required. + :type network_watcher_name: str + :return: An iterator like instance of either FlowLog or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.FlowLogListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_flow_logs_list_request( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FlowLogListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + """Lists all of the available Network Rest API operations. + + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PrivateEndpointsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`private_endpoints` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_endpoint_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_endpoints_delete_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, private_endpoint_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, private_endpoint_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PrivateEndpoint: + """Gets the specified private endpoint by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateEndpoint or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + + _request = build_private_endpoints_get_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: Union[_models.PrivateEndpoint, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpoint: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateEndpoint") + + _request = build_private_endpoints_create_or_update_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: _models.PrivateEndpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: Union[_models.PrivateEndpoint, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpoint]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. Is + either a PrivateEndpoint type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint or IO[bytes] + :return: An instance of LROPoller that returns either PrivateEndpoint or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpoint] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateEndpoint", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.PrivateEndpoint"]: + """Gets all private endpoints in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoints_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateEndpoint"]: + """Gets all private endpoints in a subscription. + + :return: An iterator like instance of either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoints_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AvailablePrivateEndpointTypesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`available_private_endpoint_types` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.AvailablePrivateEndpointType"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. Required. + :type location: str + :return: An iterator like instance of either AvailablePrivateEndpointType or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailablePrivateEndpointType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailablePrivateEndpointTypesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_private_endpoint_types_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailablePrivateEndpointTypesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, location: str, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.AvailablePrivateEndpointType"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AvailablePrivateEndpointType or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AvailablePrivateEndpointType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AvailablePrivateEndpointTypesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_available_private_endpoint_types_list_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailablePrivateEndpointTypesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PrivateDnsZoneGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`private_dns_zone_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_dns_zone_groups_delete_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified private dns zone group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs: Any + ) -> _models.PrivateDnsZoneGroup: + """Gets the private dns zone group resource by specified private dns zone group name. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :return: PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + + _request = build_private_dns_zone_groups_get_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: Union[_models.PrivateDnsZoneGroup, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateDnsZoneGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateDnsZoneGroup") + + _request = build_private_dns_zone_groups_create_or_update_request( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: _models.PrivateDnsZoneGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: Union[_models.PrivateDnsZoneGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateDnsZoneGroup]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. Required. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. Is either a PrivateDnsZoneGroup type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup or IO[bytes] + :return: An instance of LROPoller that returns either PrivateDnsZoneGroup or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateDnsZoneGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateDnsZoneGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateDnsZoneGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateDnsZoneGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, private_endpoint_name: str, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.PrivateDnsZoneGroup"]: + """Gets all private dns zone groups in a private endpoint. + + :param private_endpoint_name: The name of the private endpoint. Required. + :type private_endpoint_name: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateDnsZoneGroup or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateDnsZoneGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_dns_zone_groups_list_request( + private_endpoint_name=private_endpoint_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateDnsZoneGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PrivateLinkServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`private_link_services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_link_services_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified private link service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PrivateLinkService: + """Gets the specified private link service by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateLinkService or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + + _request = build_private_link_services_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + parameters: Union[_models.PrivateLinkService, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkService: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateLinkService") + + _request = build_private_link_services_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: _models.PrivateLinkService, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: Union[_models.PrivateLinkService, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkService]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + Is either a PrivateLinkService type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateLinkService or IO[bytes] + :return: An instance of LROPoller that returns either PrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkService] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateLinkService].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateLinkService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.PrivateLinkService"]: + """Gets all private link services in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateLinkServiceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateLinkService"]: + """Gets all private link service in a subscription. + + :return: An iterator like instance of either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateLinkServiceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get the specific private end point connection by specific private link service in the resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_link_services_get_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PrivateEndpointConnection") + + _request = build_private_link_services_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_private_endpoint_connection_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, service_name: str, pe_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_private_link_services_delete_private_endpoint_connection_request( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete_private_endpoint_connection( + self, resource_group_name: str, service_name: str, pe_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. Required. + :type pe_connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_private_endpoint_connections( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.PrivateEndpointConnection"]: + """Gets all private end point connections for a specific private link service. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_name: The name of the private link service. Required. + :type service_name: str + :return: An iterator like instance of either PrivateEndpointConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_private_endpoint_connections_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _check_private_link_service_visibility_initial( # pylint: disable=name-too-long + self, + location: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.PrivateLinkServiceVisibility]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateLinkServiceVisibility]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CheckPrivateLinkServiceVisibilityRequest") + + _request = build_private_link_services_check_private_link_service_visibility_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, + location: str, + parameters: _models.CheckPrivateLinkServiceVisibilityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, location: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_check_private_link_service_visibility( # pylint: disable=name-too-long + self, + location: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. Required. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. Is either a + CheckPrivateLinkServiceVisibilityRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest or IO[bytes] + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkServiceVisibility] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._check_private_link_service_visibility_initial( + location=location, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateLinkServiceVisibility].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateLinkServiceVisibility]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _check_private_link_service_visibility_by_resource_group_initial( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.PrivateLinkServiceVisibility]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateLinkServiceVisibility]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "CheckPrivateLinkServiceVisibilityRequest") + + _request = build_private_link_services_check_private_link_service_visibility_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: _models.CheckPrivateLinkServiceVisibilityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_check_private_link_service_visibility_by_resource_group( # pylint: disable=name-too-long + self, + location: str, + resource_group_name: str, + parameters: Union[_models.CheckPrivateLinkServiceVisibilityRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateLinkServiceVisibility]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. Is either a + CheckPrivateLinkServiceVisibilityRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.CheckPrivateLinkServiceVisibilityRequest or IO[bytes] + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkServiceVisibility] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._check_private_link_service_visibility_by_resource_group_initial( + location=location, + resource_group_name=resource_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PrivateLinkServiceVisibility", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateLinkServiceVisibility].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateLinkServiceVisibility]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_auto_approved_private_link_services( + self, location: str, **kwargs: Any + ) -> Iterable["_models.AutoApprovedPrivateLinkService"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. Required. + :type location: str + :return: An iterator like instance of either AutoApprovedPrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AutoApprovedPrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AutoApprovedPrivateLinkServicesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_services_list_auto_approved_private_link_services_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AutoApprovedPrivateLinkServicesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_auto_approved_private_link_services_by_resource_group( # pylint: disable=name-too-long + self, location: str, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.AutoApprovedPrivateLinkService"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. Required. + :type location: str + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either AutoApprovedPrivateLinkService or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.AutoApprovedPrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.AutoApprovedPrivateLinkServicesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_private_link_services_list_auto_approved_private_link_services_by_resource_group_request( + location=location, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AutoApprovedPrivateLinkServicesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PublicIPPrefixesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`public_ip_prefixes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_prefix_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_public_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, public_ip_prefix_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIpPrefix. Required. + :type public_ip_prefix_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, public_ip_prefix_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.PublicIPPrefix: + """Gets the specified public IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + _request = build_public_ip_prefixes_get_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.PublicIPPrefix, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PublicIPPrefix") + + _request = build_public_ip_prefixes_create_or_update_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: _models.PublicIPPrefix, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.PublicIPPrefix, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PublicIPPrefix]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. Is + either a PublicIPPrefix type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix or IO[bytes] + :return: An instance of LROPoller that returns either PublicIPPrefix or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PublicIPPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PublicIPPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.PublicIPPrefix: + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. Required. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: PublicIPPrefix or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PublicIPPrefix] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_public_ip_prefixes_update_tags_request( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PublicIPPrefix", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.PublicIPPrefix"]: + """Gets all the public IP prefixes in a subscription. + + :return: An iterator like instance of either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_prefixes_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.PublicIPPrefix"]: + """Gets all public IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.PublicIPPrefixListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_public_ip_prefixes_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublicIPPrefixListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RouteFiltersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`route_filters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_filters_delete_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, route_filter_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, route_filter_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.RouteFilter: + """Gets the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :keyword expand: Expands referenced express route bgp peering resources. Default value is None. + :paramtype expand: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + _request = build_route_filters_get_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.RouteFilter, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_parameters, (IOBase, bytes)): + _content = route_filter_parameters + else: + _json = self._serialize.body(route_filter_parameters, "RouteFilter") + + _request = build_route_filters_create_or_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: _models.RouteFilter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Required. + :type route_filter_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Required. + :type route_filter_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: Union[_models.RouteFilter, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RouteFilter]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. Is either a RouteFilter type or a IO[bytes] type. Required. + :type route_filter_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilter or IO[bytes] + :return: An instance of LROPoller that returns either RouteFilter or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RouteFilter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RouteFilter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilter: + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: RouteFilter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_filters_update_tags_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.RouteFilter"]: + """Gets all route filters in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either RouteFilter or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.RouteFilter"]: + """Gets all route filters in a subscription. + + :return: An iterator like instance of either RouteFilter or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filters_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RouteFilterRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`route_filter_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_filter_rules_delete_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, route_filter_name: str, rule_name: str, **kwargs: Any + ) -> _models.RouteFilterRule: + """Gets the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the rule. Required. + :type rule_name: str + :return: RouteFilterRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteFilterRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + _request = build_route_filter_rules_get_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.RouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> _models.RouteFilterRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_filter_rule_parameters, (IOBase, bytes)): + _content = route_filter_rule_parameters + else: + _json = self._serialize.body(route_filter_rule_parameters, "RouteFilterRule") + + _request = build_route_filter_rules_create_or_update_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: _models.RouteFilterRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Required. + :type route_filter_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilterRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Required. + :type route_filter_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: Union[_models.RouteFilterRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RouteFilterRule]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. Required. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. Is either a RouteFilterRule type or a IO[bytes] type. Required. + :type route_filter_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteFilterRule or + IO[bytes] + :return: An instance of LROPoller that returns either RouteFilterRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteFilterRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteFilterRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RouteFilterRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RouteFilterRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_route_filter( + self, resource_group_name: str, route_filter_name: str, **kwargs: Any + ) -> Iterable["_models.RouteFilterRule"]: + """Gets all RouteFilterRules in a route filter. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. Required. + :type route_filter_name: str + :return: An iterator like instance of either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteFilterRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_filter_rules_list_by_route_filter_request( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("RouteFilterRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RouteTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`route_tables` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_tables_delete_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, route_table_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, route_table_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.RouteTable: + """Gets the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + _request = build_route_tables_get_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.RouteTable, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "RouteTable") + + _request = build_route_tables_create_or_update_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteTable", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: _models.RouteTable, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.RouteTable, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RouteTable]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. Is either + a RouteTable type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.RouteTable or IO[bytes] + :return: An instance of LROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.RouteTable: + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. Is either a TagsObject type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: RouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_route_tables_update_tags_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.RouteTable"]: + """Gets all route tables in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either RouteTable or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_tables_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("RouteTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.RouteTable"]: + """Gets all route tables in a subscription. + + :return: An iterator like instance of either RouteTable or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteTableListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_tables_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("RouteTableListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RoutesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`routes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_delete_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified route from a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs: Any) -> _models.Route: + """Gets the specified route from a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :return: Route or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Route + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + + _request = build_routes_get_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Route", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: Union[_models.Route, IO[bytes]], + **kwargs: Any + ) -> _models.Route: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_parameters, (IOBase, bytes)): + _content = route_parameters + else: + _json = self._serialize.body(route_parameters, "Route") + + _request = build_routes_create_or_update_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Route", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Route", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: _models.Route, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Required. + :type route_parameters: ~azure.mgmt.network.v2023_09_01.models.Route + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Required. + :type route_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: Union[_models.Route, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Route]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :param route_name: The name of the route. Required. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. Is either + a Route type or a IO[bytes] type. Required. + :type route_parameters: ~azure.mgmt.network.v2023_09_01.models.Route or IO[bytes] + :return: An instance of LROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Route] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + route_parameters=route_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Route", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Route].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Route]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, route_table_name: str, **kwargs: Any) -> Iterable["_models.Route"]: + """Gets all routes in a route table. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param route_table_name: The name of the route table. Required. + :type route_table_name: str + :return: An iterator like instance of either Route or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_routes_list_request( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("RouteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SecurityPartnerProvidersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`security_partner_providers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_security_partner_providers_delete_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, security_partner_provider_name: str, **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Gets the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + _request = build_security_partner_providers_get_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.SecurityPartnerProvider, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SecurityPartnerProvider") + + _request = build_security_partner_providers_create_or_update_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: _models.SecurityPartnerProvider, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.SecurityPartnerProvider, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SecurityPartnerProvider]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. Is either a SecurityPartnerProvider type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider or IO[bytes] + :return: An instance of LROPoller that returns either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SecurityPartnerProvider].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SecurityPartnerProvider]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPartnerProvider: + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. Required. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPartnerProvider] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_security_partner_providers_update_tags_request( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SecurityPartnerProvider", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.SecurityPartnerProvider"]: + """Lists all Security Partner Providers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityPartnerProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_partner_providers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.SecurityPartnerProvider"]: + """Gets all the Security Partner Providers in a subscription. + + :return: An iterator like instance of either SecurityPartnerProvider or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SecurityPartnerProviderListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_partner_providers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SecurityPartnerProviderListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class BgpServiceCommunitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`bgp_service_communities` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.BgpServiceCommunity"]: + """Gets all the available bgp service communities. + + :return: An iterator like instance of either BgpServiceCommunity or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BgpServiceCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BgpServiceCommunityListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_bgp_service_communities_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BgpServiceCommunityListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServiceEndpointPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`service_endpoint_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policies_delete_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Gets the specified service Endpoint Policies in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policies_get_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.ServiceEndpointPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ServiceEndpointPolicy") + + _request = build_service_endpoint_policies_create_or_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: _models.ServiceEndpointPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.ServiceEndpointPolicy, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServiceEndpointPolicy]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. Is either a ServiceEndpointPolicy type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy or IO[bytes] + :return: An instance of LROPoller that returns either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServiceEndpointPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServiceEndpointPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicy: + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_service_endpoint_policies_update_tags_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ServiceEndpointPolicy"]: + """Gets all the service endpoint policies in a subscription. + + :return: An iterator like instance of either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policies_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.ServiceEndpointPolicy"]: + """Gets all service endpoint Policies in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either ServiceEndpointPolicy or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policies_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServiceEndpointPolicyDefinitionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`service_endpoint_policy_definitions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policy_definitions_delete_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified ServiceEndpoint policy definitions. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the Service Endpoint Policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition. Required. + :type service_endpoint_policy_definition_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs: Any + ) -> _models.ServiceEndpointPolicyDefinition: + """Get the specified service endpoint policy definitions from service endpoint policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :return: ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + + _request = build_service_endpoint_policy_definitions_get_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: Union[_models.ServiceEndpointPolicyDefinition, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceEndpointPolicyDefinition: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_endpoint_policy_definitions, (IOBase, bytes)): + _content = service_endpoint_policy_definitions + else: + _json = self._serialize.body(service_endpoint_policy_definitions, "ServiceEndpointPolicyDefinition") + + _request = build_service_endpoint_policy_definitions_create_or_update_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: _models.ServiceEndpointPolicyDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Required. + :type service_endpoint_policy_definitions: + ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceEndpointPolicyDefinition or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Required. + :type service_endpoint_policy_definitions: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceEndpointPolicyDefinition or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: Union[_models.ServiceEndpointPolicyDefinition, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServiceEndpointPolicyDefinition]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. Required. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. Required. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. Is either a ServiceEndpointPolicyDefinition type or a IO[bytes] + type. Required. + :type service_endpoint_policy_definitions: + ~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition or IO[bytes] + :return: An instance of LROPoller that returns either ServiceEndpointPolicyDefinition or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceEndpointPolicyDefinition] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + service_endpoint_policy_definitions=service_endpoint_policy_definitions, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyDefinition", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServiceEndpointPolicyDefinition].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServiceEndpointPolicyDefinition]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, service_endpoint_policy_name: str, **kwargs: Any + ) -> Iterable["_models.ServiceEndpointPolicyDefinition"]: + """Gets all service endpoint policy definitions in a service end point policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. Required. + :type service_endpoint_policy_name: str + :return: An iterator like instance of either ServiceEndpointPolicyDefinition or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceEndpointPolicyDefinitionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_endpoint_policy_definitions_list_by_resource_group_request( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceEndpointPolicyDefinitionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServiceTagsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`service_tags` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> _models.ServiceTagsListResult: + """Gets a list of service tag information resources. + + :param location: The location that will be used as a reference for version (not as a filter + based on location, you will get the list of service tags with prefix details across all regions + but limited to the cloud that your subscription belongs to). Required. + :type location: str + :return: ServiceTagsListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceTagsListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceTagsListResult] = kwargs.pop("cls", None) + + _request = build_service_tags_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceTagsListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceTagInformationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`service_tag_information` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, + location: str, + *, + no_address_prefixes: Optional[bool] = None, + tag_name: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ServiceTagInformation"]: + """Gets a list of service tag information resources with pagination. + + :param location: The location that will be used as a reference for cloud (not as a filter based + on location, you will get the list of service tags with prefix details across all regions but + limited to the cloud that your subscription belongs to). Required. + :type location: str + :keyword no_address_prefixes: Do not return address prefixes for the tag(s). Default value is + None. + :paramtype no_address_prefixes: bool + :keyword tag_name: Return tag information for a particular tag. Default value is None. + :paramtype tag_name: str + :return: An iterator like instance of either ServiceTagInformation or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.ServiceTagInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceTagInformationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_tag_information_list_request( + location=location, + subscription_id=self._config.subscription_id, + no_address_prefixes=no_address_prefixes, + tag_name=tag_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceTagInformationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class UsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`usages` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: + """List network usages for a subscription. + + :param location: The location where resource usage is queried. Required. + :type location: str + :return: An iterator like instance of either Usage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.Usage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_usages_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("UsagesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_networks` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_networks_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, virtual_network_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, virtual_network_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.VirtualNetwork: + """Gets the specified virtual network by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + _request = build_virtual_networks_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.VirtualNetwork, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetwork") + + _request = build_virtual_networks_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.VirtualNetwork, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.VirtualNetwork, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetwork]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. Is + either a VirtualNetwork type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork or IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetwork or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetwork: + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualNetwork or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetwork] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_networks_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualNetwork"]: + """Gets all virtual networks in a subscription. + + :return: An iterator like instance of either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualNetwork"]: + """Gets all virtual networks in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def check_ip_address_availability( + self, resource_group_name: str, virtual_network_name: str, *, ip_address: str, **kwargs: Any + ) -> _models.IPAddressAvailabilityResult: + """Checks whether a private IP address is available for use. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword ip_address: The private IP address to be verified. Required. + :paramtype ip_address: str + :return: IPAddressAvailabilityResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.IPAddressAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.IPAddressAvailabilityResult] = kwargs.pop("cls", None) + + _request = build_virtual_networks_check_ip_address_availability_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + ip_address=ip_address, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IPAddressAvailabilityResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_usage( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualNetworkUsage"]: + """Lists usage stats. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either VirtualNetworkUsage or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkListUsageResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_usage_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkListUsageResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _list_ddos_protection_status_initial( + self, + resource_group_name: str, + virtual_network_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.VirtualNetworkDdosProtectionStatusResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VirtualNetworkDdosProtectionStatusResult]] = kwargs.pop("cls", None) + + _request = build_virtual_networks_list_ddos_protection_status_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkDdosProtectionStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_ddos_protection_status( + self, + resource_group_name: str, + virtual_network_name: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[Iterable["_models.PublicIpDdosProtectionStatusResult"]]: + """Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :keyword top: The max number of ip addresses to return. Default value is None. + :paramtype top: int + :keyword skip_token: The skipToken that is given with nextLink. Default value is None. + :paramtype skip_token: str + :return: An instance of LROPoller that returns an iterator like instance of either + VirtualNetworkDdosProtectionStatusResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.PublicIpDdosProtectionStatusResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkDdosProtectionStatusResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_networks_list_ddos_protection_status_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkDdosProtectionStatusResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_ddos_protection_status_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + top=top, + skip_token=skip_token, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return get_next(next_link) + + return ItemPaged(internal_get_next, extract_data) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[Iterable["_models.PublicIpDdosProtectionStatusResult"]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[Iterable["_models.PublicIpDdosProtectionStatusResult"]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SubnetsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`subnets` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_subnets_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Subnet: + """Gets the specified subnet by virtual network and resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: Subnet or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.Subnet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + + _request = build_subnets_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Subnet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: Union[_models.Subnet, IO[bytes]], + **kwargs: Any + ) -> _models.Subnet: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(subnet_parameters, (IOBase, bytes)): + _content = subnet_parameters + else: + _json = self._serialize.body(subnet_parameters, "Subnet") + + _request = build_subnets_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Subnet", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Subnet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: _models.Subnet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. + Required. + :type subnet_parameters: ~azure.mgmt.network.v2023_09_01.models.Subnet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. + Required. + :type subnet_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: Union[_models.Subnet, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Subnet]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. Is + either a Subnet type or a IO[bytes] type. Required. + :type subnet_parameters: ~azure.mgmt.network.v2023_09_01.models.Subnet or IO[bytes] + :return: An instance of LROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Subnet] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subnet_parameters=subnet_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Subnet", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Subnet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Subnet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _prepare_network_policies_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: Union[_models.PrepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(prepare_network_policies_request_parameters, (IOBase, bytes)): + _content = prepare_network_policies_request_parameters + else: + _json = self._serialize.body(prepare_network_policies_request_parameters, "PrepareNetworkPoliciesRequest") + + _request = build_subnets_prepare_network_policies_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: _models.PrepareNetworkPoliciesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Required. + :type prepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.PrepareNetworkPoliciesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Required. + :type prepare_network_policies_request_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: Union[_models.PrepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. Is either a PrepareNetworkPoliciesRequest type or a IO[bytes] + type. Required. + :type prepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.PrepareNetworkPoliciesRequest or IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._prepare_network_policies_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + prepare_network_policies_request_parameters=prepare_network_policies_request_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _unprepare_network_policies_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: Union[_models.UnprepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(unprepare_network_policies_request_parameters, (IOBase, bytes)): + _content = unprepare_network_policies_request_parameters + else: + _json = self._serialize.body( + unprepare_network_policies_request_parameters, "UnprepareNetworkPoliciesRequest" + ) + + _request = build_subnets_unprepare_network_policies_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: _models.UnprepareNetworkPoliciesRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Required. + :type unprepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.UnprepareNetworkPoliciesRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Required. + :type unprepare_network_policies_request_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: Union[_models.UnprepareNetworkPoliciesRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. Is either a UnprepareNetworkPoliciesRequest type or a + IO[bytes] type. Required. + :type unprepare_network_policies_request_parameters: + ~azure.mgmt.network.v2023_09_01.models.UnprepareNetworkPoliciesRequest or IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._unprepare_network_policies_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + unprepare_network_policies_request_parameters=unprepare_network_policies_request_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, virtual_network_name: str, **kwargs: Any) -> Iterable["_models.Subnet"]: + """Gets all subnets in a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either Subnet or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.SubnetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subnets_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SubnetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ResourceNavigationLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`resource_navigation_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ResourceNavigationLinksListResult: + """Gets a list of resource navigation links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ResourceNavigationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ResourceNavigationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ResourceNavigationLinksListResult] = kwargs.pop("cls", None) + + _request = build_resource_navigation_links_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceNavigationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServiceAssociationLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`service_association_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any + ) -> _models.ServiceAssociationLinksListResult: + """Gets a list of service association links for a subnet. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. Required. + :type subnet_name: str + :return: ServiceAssociationLinksListResult or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ServiceAssociationLinksListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ServiceAssociationLinksListResult] = kwargs.pop("cls", None) + + _request = build_service_association_links_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceAssociationLinksListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualNetworkPeeringsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_network_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_peerings_delete_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified virtual network peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. Required. + :type virtual_network_peering_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, **kwargs: Any + ) -> _models.VirtualNetworkPeering: + """Gets the specified virtual network peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. Required. + :type virtual_network_peering_name: str + :return: VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + + _request = build_virtual_network_peerings_get_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: Union[_models.VirtualNetworkPeering, IO[bytes]], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any + ) -> _models.VirtualNetworkPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_network_peering_parameters, (IOBase, bytes)): + _content = virtual_network_peering_parameters + else: + _json = self._serialize.body(virtual_network_peering_parameters, "VirtualNetworkPeering") + + _request = build_virtual_network_peerings_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + subscription_id=self._config.subscription_id, + sync_remote_address_space=sync_remote_address_space, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: _models.VirtualNetworkPeering, + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Required. + :type virtual_network_peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.v2023_09_01.models.SyncRemoteAddressSpace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkPeering or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: IO[bytes], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Required. + :type virtual_network_peering_parameters: IO[bytes] + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.v2023_09_01.models.SyncRemoteAddressSpace + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkPeering or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: Union[_models.VirtualNetworkPeering, IO[bytes]], + *, + sync_remote_address_space: Optional[Union[str, _models.SyncRemoteAddressSpace]] = None, + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkPeering]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. Required. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. Is either a VirtualNetworkPeering type or a IO[bytes] type. + Required. + :type virtual_network_peering_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering or IO[bytes] + :keyword sync_remote_address_space: Parameter indicates the intention to sync the peering with + the current address space on the remote vNet after it's updated. "true" Default value is None. + :paramtype sync_remote_address_space: str or + ~azure.mgmt.network.v2023_09_01.models.SyncRemoteAddressSpace + :return: An instance of LROPoller that returns either VirtualNetworkPeering or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkPeering] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + virtual_network_peering_parameters=virtual_network_peering_parameters, + sync_remote_address_space=sync_remote_address_space, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, virtual_network_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualNetworkPeering"]: + """Gets all virtual network peerings in a virtual network. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. Required. + :type virtual_network_name: str + :return: An iterator like instance of either VirtualNetworkPeering or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_peerings_list_request( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualNetworkGatewaysOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_network_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VirtualNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkGateway") + + _request = build_virtual_network_gateways_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VirtualNetworkGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VirtualNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + Is either a VirtualNetworkGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway or IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGateway: + """Gets the specified virtual network gateway by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified virtual network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualNetworkGateway"]: + """Gets all virtual network gateways by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_connections( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualNetworkGatewayConnectionListEntity"]: + """Gets all the connections in a virtual network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An iterator like instance of either VirtualNetworkGatewayConnectionListEntity or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnectionListEntity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayListConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateways_list_connections_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayListConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _reset_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VirtualNetworkGateway]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_reset_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + gateway_vip=gateway_vip, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reset( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + *, + gateway_vip: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGateway]: + """Resets the primary of the virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword gateway_vip: Virtual network gateway vip address supplied to the begin reset of the + active-active feature enabled gateway. Default value is None. + :paramtype gateway_vip: str + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + gateway_vip=gateway_vip, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _reset_vpn_client_shared_key_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_reset_vpn_client_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_reset_vpn_client_shared_key( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Resets the VPN client shared key of the virtual network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_vpn_client_shared_key_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _generatevpnclientpackage_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnClientParameters") + + _request = build_virtual_network_gateways_generatevpnclientpackage_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VpnClientParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Is either a VpnClientParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters or IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generatevpnclientpackage_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _generate_vpn_profile_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnClientParameters") + + _request = build_virtual_network_gateways_generate_vpn_profile_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VpnClientParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnClientParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. Is either a VpnClientParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnClientParameters or IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _get_vpn_profile_package_url_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpn_profile_package_url_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_vpn_profile_package_url( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> LROPoller[str]: + """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified + resource group. The profile needs to be generated first using generateVpnProfile. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_vpn_profile_package_url_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _get_bgp_peer_status_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.BgpPeerStatusListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.BgpPeerStatusListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_bgp_peer_status_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + peer=peer, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("BgpPeerStatusListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_bgp_peer_status( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: Optional[str] = None, **kwargs: Any + ) -> LROPoller[_models.BgpPeerStatusListResult]: + """The GetBgpPeerStatus operation retrieves the status of all BGP peers. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword peer: The IP address of the peer to retrieve the status of. Default value is None. + :paramtype peer: str + :return: An instance of LROPoller that returns either BgpPeerStatusListResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BgpPeerStatusListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BgpPeerStatusListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_bgp_peer_status_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BgpPeerStatusListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BgpPeerStatusListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BgpPeerStatusListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def supported_vpn_devices(self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any) -> str: + """Gets a xml format representation for supported vpn devices. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_supported_vpn_devices_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _get_learned_routes_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[_models.GatewayRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.GatewayRouteListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_learned_routes_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_learned_routes( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> LROPoller[_models.GatewayRouteListResult]: + """This operation retrieves a list of routes the virtual network gateway has learned, including + routes learned from BGP peers. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of LROPoller that returns either GatewayRouteListResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.GatewayRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_learned_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_advertised_routes_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: str, **kwargs: Any + ) -> Optional[_models.GatewayRouteListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.GatewayRouteListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_advertised_routes_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + peer=peer, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_advertised_routes( + self, resource_group_name: str, virtual_network_gateway_name: str, *, peer: str, **kwargs: Any + ) -> LROPoller[_models.GatewayRouteListResult]: + """This operation retrieves a list of routes the virtual network gateway is advertising to the + specified peer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :keyword peer: The IP address of the peer. Required. + :paramtype peer: str + :return: An instance of LROPoller that returns either GatewayRouteListResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.GatewayRouteListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_advertised_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayRouteListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayRouteListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_vpnclient_ipsec_parameters_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: Union[_models.VpnClientIPsecParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnClientIPsecParameters]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnClientIPsecParameters]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpnclient_ipsec_params, (IOBase, bytes)): + _content = vpnclient_ipsec_params + else: + _json = self._serialize.body(vpnclient_ipsec_params, "VpnClientIPsecParameters") + + _request = build_virtual_network_gateways_set_vpnclient_ipsec_parameters_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: _models.VpnClientIPsecParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Required. + :type vpnclient_ipsec_params: ~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnClientIPsecParameters or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Required. + :type vpnclient_ipsec_params: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnClientIPsecParameters or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: Union[_models.VpnClientIPsecParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnClientIPsecParameters]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. Is either a + VpnClientIPsecParameters type or a IO[bytes] type. Required. + :type vpnclient_ipsec_params: ~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters + or IO[bytes] + :return: An instance of LROPoller that returns either VpnClientIPsecParameters or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + vpnclient_ipsec_params=vpnclient_ipsec_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnClientIPsecParameters].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnClientIPsecParameters]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_vpnclient_ipsec_parameters_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> _models.VpnClientIPsecParameters: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpnclient_ipsec_parameters_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_vpnclient_ipsec_parameters( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> LROPoller[_models.VpnClientIPsecParameters]: + """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec + policy for P2S client of virtual network gateway in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The virtual network gateway name. Required. + :type virtual_network_gateway_name: str + :return: An instance of LROPoller that returns either VpnClientIPsecParameters or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnClientIPsecParameters] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientIPsecParameters", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnClientIPsecParameters].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnClientIPsecParameters]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.VpnDeviceScriptParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnDeviceScriptParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnDeviceScriptParameters, IO[bytes]], + **kwargs: Any + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. Is either a + VpnDeviceScriptParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnDeviceScriptParameters or IO[bytes] + :return: str or the result of cls(response) + :rtype: str + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnDeviceScriptParameters") + + _request = build_virtual_network_gateways_vpn_device_configuration_script_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnPacketCaptureStartParameters") + else: + _json = None + + _request = build_virtual_network_gateways_start_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[_models.VpnPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. Is either a VpnPacketCaptureStartParameters type or a IO[bytes] type. + Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters or + IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnPacketCaptureStopParameters") + + _request = build_virtual_network_gateways_stop_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: _models.VpnPacketCaptureStopParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. Is either a VpnPacketCaptureStopParameters type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters or + IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _get_vpnclient_connection_health_initial( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Optional[_models.VpnClientConnectionHealthDetailListResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VpnClientConnectionHealthDetailListResult]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateways_get_vpnclient_connection_health_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnClientConnectionHealthDetailListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_vpnclient_connection_health( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> LROPoller[_models.VpnClientConnectionHealthDetailListResult]: + """Get VPN client connection health detail per P2S client connection of the virtual network + gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :return: An instance of LROPoller that returns either VpnClientConnectionHealthDetailListResult + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnClientConnectionHealthDetailListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnClientConnectionHealthDetailListResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_vpnclient_connection_health_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnClientConnectionHealthDetailListResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnClientConnectionHealthDetailListResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnClientConnectionHealthDetailListResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _disconnect_virtual_network_gateway_vpn_connections_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionRequest") + + _request = build_virtual_network_gateways_disconnect_virtual_network_gateway_vpn_connections_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: _models.P2SVpnConnectionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_disconnect_virtual_network_gateway_vpn_connections( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. Required. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. Is either a + P2SVpnConnectionRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest or IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._disconnect_virtual_network_gateway_vpn_connections_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualNetworkGatewayConnectionsOperations: # pylint: disable=too-many-public-methods,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_network_gateway_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VirtualNetworkGatewayConnection, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGatewayConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkGatewayConnection") + + _request = build_virtual_network_gateway_connections_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.VirtualNetworkGatewayConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VirtualNetworkGatewayConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayConnection]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. Is either a VirtualNetworkGatewayConnection type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection or + IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkGatewayConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkGatewayConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGatewayConnection: + """Gets the specified virtual network gateway connection by resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :return: VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified virtual network Gateway connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VirtualNetworkGatewayConnection]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkGatewayConnection]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_virtual_network_gateway_connections_update_tags_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayConnection]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkGatewayConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkGatewayConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionSharedKey, IO[bytes]], + **kwargs: Any + ) -> _models.ConnectionSharedKey: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionSharedKey") + + _request = build_virtual_network_gateway_connections_set_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.ConnectionSharedKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionSharedKey, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConnectionSharedKey]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. Is either a ConnectionSharedKey type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey or IO[bytes] + :return: An instance of LROPoller that returns either ConnectionSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConnectionSharedKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectionSharedKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_shared_key( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> _models.ConnectionSharedKey: + """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the + specified virtual network gateway connection shared key through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection shared + key name. Required. + :type virtual_network_gateway_connection_name: str + :return: ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ConnectionSharedKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ConnectionSharedKey] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConnectionSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualNetworkGatewayConnection"]: + """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways + connections created. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkGatewayConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateway_connections_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _reset_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionResetSharedKey, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ConnectionResetSharedKey]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConnectionResetSharedKey]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConnectionResetSharedKey") + + _request = build_virtual_network_gateway_connections_reset_shared_key_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ConnectionResetSharedKey", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.ConnectionResetSharedKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectionResetSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConnectionResetSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.ConnectionResetSharedKey, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConnectionResetSharedKey]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. Is either a ConnectionResetSharedKey + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey or IO[bytes] + :return: An instance of LROPoller that returns either ConnectionResetSharedKey or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectionResetSharedKey] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectionResetSharedKey", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConnectionResetSharedKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectionResetSharedKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnPacketCaptureStartParameters") + else: + _json = None + + _request = build_virtual_network_gateway_connections_start_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[_models.VpnPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional[Union[_models.VpnPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. Is either a VpnPacketCaptureStartParameters type or a IO[bytes] + type. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStartParameters or + IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VpnPacketCaptureStopParameters") + + _request = build_virtual_network_gateway_connections_stop_packet_capture_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: _models.VpnPacketCaptureStopParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Union[_models.VpnPacketCaptureStopParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. Is either a VpnPacketCaptureStopParameters type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnPacketCaptureStopParameters or + IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _get_ike_sas_initial( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_get_ike_sas_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_ike_sas( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> LROPoller[str]: + """Lists IKE Security Associations for the virtual network gateway connection in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_ike_sas_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_connection_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_connections_reset_connection_request( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_reset_connection( + self, resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Resets the virtual network gateway connection specified. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. Required. + :type virtual_network_gateway_connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_connection_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class LocalNetworkGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`local_network_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.LocalNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "LocalNetworkGateway") + + _request = build_local_network_gateways_create_or_update_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: _models.LocalNetworkGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.LocalNetworkGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LocalNetworkGateway]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + Is either a LocalNetworkGateway type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway or IO[bytes] + :return: An instance of LROPoller that returns either LocalNetworkGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LocalNetworkGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LocalNetworkGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Gets the specified local network gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + _request = build_local_network_gateways_get_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_local_network_gateways_delete_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, local_network_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified local network gateway. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.LocalNetworkGateway: + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. Required. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LocalNetworkGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_local_network_gateways_update_tags_request( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LocalNetworkGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.LocalNetworkGateway"]: + """Gets all the local network gateways in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either LocalNetworkGateway or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.LocalNetworkGatewayListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_local_network_gateways_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LocalNetworkGatewayListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualNetworkGatewayNatRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_network_gateway_nat_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> _models.VirtualNetworkGatewayNatRule: + """Retrieves the details of a nat rule. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: VirtualNetworkGatewayNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_nat_rules_get_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VirtualNetworkGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkGatewayNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(nat_rule_parameters, (IOBase, bytes)): + _content = nat_rule_parameters + else: + _json = self._serialize.body(nat_rule_parameters, "VirtualNetworkGatewayNatRule") + + _request = build_virtual_network_gateway_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: _models.VirtualNetworkGatewayNatRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VirtualNetworkGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkGatewayNatRule]: + """Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the + existing nat rules. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Is either a + VirtualNetworkGatewayNatRule type or a IO[bytes] type. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule + or IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetworkGatewayNatRule or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkGatewayNatRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + nat_rule_parameters=nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkGatewayNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkGatewayNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkGatewayNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_gateway_nat_rules_delete_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_network_gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a nat rule. + + :param resource_group_name: The resource group name of the Virtual Network Gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + nat_rule_name=nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_virtual_network_gateway( + self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualNetworkGatewayNatRule"]: + """Retrieves all nat rules for a particular virtual network gateway. + + :param resource_group_name: The resource group name of the virtual network gateway. Required. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the gateway. Required. + :type virtual_network_gateway_name: str + :return: An iterator like instance of either VirtualNetworkGatewayNatRule or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualNetworkGatewayNatRulesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_gateway_nat_rules_list_by_virtual_network_gateway_request( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualNetworkGatewayNatRulesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualNetworkTapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_network_taps` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, tap_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_network_taps_delete_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, tap_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified virtual network tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + tap_name=tap_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, tap_name: str, **kwargs: Any) -> _models.VirtualNetworkTap: + """Gets information about the specified virtual network tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of virtual network tap. Required. + :type tap_name: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + _request = build_virtual_network_taps_get_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + tap_name: str, + parameters: Union[_models.VirtualNetworkTap, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualNetworkTap") + + _request = build_virtual_network_taps_create_or_update_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: _models.VirtualNetworkTap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: Union[_models.VirtualNetworkTap, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkTap]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. Required. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + Is either a VirtualNetworkTap type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap or IO[bytes] + :return: An instance of LROPoller that returns either VirtualNetworkTap or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Required. + :type tap_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Required. + :type tap_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualNetworkTap: + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param tap_name: The name of the tap. Required. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type tap_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkTap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(tap_parameters, (IOBase, bytes)): + _content = tap_parameters + else: + _json = self._serialize.body(tap_parameters, "TagsObject") + + _request = build_virtual_network_taps_update_tags_request( + resource_group_name=resource_group_name, + tap_name=tap_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualNetworkTap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualNetworkTap"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :return: An iterator like instance of either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkTapListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_taps_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTapListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualNetworkTap"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualNetworkTapListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_taps_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkTapListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualRoutersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_routers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_routers_delete_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, virtual_router_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, virtual_router_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.VirtualRouter: + """Gets the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :keyword expand: Expands referenced resources. Default value is None. + :paramtype expand: str + :return: VirtualRouter or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualRouter + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + _request = build_virtual_routers_get_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.VirtualRouter, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouter: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouter") + + _request = build_virtual_routers_create_or_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualRouter", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: _models.VirtualRouter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: Union[_models.VirtualRouter, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualRouter]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. Is either a + VirtualRouter type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouter or IO[bytes] + :return: An instance of LROPoller that returns either VirtualRouter or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouter] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualRouter", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualRouter].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualRouter]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualRouter"]: + """Lists all Virtual Routers in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_routers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.VirtualRouter"]: + """Gets all the Virtual Routers in a subscription. + + :return: An iterator like instance of either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_routers_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualRouterPeeringsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_router_peerings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_router_peerings_delete_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified peering from a Virtual Router. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the peering. Required. + :type peering_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, virtual_router_name: str, peering_name: str, **kwargs: Any + ) -> _models.VirtualRouterPeering: + """Gets the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :return: VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + _request = build_virtual_router_peerings_get_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualRouterPeering: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualRouterPeering") + + _request = build_virtual_router_peerings_create_or_update_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: _models.VirtualRouterPeering, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualRouterPeering or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualRouterPeering or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: Union[_models.VirtualRouterPeering, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualRouterPeering]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. Required. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. Is either a VirtualRouterPeering type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering or IO[bytes] + :return: An instance of LROPoller that returns either VirtualRouterPeering or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualRouterPeering] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualRouterPeering", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualRouterPeering].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualRouterPeering]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, virtual_router_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualRouterPeering"]: + """Lists all Virtual Router Peerings in a Virtual Router resource. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. Required. + :type virtual_router_name: str + :return: An iterator like instance of either VirtualRouterPeering or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualRouterPeeringListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_router_peerings_list_request( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualRouterPeeringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualWansOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_wans` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any) -> _models.VirtualWAN: + """Retrieves the details of a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being retrieved. Required. + :type virtual_wan_name: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + _request = build_virtual_wans_get_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "VirtualWAN") + + _request = build_virtual_wans_create_or_update_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: _models.VirtualWAN, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Required. + :type wan_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.VirtualWAN, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualWAN]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. Is either a + VirtualWAN type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN or IO[bytes] + :return: An instance of LROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualWAN", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualWAN].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualWAN]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Required. + :type wan_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualWAN: + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. Required. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type wan_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualWAN or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualWAN + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualWAN] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(wan_parameters, (IOBase, bytes)): + _content = wan_parameters + else: + _json = self._serialize.body(wan_parameters, "TagsObject") + + _request = build_virtual_wans_update_tags_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualWAN", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_wans_delete_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being deleted. Required. + :type virtual_wan_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a resource group. + + :param resource_group_name: The resource group name of the VirtualWan. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.VirtualWAN"]: + """Lists all the VirtualWANs in a subscription. + + :return: An iterator like instance of either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualWANsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_wans_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualWANsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnSitesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_sites` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, vpn_site_name: str, **kwargs: Any) -> _models.VpnSite: + """Retrieves the details of a VPN site. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being retrieved. Required. + :type vpn_site_name: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + _request = build_vpn_sites_get_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.VpnSite, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "VpnSite") + + _request = build_vpn_sites_create_or_update_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: _models.VpnSite, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Required. + :type vpn_site_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.VpnSite, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnSite]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. Is either a + VpnSite type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnSite or IO[bytes] + :return: An instance of LROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_parameters=vpn_site_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnSite", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnSite].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnSite]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Required. + :type vpn_site_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnSite: + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. Required. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. Is either a TagsObject + type or a IO[bytes] type. Required. + :type vpn_site_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VpnSite or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSite + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnSite] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_site_parameters, (IOBase, bytes)): + _content = vpn_site_parameters + else: + _json = self._serialize.body(vpn_site_parameters, "TagsObject") + + _request = build_vpn_sites_update_tags_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSite", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vpn_site_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_sites_delete_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, vpn_site_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being deleted. Required. + :type vpn_site_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VpnSite"]: + """Lists all the vpnSites in a resource group. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnSite or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSitesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_sites_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSitesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.VpnSite"]: + """Lists all the VpnSites in a subscription. + + :return: An iterator like instance of either VpnSite or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSitesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_sites_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSitesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnSiteLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_site_links` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, vpn_site_name: str, vpn_site_link_name: str, **kwargs: Any + ) -> _models.VpnSiteLink: + """Retrieves the details of a VPN site link. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. Required. + :type vpn_site_name: str + :param vpn_site_link_name: The name of the VpnSiteLink being retrieved. Required. + :type vpn_site_link_name: str + :return: VpnSiteLink or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSiteLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnSiteLink] = kwargs.pop("cls", None) + + _request = build_vpn_site_links_get_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_link_name=vpn_site_link_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSiteLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_vpn_site( + self, resource_group_name: str, vpn_site_name: str, **kwargs: Any + ) -> Iterable["_models.VpnSiteLink"]: + """Lists all the vpnSiteLinks in a resource group for a vpn site. + + :param resource_group_name: The resource group name of the VpnSite. Required. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. Required. + :type vpn_site_name: str + :return: An iterator like instance of either VpnSiteLink or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSiteLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSiteLinksResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_site_links_list_by_vpn_site_request( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSiteLinksResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnSitesConfigurationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_sites_configuration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _download_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + virtual_wan_name: str, + request: Union[_models.GetVpnSitesConfigurationRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "GetVpnSitesConfigurationRequest") + + _request = build_vpn_sites_configuration_download_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: _models.GetVpnSitesConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GetVpnSitesConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: Union[_models.GetVpnSitesConfigurationRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. Required. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. Is either a + GetVpnSitesConfigurationRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.GetVpnSitesConfigurationRequest or + IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._download_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnServerConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_server_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Retrieves the details of a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being retrieved. + Required. + :type vpn_server_configuration_name: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_get_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.VpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "VpnServerConfiguration") + + _request = build_vpn_server_configurations_create_or_update_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: _models.VpnServerConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Required. + :type vpn_server_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Required. + :type vpn_server_configuration_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.VpnServerConfiguration, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnServerConfiguration]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. Is either a VpnServerConfiguration type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration or IO[bytes] + :return: An instance of LROPoller that returns either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + vpn_server_configuration_parameters=vpn_server_configuration_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnServerConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnServerConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Required. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Required. + :type vpn_server_configuration_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfiguration: + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + Required. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_parameters + else: + _json = self._serialize.body(vpn_server_configuration_parameters, "TagsObject") + + _request = build_vpn_server_configurations_update_tags_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_delete_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being deleted. + Required. + :type vpn_server_configuration_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.VpnServerConfiguration"]: + """Lists all the vpnServerConfigurations in a resource group. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_server_configurations_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.VpnServerConfiguration"]: + """Lists all the VpnServerConfigurations in a subscription. + + :return: An iterator like instance of either VpnServerConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnServerConfigurationsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_server_configurations_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ConfigurationPolicyGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`configuration_policy_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: Union[_models.VpnServerConfigurationPolicyGroup, IO[bytes]], + **kwargs: Any + ) -> _models.VpnServerConfigurationPolicyGroup: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_server_configuration_policy_group_parameters, (IOBase, bytes)): + _content = vpn_server_configuration_policy_group_parameters + else: + _json = self._serialize.body( + vpn_server_configuration_policy_group_parameters, "VpnServerConfigurationPolicyGroup" + ) + + _request = build_configuration_policy_groups_create_or_update_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: _models.VpnServerConfigurationPolicyGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Required. + :type vpn_server_configuration_policy_group_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnServerConfigurationPolicyGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Required. + :type vpn_server_configuration_policy_group_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnServerConfigurationPolicyGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + vpn_server_configuration_policy_group_parameters: Union[_models.VpnServerConfigurationPolicyGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnServerConfigurationPolicyGroup]: + """Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :param vpn_server_configuration_policy_group_parameters: Parameters supplied to create or + update a VpnServerConfiguration PolicyGroup. Is either a VpnServerConfigurationPolicyGroup type + or a IO[bytes] type. Required. + :type vpn_server_configuration_policy_group_parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup or IO[bytes] + :return: An instance of LROPoller that returns either VpnServerConfigurationPolicyGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + vpn_server_configuration_policy_group_parameters=vpn_server_configuration_policy_group_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnServerConfigurationPolicyGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnServerConfigurationPolicyGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_configuration_policy_groups_delete_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a ConfigurationPolicyGroup. + + :param resource_group_name: The resource group name of the ConfigurationPolicyGroup. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup. Required. + :type configuration_policy_group_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + configuration_policy_group_name: str, + **kwargs: Any + ) -> _models.VpnServerConfigurationPolicyGroup: + """Retrieves the details of a ConfigurationPolicyGroup. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :param configuration_policy_group_name: The name of the ConfigurationPolicyGroup being + retrieved. Required. + :type configuration_policy_group_name: str + :return: VpnServerConfigurationPolicyGroup or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnServerConfigurationPolicyGroup] = kwargs.pop("cls", None) + + _request = build_configuration_policy_groups_get_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + configuration_policy_group_name=configuration_policy_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnServerConfigurationPolicyGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_vpn_server_configuration( + self, resource_group_name: str, vpn_server_configuration_name: str, **kwargs: Any + ) -> Iterable["_models.VpnServerConfigurationPolicyGroup"]: + """Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. Required. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration. Required. + :type vpn_server_configuration_name: str + :return: An iterator like instance of either VpnServerConfigurationPolicyGroup or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationPolicyGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnServerConfigurationPolicyGroupsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_configuration_policy_groups_list_by_vpn_server_configuration_request( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnServerConfigurationPolicyGroupsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualHubsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_hubs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> _models.VirtualHub: + """Retrieves the details of a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + _request = build_virtual_hubs_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.VirtualHub, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "VirtualHub") + + _request = build_virtual_hubs_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: _models.VirtualHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Required. + :type virtual_hub_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.VirtualHub, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualHub]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. Is either a + VirtualHub type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.VirtualHub or IO[bytes] + :return: An instance of LROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + virtual_hub_parameters=virtual_hub_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHub", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualHub].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualHub]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Required. + :type virtual_hub_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHub: + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. Is either a + TagsObject type or a IO[bytes] type. Required. + :type virtual_hub_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: VirtualHub or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_parameters, (IOBase, bytes)): + _content = virtual_hub_parameters + else: + _json = self._serialize.body(virtual_hub_parameters, "TagsObject") + + _request = build_virtual_hubs_update_tags_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHub", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hubs_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualHub"]: + """Lists all the VirtualHubs in a resource group. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :return: An iterator like instance of either VirtualHub or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hubs_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.VirtualHub"]: + """Lists all the VirtualHubs in a subscription. + + :return: An iterator like instance of either VirtualHub or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hubs_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _get_effective_virtual_hub_routes_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[Union[_models.EffectiveRoutesParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[_models.VirtualHubEffectiveRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualHubEffectiveRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(effective_routes_parameters, (IOBase, bytes)): + _content = effective_routes_parameters + else: + if effective_routes_parameters is not None: + _json = self._serialize.body(effective_routes_parameters, "EffectiveRoutesParameters") + else: + _json = None + + _request = build_virtual_hubs_get_effective_virtual_hub_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("VirtualHubEffectiveRouteList", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[_models.EffectiveRoutesParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Default value is None. + :type effective_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.EffectiveRoutesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Default value is None. + :type effective_routes_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional[Union[_models.EffectiveRoutesParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.VirtualHubEffectiveRouteList]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. Is either a EffectiveRoutesParameters type or a IO[bytes] type. Default + value is None. + :type effective_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.EffectiveRoutesParameters or IO[bytes] + :return: An instance of LROPoller that returns either VirtualHubEffectiveRouteList or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubEffectiveRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubEffectiveRouteList] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_effective_virtual_hub_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + effective_routes_parameters=effective_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHubEffectiveRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualHubEffectiveRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualHubEffectiveRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_inbound_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: Union[_models.GetInboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.EffectiveRouteMapRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EffectiveRouteMapRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(get_inbound_routes_parameters, (IOBase, bytes)): + _content = get_inbound_routes_parameters + else: + _json = self._serialize.body(get_inbound_routes_parameters, "GetInboundRoutesParameters") + + _request = build_virtual_hubs_get_inbound_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: _models.GetInboundRoutesParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Required. + :type get_inbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetInboundRoutesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EffectiveRouteMapRouteList or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Required. + :type get_inbound_routes_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EffectiveRouteMapRouteList or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_inbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_inbound_routes_parameters: Union[_models.GetInboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the inbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_inbound_routes_parameters: Parameters supplied to get the inbound routes for a + connection resource. Is either a GetInboundRoutesParameters type or a IO[bytes] type. Required. + :type get_inbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetInboundRoutesParameters or IO[bytes] + :return: An instance of LROPoller that returns either EffectiveRouteMapRouteList or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveRouteMapRouteList] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_inbound_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + get_inbound_routes_parameters=get_inbound_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EffectiveRouteMapRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EffectiveRouteMapRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_outbound_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: Union[_models.GetOutboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.EffectiveRouteMapRouteList]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EffectiveRouteMapRouteList]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(get_outbound_routes_parameters, (IOBase, bytes)): + _content = get_outbound_routes_parameters + else: + _json = self._serialize.body(get_outbound_routes_parameters, "GetOutboundRoutesParameters") + + _request = build_virtual_hubs_get_outbound_routes_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: _models.GetOutboundRoutesParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Required. + :type get_outbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetOutboundRoutesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EffectiveRouteMapRouteList or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Required. + :type get_outbound_routes_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EffectiveRouteMapRouteList or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_outbound_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + get_outbound_routes_parameters: Union[_models.GetOutboundRoutesParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EffectiveRouteMapRouteList]: + """Gets the outbound routes configured for the Virtual Hub on a particular connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param get_outbound_routes_parameters: Parameters supplied to get the outbound routes for a + connection resource. Is either a GetOutboundRoutesParameters type or a IO[bytes] type. + Required. + :type get_outbound_routes_parameters: + ~azure.mgmt.network.v2023_09_01.models.GetOutboundRoutesParameters or IO[bytes] + :return: An instance of LROPoller that returns either EffectiveRouteMapRouteList or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.EffectiveRouteMapRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EffectiveRouteMapRouteList] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_outbound_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + get_outbound_routes_parameters=get_outbound_routes_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EffectiveRouteMapRouteList", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EffectiveRouteMapRouteList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EffectiveRouteMapRouteList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class RouteMapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`route_maps` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> _models.RouteMap: + """Retrieves the details of a RouteMap. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :return: RouteMap or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RouteMap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + + _request = build_route_maps_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RouteMap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: Union[_models.RouteMap, IO[bytes]], + **kwargs: Any + ) -> _models.RouteMap: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_map_parameters, (IOBase, bytes)): + _content = route_map_parameters + else: + _json = self._serialize.body(route_map_parameters, "RouteMap") + + _request = build_route_maps_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RouteMap", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RouteMap", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: _models.RouteMap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Required. + :type route_map_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteMap + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteMap or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Required. + :type route_map_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RouteMap or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_map_name: str, + route_map_parameters: Union[_models.RouteMap, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RouteMap]: + """Creates a RouteMap if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :param route_map_parameters: Parameters supplied to create or update a RouteMap. Is either a + RouteMap type or a IO[bytes] type. Required. + :type route_map_parameters: ~azure.mgmt.network.v2023_09_01.models.RouteMap or IO[bytes] + :return: An instance of LROPoller that returns either RouteMap or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RouteMap] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + route_map_parameters=route_map_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RouteMap", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RouteMap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RouteMap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_route_maps_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_map_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a RouteMap. + + :param resource_group_name: The resource group name of the RouteMap's resource group. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :param route_map_name: The name of the RouteMap. Required. + :type route_map_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_map_name=route_map_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> Iterable["_models.RouteMap"]: + """Retrieves the details of all RouteMaps. + + :param resource_group_name: The resource group name of the RouteMap's resource group'. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub containing the RouteMap. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either RouteMap or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RouteMap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListRouteMapsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_route_maps_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListRouteMapsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class HubVirtualNetworkConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`hub_virtual_network_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: Union[_models.HubVirtualNetworkConnection, IO[bytes]], + **kwargs: Any + ) -> _models.HubVirtualNetworkConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(hub_virtual_network_connection_parameters, (IOBase, bytes)): + _content = hub_virtual_network_connection_parameters + else: + _json = self._serialize.body(hub_virtual_network_connection_parameters, "HubVirtualNetworkConnection") + + _request = build_hub_virtual_network_connections_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: _models.HubVirtualNetworkConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Required. + :type hub_virtual_network_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either HubVirtualNetworkConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Required. + :type hub_virtual_network_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either HubVirtualNetworkConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: Union[_models.HubVirtualNetworkConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.HubVirtualNetworkConnection]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. Is either a HubVirtualNetworkConnection type or a IO[bytes] type. + Required. + :type hub_virtual_network_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection or IO[bytes] + :return: An instance of LROPoller that returns either HubVirtualNetworkConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + hub_virtual_network_connection_parameters=hub_virtual_network_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.HubVirtualNetworkConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.HubVirtualNetworkConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_hub_virtual_network_connections_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> _models.HubVirtualNetworkConnection: + """Retrieves the details of a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: HubVirtualNetworkConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.HubVirtualNetworkConnection] = kwargs.pop("cls", None) + + _request = build_hub_virtual_network_connections_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubVirtualNetworkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> Iterable["_models.HubVirtualNetworkConnection"]: + """Retrieves the details of all HubVirtualNetworkConnections. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubVirtualNetworkConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListHubVirtualNetworkConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_hub_virtual_network_connections_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListHubVirtualNetworkConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.VpnGateway: + """Retrieves the details of a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: VpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.VpnGateway, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "VpnGateway") + + _request = build_vpn_gateways_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: _models.VpnGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Required. + :type vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.VpnGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. Is either a VpnGateway type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGateway or IO[bytes] + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_gateway_parameters, (IOBase, bytes)): + _content = vpn_gateway_parameters + else: + _json = self._serialize.body(vpn_gateway_parameters, "TagsObject") + + _request = build_vpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. + Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. + Required. + :type vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. Is + either a TagsObject type or a IO[bytes] type. Required. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or IO[bytes] + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_initial( + self, resource_group_name: str, gateway_name: str, *, ip_configuration_id: Optional[str] = None, **kwargs: Any + ) -> Optional[_models.VpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VpnGateway]] = kwargs.pop("cls", None) + + _request = build_vpn_gateways_reset_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + ip_configuration_id=ip_configuration_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reset( + self, resource_group_name: str, gateway_name: str, *, ip_configuration_id: Optional[str] = None, **kwargs: Any + ) -> LROPoller[_models.VpnGateway]: + """Resets the primary of the vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :keyword ip_configuration_id: VpnGateway ipConfigurationId to specify the gateway instance. + Default value is None. + :paramtype ip_configuration_id: str + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + ip_configuration_id=ip_configuration_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnGatewayPacketCaptureStartParameters") + else: + _json = None + + _request = build_vpn_gateways_start_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[_models.VpnGatewayPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. Is either a VpnGatewayPacketCaptureStartParameters type or a IO[bytes] type. + Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStartParameters + or IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnGatewayPacketCaptureStopParameters") + else: + _json = None + + _request = build_vpn_gateways_stop_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[_models.VpnGatewayPacketCaptureStopParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Default value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional[Union[_models.VpnGatewayPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. Is either a VpnGatewayPacketCaptureStopParameters type or a IO[bytes] type. Default + value is None. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayPacketCaptureStopParameters + or IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VpnGateway"]: + """Lists all the VpnGateways in a resource group. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :return: An iterator like instance of either VpnGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.VpnGateway"]: + """Lists all the VpnGateways in a subscription. + + :return: An iterator like instance of either VpnGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_gateways_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnLinkConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_link_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _reset_connection_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_link_connections_reset_connection_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_reset_connection( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Resets the VpnLink connection specified. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn link connection. Required. + :type link_connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_connection_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _get_ike_sas_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + _request = build_vpn_link_connections_get_ike_sas_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_ike_sas( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> LROPoller[str]: + """Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn link connection. Required. + :type link_connection_name: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_ike_sas_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_vpn_connection( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> Iterable["_models.VpnSiteLinkConnection"]: + """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn + connection. + + :param resource_group_name: The resource group name of the vpn gateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: An iterator like instance of either VpnSiteLinkConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnSiteLinkConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_link_connections_list_by_vpn_connection_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnSiteLinkConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.VpnConnection: + """Retrieves the details of a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :return: VpnConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + + _request = build_vpn_connections_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: Union[_models.VpnConnection, IO[bytes]], + **kwargs: Any + ) -> _models.VpnConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(vpn_connection_parameters, (IOBase, bytes)): + _content = vpn_connection_parameters + else: + _json = self._serialize.body(vpn_connection_parameters, "VpnConnection") + + _request = build_vpn_connections_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: _models.VpnConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. + Required. + :type vpn_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. + Required. + :type vpn_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: Union[_models.VpnConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnConnection]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. Is + either a VpnConnection type or a IO[bytes] type. Required. + :type vpn_connection_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnConnection or + IO[bytes] + :return: An instance of LROPoller that returns either VpnConnection or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + vpn_connection_parameters=vpn_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_vpn_connections_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, gateway_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnConnectionPacketCaptureStartParameters") + else: + _json = None + + _request = build_vpn_connections_start_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[_models.VpnConnectionPacketCaptureStartParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStartParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStartParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. Is either a VpnConnectionPacketCaptureStartParameters type or a IO[bytes] + type. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStartParameters or IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[str]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "VpnConnectionPacketCaptureStopParameters") + else: + _json = None + + _request = build_vpn_connections_stop_packet_capture_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[_models.VpnConnectionPacketCaptureStopParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStopParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Default value is None. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional[Union[_models.VpnConnectionPacketCaptureStopParameters, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. Required. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. Is either a VpnConnectionPacketCaptureStopParameters type or a IO[bytes] + type. Default value is None. + :type parameters: + ~azure.mgmt.network.v2023_09_01.models.VpnConnectionPacketCaptureStopParameters or IO[bytes] + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[str] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[str].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[str](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_vpn_gateway( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Iterable["_models.VpnConnection"]: + """Retrieves all vpn connections for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either VpnConnection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnConnectionsResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_vpn_connections_list_by_vpn_gateway_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnConnectionsResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VpnSiteLinkConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_site_link_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs: Any + ) -> _models.VpnSiteLinkConnection: + """Retrieves the details of a vpn site link connection. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param connection_name: The name of the vpn connection. Required. + :type connection_name: str + :param link_connection_name: The name of the vpn connection. Required. + :type link_connection_name: str + :return: VpnSiteLinkConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnSiteLinkConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnSiteLinkConnection] = kwargs.pop("cls", None) + + _request = build_vpn_site_link_connections_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + link_connection_name=link_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnSiteLinkConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NatRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`nat_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> _models.VpnGatewayNatRule: + """Retrieves the details of a nat ruleGet. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: VpnGatewayNatRule or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + + _request = build_nat_rules_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VpnGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> _models.VpnGatewayNatRule: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(nat_rule_parameters, (IOBase, bytes)): + _content = nat_rule_parameters + else: + _json = self._serialize.body(nat_rule_parameters, "VpnGatewayNatRule") + + _request = build_nat_rules_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: _models.VpnGatewayNatRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Required. + :type nat_rule_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + nat_rule_name: str, + nat_rule_parameters: Union[_models.VpnGatewayNatRule, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnGatewayNatRule]: + """Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat + rules. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :param nat_rule_parameters: Parameters supplied to create or Update a Nat Rule. Is either a + VpnGatewayNatRule type or a IO[bytes] type. Required. + :type nat_rule_parameters: ~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule or + IO[bytes] + :return: An instance of LROPoller that returns either VpnGatewayNatRule or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnGatewayNatRule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + nat_rule_parameters=nat_rule_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnGatewayNatRule", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnGatewayNatRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnGatewayNatRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_nat_rules_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, gateway_name: str, nat_rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a nat rule. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param nat_rule_name: The name of the nat rule. Required. + :type nat_rule_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + nat_rule_name=nat_rule_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_vpn_gateway( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Iterable["_models.VpnGatewayNatRule"]: + """Retrieves all nat rules for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either VpnGatewayNatRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VpnGatewayNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVpnGatewayNatRulesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_nat_rules_list_by_vpn_gateway_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVpnGatewayNatRulesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class P2SVpnGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`p2_svpn_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.P2SVpnGateway: + """Retrieves the details of a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: P2SVpnGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.P2SVpnGateway, IO[bytes]], + **kwargs: Any + ) -> _models.P2SVpnGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "P2SVpnGateway") + + _request = build_p2_svpn_gateways_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: _models.P2SVpnGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Required. + :type p2_s_vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.P2SVpnGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. Is either a P2SVpnGateway type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway or + IO[bytes] + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(p2_s_vpn_gateway_parameters, (IOBase, bytes)): + _content = p2_s_vpn_gateway_parameters + else: + _json = self._serialize.body(p2_s_vpn_gateway_parameters, "TagsObject") + + _request = build_p2_svpn_gateways_update_tags_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Required. + :type p2_s_vpn_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.P2SVpnGateway"]: + """Lists all the P2SVpnGateways in a resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :return: An iterator like instance of either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListP2SVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.P2SVpnGateway"]: + """Lists all the P2SVpnGateways in a subscription. + + :return: An iterator like instance of either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListP2SVpnGatewaysResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_p2_svpn_gateways_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListP2SVpnGatewaysResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _reset_initial( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_reset_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reset( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Resets the primary of the p2s vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. Required. + :type resource_group_name: str + :param gateway_name: The name of the gateway. Required. + :type gateway_name: str + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _generate_vpn_profile_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.P2SVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.VpnProfileResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VpnProfileResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "P2SVpnProfileParameters") + + _request = build_p2_svpn_gateways_generate_vpn_profile_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: _models.P2SVpnProfileParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnProfileParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.P2SVpnProfileParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VpnProfileResponse]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. Is either a P2SVpnProfileParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.P2SVpnProfileParameters or IO[bytes] + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VpnProfileResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnProfileResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnProfileResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnProfileResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_p2_s_vpn_connection_health_initial( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> Optional[_models.P2SVpnGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.P2SVpnGateway]] = kwargs.pop("cls", None) + + _request = build_p2_svpn_gateways_get_p2_s_vpn_connection_health_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_get_p2_s_vpn_connection_health( + self, resource_group_name: str, gateway_name: str, **kwargs: Any + ) -> LROPoller[_models.P2SVpnGateway]: + """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.P2SVpnGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_p2_s_vpn_connection_health_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.P2SVpnGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.P2SVpnGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_p2_s_vpn_connection_health_detailed_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: Union[_models.P2SVpnConnectionHealthRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.P2SVpnConnectionHealth]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.P2SVpnConnectionHealth]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionHealthRequest") + + _request = build_p2_svpn_gateways_get_p2_s_vpn_connection_health_detailed_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("P2SVpnConnectionHealth", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: _models.P2SVpnConnectionHealthRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. + Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealthRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either P2SVpnConnectionHealth or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. + Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either P2SVpnConnectionHealth or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_p2_s_vpn_connection_health_detailed( # pylint: disable=name-too-long + self, + resource_group_name: str, + gateway_name: str, + request: Union[_models.P2SVpnConnectionHealthRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.P2SVpnConnectionHealth]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. Required. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. Is + either a P2SVpnConnectionHealthRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealthRequest or + IO[bytes] + :return: An instance of LROPoller that returns either P2SVpnConnectionHealth or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.P2SVpnConnectionHealth] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._get_p2_s_vpn_connection_health_detailed_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("P2SVpnConnectionHealth", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.P2SVpnConnectionHealth].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.P2SVpnConnectionHealth]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _disconnect_p2_s_vpn_connections_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "P2SVpnConnectionRequest") + + _request = build_p2_svpn_gateways_disconnect_p2_s_vpn_connections_request( + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: _models.P2SVpnConnectionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Required. + :type request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: Union[_models.P2SVpnConnectionRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. Required. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. Is either a + P2SVpnConnectionRequest type or a IO[bytes] type. Required. + :type request: ~azure.mgmt.network.v2023_09_01.models.P2SVpnConnectionRequest or IO[bytes] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._disconnect_p2_s_vpn_connections_initial( # type: ignore + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + request=request, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VpnServerConfigurationsAssociatedWithVirtualWanOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`vpn_server_configurations_associated_with_virtual_wan` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _list_initial( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> Optional[_models.VpnServerConfigurationsResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[_models.VpnServerConfigurationsResponse]] = kwargs.pop("cls", None) + + _request = build_vpn_server_configurations_associated_with_virtual_wan_list_request( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("VpnServerConfigurationsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list( + self, resource_group_name: str, virtual_wan_name: str, **kwargs: Any + ) -> LROPoller[_models.VpnServerConfigurationsResponse]: + """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. Required. + :type virtual_wan_name: str + :return: An instance of LROPoller that returns either VpnServerConfigurationsResponse or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VpnServerConfigurationsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VpnServerConfigurationsResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VpnServerConfigurationsResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VpnServerConfigurationsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VpnServerConfigurationsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualHubRouteTableV2SOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_hub_route_table_v2_s` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> _models.VirtualHubRouteTableV2: + """Retrieves the details of a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :return: VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + + _request = build_virtual_hub_route_table_v2_s_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: Union[_models.VirtualHubRouteTableV2, IO[bytes]], + **kwargs: Any + ) -> _models.VirtualHubRouteTableV2: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(virtual_hub_route_table_v2_parameters, (IOBase, bytes)): + _content = virtual_hub_route_table_v2_parameters + else: + _json = self._serialize.body(virtual_hub_route_table_v2_parameters, "VirtualHubRouteTableV2") + + _request = build_virtual_hub_route_table_v2_s_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: _models.VirtualHubRouteTableV2, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Required. + :type virtual_hub_route_table_v2_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualHubRouteTableV2 or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Required. + :type virtual_hub_route_table_v2_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either VirtualHubRouteTableV2 or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: Union[_models.VirtualHubRouteTableV2, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualHubRouteTableV2]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. Is either a VirtualHubRouteTableV2 type or a IO[bytes] type. Required. + :type virtual_hub_route_table_v2_parameters: + ~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2 or IO[bytes] + :return: An instance of LROPoller that returns either VirtualHubRouteTableV2 or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualHubRouteTableV2] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + virtual_hub_route_table_v2_parameters=virtual_hub_route_table_v2_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualHubRouteTableV2", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualHubRouteTableV2].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualHubRouteTableV2]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_route_table_v2_s_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. Required. + :type route_table_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> Iterable["_models.VirtualHubRouteTableV2"]: + """Retrieves the details of all VirtualHubRouteTableV2s. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either VirtualHubRouteTableV2 or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubRouteTableV2SResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_route_table_v2_s_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubRouteTableV2SResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExpressRouteGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> _models.ExpressRouteGatewayList: + """Lists ExpressRoute gateways under a given subscription. + + :return: ExpressRouteGatewayList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteGatewayList] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGatewayList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.ExpressRouteGatewayList: + """Lists ExpressRoute gateways in a given resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: ExpressRouteGatewayList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGatewayList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteGatewayList] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGatewayList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: Union[_models.ExpressRouteGateway, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteGateway: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(put_express_route_gateway_parameters, (IOBase, bytes)): + _content = put_express_route_gateway_parameters + else: + _json = self._serialize.body(put_express_route_gateway_parameters, "ExpressRouteGateway") + + _request = build_express_route_gateways_create_or_update_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: _models.ExpressRouteGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Required. + :type put_express_route_gateway_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Required. + :type put_express_route_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: Union[_models.ExpressRouteGateway, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteGateway]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. Is either a ExpressRouteGateway type or a IO[bytes] type. Required. + :type put_express_route_gateway_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + put_express_route_gateway_parameters=put_express_route_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ExpressRouteGateway]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExpressRouteGateway]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(express_route_gateway_parameters, (IOBase, bytes)): + _content = express_route_gateway_parameters + else: + _json = self._serialize.body(express_route_gateway_parameters, "TagsObject") + + _request = build_express_route_gateways_update_tags_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Required. + :type express_route_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Required. + :type express_route_gateway_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + express_route_gateway_name: str, + express_route_gateway_parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteGateway]: + """Updates express route gateway tags. + + :param resource_group_name: The resource group name of the ExpressRouteGateway. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the gateway. Required. + :type express_route_gateway_name: str + :param express_route_gateway_parameters: Parameters supplied to update a virtual wan express + route gateway tags. Is either a TagsObject type or a IO[bytes] type. Required. + :type express_route_gateway_parameters: ~azure.mgmt.network.v2023_09_01.models.TagsObject or + IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + express_route_gateway_parameters=express_route_gateway_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> _models.ExpressRouteGateway: + """Fetches the details of a ExpressRoute gateway in a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteGateway] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_get_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteGateway", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_gateways_delete_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway + resource can only be deleted when there are no connection subresources. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ExpressRouteConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`express_route_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: Union[_models.ExpressRouteConnection, IO[bytes]], + **kwargs: Any + ) -> _models.ExpressRouteConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(put_express_route_connection_parameters, (IOBase, bytes)): + _content = put_express_route_connection_parameters + else: + _json = self._serialize.body(put_express_route_connection_parameters, "ExpressRouteConnection") + + _request = build_express_route_connections_create_or_update_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: _models.ExpressRouteConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Required. + :type put_express_route_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Required. + :type put_express_route_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExpressRouteConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: Union[_models.ExpressRouteConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExpressRouteConnection]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. Is either a ExpressRouteConnection type or a IO[bytes] + type. Required. + :type put_express_route_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection or IO[bytes] + :return: An instance of LROPoller that returns either ExpressRouteConnection or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + put_express_route_connection_parameters=put_express_route_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExpressRouteConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExpressRouteConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> _models.ExpressRouteConnection: + """Gets the specified ExpressRouteConnection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the ExpressRoute connection. Required. + :type connection_name: str + :return: ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteConnection] = kwargs.pop("cls", None) + + _request = build_express_route_connections_get_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_express_route_connections_delete_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, express_route_gateway_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a connection to a ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, express_route_gateway_name: str, **kwargs: Any + ) -> _models.ExpressRouteConnectionList: + """Lists ExpressRouteConnections. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. Required. + :type express_route_gateway_name: str + :return: ExpressRouteConnectionList or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.ExpressRouteConnectionList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ExpressRouteConnectionList] = kwargs.pop("cls", None) + + _request = build_express_route_connections_list_request( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExpressRouteConnectionList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class NetworkVirtualApplianceConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`network_virtual_appliance_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: Union[_models.NetworkVirtualApplianceConnection, IO[bytes]], + **kwargs: Any + ) -> _models.NetworkVirtualApplianceConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(network_virtual_appliance_connection_parameters, (IOBase, bytes)): + _content = network_virtual_appliance_connection_parameters + else: + _json = self._serialize.body( + network_virtual_appliance_connection_parameters, "NetworkVirtualApplianceConnection" + ) + + _request = build_network_virtual_appliance_connections_create_or_update_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: _models.NetworkVirtualApplianceConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Required. + :type network_virtual_appliance_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkVirtualApplianceConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Required. + :type network_virtual_appliance_connection_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either NetworkVirtualApplianceConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + connection_name: str, + network_virtual_appliance_connection_parameters: Union[_models.NetworkVirtualApplianceConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkVirtualApplianceConnection]: + """Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the + existing NVA connection'. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :param network_virtual_appliance_connection_parameters: Parameters supplied in an + NetworkVirtualApplianceConnection PUT operation. Is either a NetworkVirtualApplianceConnection + type or a IO[bytes] type. Required. + :type network_virtual_appliance_connection_parameters: + ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection or IO[bytes] + :return: An instance of LROPoller that returns either NetworkVirtualApplianceConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + network_virtual_appliance_connection_parameters=network_virtual_appliance_connection_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkVirtualApplianceConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkVirtualApplianceConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> _models.NetworkVirtualApplianceConnection: + """Retrieves the details of specified NVA connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :return: NetworkVirtualApplianceConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceConnection] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliance_connections_get_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkVirtualApplianceConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_network_virtual_appliance_connections_delete_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_virtual_appliance_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a NVA connection. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :param connection_name: The name of the NVA connection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, network_virtual_appliance_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkVirtualApplianceConnection"]: + """Lists NetworkVirtualApplianceConnections under the NVA. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. Required. + :type network_virtual_appliance_name: str + :return: An iterator like instance of either NetworkVirtualApplianceConnection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.NetworkVirtualApplianceConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.NetworkVirtualApplianceConnectionList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_virtual_appliance_connections_list_request( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkVirtualApplianceConnectionList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualHubBgpConnectionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_hub_bgp_connection` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> _models.BgpConnection: + """Retrieves the details of a Virtual Hub Bgp Connection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: BgpConnection or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.BgpConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connection_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: Union[_models.BgpConnection, IO[bytes]], + **kwargs: Any + ) -> _models.BgpConnection: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "BgpConnection") + + _request = build_virtual_hub_bgp_connection_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BgpConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: _models.BgpConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BgpConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: Union[_models.BgpConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BgpConnection]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :param parameters: Parameters of Bgp connection. Is either a BgpConnection type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.BgpConnection or IO[bytes] + :return: An instance of LROPoller that returns either BgpConnection or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BgpConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BgpConnection", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BgpConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BgpConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connection_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param connection_name: The name of the connection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class VirtualHubBgpConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_hub_bgp_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> Iterable["_models.BgpConnection"]: + """Retrieves the details of all VirtualHubBgpConnections. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either BgpConnection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubBgpConnectionResults] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_bgp_connections_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubBgpConnectionResults", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _list_learned_routes_initial( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> Optional[Dict[str, List[_models.PeerRoute]]]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[Dict[str, List[_models.PeerRoute]]]] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connections_list_learned_routes_request( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_learned_routes( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[Dict[str, List[_models.PeerRoute]]]: + """Retrieves a list of routes the virtual hub bgp connection has learned. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. Required. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either dict mapping str to list of PeerRoute or + the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[dict[str, + list[~azure.mgmt.network.v2023_09_01.models.PeerRoute]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Dict[str, List[_models.PeerRoute]]] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_learned_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[Dict[str, List[_models.PeerRoute]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[Dict[str, List[_models.PeerRoute]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_advertised_routes_initial( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> Optional[Dict[str, List[_models.PeerRoute]]]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Optional[Dict[str, List[_models.PeerRoute]]]] = kwargs.pop("cls", None) + + _request = build_virtual_hub_bgp_connections_list_advertised_routes_request( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_advertised_routes( + self, resource_group_name: str, hub_name: str, connection_name: str, **kwargs: Any + ) -> LROPoller[Dict[str, List[_models.PeerRoute]]]: + """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. Required. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. Required. + :type connection_name: str + :return: An instance of LROPoller that returns either dict mapping str to list of PeerRoute or + the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[dict[str, + list[~azure.mgmt.network.v2023_09_01.models.PeerRoute]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[Dict[str, List[_models.PeerRoute]]] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._list_advertised_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("{[PeerRoute]}", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[Dict[str, List[_models.PeerRoute]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[Dict[str, List[_models.PeerRoute]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualHubIpConfigurationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`virtual_hub_ip_configuration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> _models.HubIpConfiguration: + """Retrieves the details of a Virtual Hub Ip configuration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :return: HubIpConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + + _request = build_virtual_hub_ip_configuration_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: Union[_models.HubIpConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.HubIpConfiguration: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "HubIpConfiguration") + + _request = build_virtual_hub_ip_configuration_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: _models.HubIpConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: Union[_models.HubIpConfiguration, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.HubIpConfiguration]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. Is either a HubIpConfiguration type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration or IO[bytes] + :return: An instance of LROPoller that returns either HubIpConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubIpConfiguration] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubIpConfiguration", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.HubIpConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.HubIpConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_virtual_hub_ip_configuration_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, ip_config_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. Required. + :type ip_config_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any + ) -> Iterable["_models.HubIpConfiguration"]: + """Retrieves the details of all VirtualHubIpConfigurations. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubIpConfiguration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListVirtualHubIpConfigurationResults] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_hub_ip_configuration_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListVirtualHubIpConfigurationResults", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class HubRouteTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`hub_route_tables` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: Union[_models.HubRouteTable, IO[bytes]], + **kwargs: Any + ) -> _models.HubRouteTable: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(route_table_parameters, (IOBase, bytes)): + _content = route_table_parameters + else: + _json = self._serialize.body(route_table_parameters, "HubRouteTable") + + _request = build_hub_route_tables_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: _models.HubRouteTable, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Required. + :type route_table_parameters: ~azure.mgmt.network.v2023_09_01.models.HubRouteTable + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Required. + :type route_table_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: Union[_models.HubRouteTable, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.HubRouteTable]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. Is either a + HubRouteTable type or a IO[bytes] type. Required. + :type route_table_parameters: ~azure.mgmt.network.v2023_09_01.models.HubRouteTable or IO[bytes] + :return: An instance of LROPoller that returns either HubRouteTable or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + route_table_parameters=route_table_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("HubRouteTable", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.HubRouteTable].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.HubRouteTable]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> _models.HubRouteTable: + """Retrieves the details of a RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :return: HubRouteTable or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.HubRouteTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.HubRouteTable] = kwargs.pop("cls", None) + + _request = build_hub_route_tables_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("HubRouteTable", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_hub_route_tables_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, route_table_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a RouteTable. + + :param resource_group_name: The resource group name of the RouteTable. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. Required. + :type route_table_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> Iterable["_models.HubRouteTable"]: + """Retrieves the details of all RouteTables. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either HubRouteTable or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListHubRouteTablesResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_hub_route_tables_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListHubRouteTablesResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RoutingIntentOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`routing_intent` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: Union[_models.RoutingIntent, IO[bytes]], + **kwargs: Any + ) -> _models.RoutingIntent: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(routing_intent_parameters, (IOBase, bytes)): + _content = routing_intent_parameters + else: + _json = self._serialize.body(routing_intent_parameters, "RoutingIntent") + + _request = build_routing_intent_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: _models.RoutingIntent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. + Required. + :type routing_intent_parameters: ~azure.mgmt.network.v2023_09_01.models.RoutingIntent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. + Required. + :type routing_intent_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + routing_intent_name: str, + routing_intent_parameters: Union[_models.RoutingIntent, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RoutingIntent]: + """Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the per VirtualHub singleton Routing Intent resource. + Required. + :type routing_intent_name: str + :param routing_intent_parameters: Parameters supplied to create or update RoutingIntent. Is + either a RoutingIntent type or a IO[bytes] type. Required. + :type routing_intent_parameters: ~azure.mgmt.network.v2023_09_01.models.RoutingIntent or + IO[bytes] + :return: An instance of LROPoller that returns either RoutingIntent or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + routing_intent_parameters=routing_intent_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RoutingIntent", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RoutingIntent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RoutingIntent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> _models.RoutingIntent: + """Retrieves the details of a RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the RoutingIntent. Required. + :type routing_intent_name: str + :return: RoutingIntent or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.RoutingIntent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.RoutingIntent] = kwargs.pop("cls", None) + + _request = build_routing_intent_get_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RoutingIntent", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routing_intent_delete_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, virtual_hub_name: str, routing_intent_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a RoutingIntent. + + :param resource_group_name: The resource group name of the RoutingIntent. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :param routing_intent_name: The name of the RoutingIntent. Required. + :type routing_intent_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + routing_intent_name=routing_intent_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, virtual_hub_name: str, **kwargs: Any) -> Iterable["_models.RoutingIntent"]: + """Retrieves the details of all RoutingIntent child resources of the VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. Required. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. Required. + :type virtual_hub_name: str + :return: An iterator like instance of either RoutingIntent or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.RoutingIntent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.ListRoutingIntentResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_routing_intent_list_request( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListRoutingIntentResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class WebApplicationFirewallPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.network.v2023_09_01.NetworkManagementClient`'s + :attr:`web_application_firewall_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.WebApplicationFirewallPolicy"]: + """Lists all of the protection policies within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :return: An iterator like instance of either WebApplicationFirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.WebApplicationFirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_application_firewall_policies_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("WebApplicationFirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_all(self, **kwargs: Any) -> Iterable["_models.WebApplicationFirewallPolicy"]: + """Gets all the WAF policies in a subscription. + + :return: An iterator like instance of either WebApplicationFirewallPolicy or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.WebApplicationFirewallPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_web_application_firewall_policies_list_all_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + _request = HttpRequest("GET", next_link) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("WebApplicationFirewallPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, resource_group_name: str, policy_name: str, **kwargs: Any) -> _models.WebApplicationFirewallPolicy: + """Retrieve protection policy with specified name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[_models.WebApplicationFirewallPolicy] = kwargs.pop("cls", None) + + _request = build_web_application_firewall_policies_get_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: _models.WebApplicationFirewallPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: Union[_models.WebApplicationFirewallPolicy, IO[bytes]], + **kwargs: Any + ) -> _models.WebApplicationFirewallPolicy: + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :param parameters: Policy to be created. Is either a WebApplicationFirewallPolicy type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy or + IO[bytes] + :return: WebApplicationFirewallPolicy or the result of cls(response) + :rtype: ~azure.mgmt.network.v2023_09_01.models.WebApplicationFirewallPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WebApplicationFirewallPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "WebApplicationFirewallPolicy") + + _request = build_web_application_firewall_policies_create_or_update_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("WebApplicationFirewallPolicy", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, policy_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_web_application_firewall_policies_delete_request( + resource_group_name=resource_group_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, policy_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes Policy. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param policy_name: The name of the policy. Required. + :type policy_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + policy_name=policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/_patch.py b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/py.typed b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/azure-firewall/azext_firewall/vendored_sdks/v_2023_09_01/v2023_09_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/azure-firewall/setup.py b/src/azure-firewall/setup.py index 161b675cb81..4246c5f4812 100644 --- a/src/azure-firewall/setup.py +++ b/src/azure-firewall/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "1.0.1" +VERSION = "1.1.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta',